diff options
author | tv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2012-06-26 18:14:33 +0000 |
---|---|---|
committer | tv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2012-06-26 18:14:33 +0000 |
commit | e1ec2d9d1128448df16ee25ff7f920be69c9581d (patch) | |
tree | 6f8bf1a07417a898f31fc1ab240b39b0577e3eaf /RPM4/src/RPM4.xs | |
parent | 5db6ec0cdfd6c76c425182513311476ad140f347 (diff) | |
download | perl-RPM4-e1ec2d9d1128448df16ee25ff7f920be69c9581d.tar perl-RPM4-e1ec2d9d1128448df16ee25ff7f920be69c9581d.tar.gz perl-RPM4-e1ec2d9d1128448df16ee25ff7f920be69c9581d.tar.bz2 perl-RPM4-e1ec2d9d1128448df16ee25ff7f920be69c9581d.tar.xz perl-RPM4-e1ec2d9d1128448df16ee25ff7f920be69c9581d.zip |
merge rpmsign() from RPM4sign.c into RPM4.xs
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@224 971eb68f-4bfb-0310-8326-d2484c010a4c
Diffstat (limited to 'RPM4/src/RPM4.xs')
-rw-r--r-- | RPM4/src/RPM4.xs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index a2002ea..e2ee589 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -84,6 +84,10 @@ #include <rpm/rpmlog.h> #include <rpm/rpmpgp.h> #include <rpm/rpmtag.h> +#include <rpm/rpmcli.h> +#ifdef RPM4_9_0 +#include <rpm/rpmsign.h> +#endif #ifdef HAVE_RPMCONSTANT #include <rpmconstant/rpmconstant.h> @@ -489,6 +493,23 @@ int _headername_vs_dep(Header h, rpmds dep, int nopromote) { /* return 1 if match */ } +/* Hight level function */ +int rpmsign(char *passphrase, const char *rpm) { +#ifdef RPM4_9_0 + return rpmPkgSign(rpm, NULL, passphrase); +#else + QVA_t qva = &rpmQVKArgs; + ARGV_t file = NULL; + + argvAdd(&file, rpm); + + qva->qva_mode = RPMSIGN_ADD_SIGNATURE; + qva->passPhrase = passphrase; + + return rpmcliSign(NULL, qva, file); +#endif +} + MODULE = RPM4 PACKAGE = RPM4 BOOT: |