aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs19
1 files changed, 10 insertions, 9 deletions
diff --git a/URPM.xs b/URPM.xs
index 65729a5..c40dea9 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3073,34 +3073,35 @@ Urpm_verify_rpm(filename, ...)
PREINIT:
FD_t fd;
int i, oldlogmask;
- rpmts ts = NULL;
- struct rpmQVKArguments_s qva;
+ rpmVSFlags vsflags;
CODE:
/* Don't display error messages */
oldlogmask = rpmlogSetMask(RPMLOG_UPTO(RPMLOG_PRI(4)));
- memset(&qva, 0, sizeof(struct rpmQVKArguments_s));
- qva.qva_source = RPMQV_RPM;
- qva.qva_flags = VERIFY_ALL;
+ vsflags = RPMVSF_DEFAULT;
for (i = 1 ; i < items - 1 ; i += 2) {
STRLEN len;
char *s = SvPV(ST(i), len);
if (SvIV(ST(i+1))) {
if (len == 9 && !strncmp(s, "nodigests", 9))
- qva.qva_flags &= ~VERIFY_DIGEST;
+ vsflags |= _RPMVSF_NODIGESTS;
else if (len == 12 && !strncmp(s, "nosignatures", 12))
- qva.qva_flags &= ~VERIFY_SIGNATURE;
+ vsflags |= _RPMVSF_NOSIGNATURES;
}
}
fd = Fopen(filename, "r");
if (fd == NULL)
RETVAL = 0;
else {
+ Header h;
read_config_files(0);
- ts = rpmtsCreate();
+ rpmts ts = rpmtsCreate();
rpmtsSetRootDir(ts, "/");
rpmtsOpenDB(ts, O_RDONLY);
- RETVAL = rpmVerifySignatures(&qva, ts, fd, filename) ? 0 : 1;
+ rpmtsSetVSFlags(ts, vsflags);
+ RETVAL = (rpmReadPackageFile(ts, fd, filename, &h) == RPMRC_OK);
Fclose(fd);
+ if (h)
+ h = headerFree(h);
(void)rpmtsFree(ts);
}
rpmlogSetMask(oldlogmask);