summaryrefslogtreecommitdiff
path: root/lib/verify.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-05-25 14:26:51 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-05-25 14:26:51 +0300
commit563f7c0dad5a748e1861f92087044d780787c766 (patch)
treea9cb6825f473e3fc8ade8190cbdd484ef6f177b2 /lib/verify.c
parent099f09de45cb7c241980da4e8cde7de61f5c1936 (diff)
downloadlibrpm-tizen-563f7c0dad5a748e1861f92087044d780787c766.tar.gz
librpm-tizen-563f7c0dad5a748e1861f92087044d780787c766.tar.bz2
librpm-tizen-563f7c0dad5a748e1861f92087044d780787c766.zip
Permit %verifyscript from non-installed packages
- Verification from non-installed packages can be useful sometimes: http://lists.rpm.org/pipermail/rpm-maint/2011-May/003015.html - %verifyscript is unlike all other scriptlets so might as well take some shortcuts and bypass rpmteProcess() & all, just create a lone rpmte, force the header we got and call rpmpsmRun() directly on it, bypassing rpmteProcess() which is only an unnecessary complication here (based on patch by Michael Schroeder)
Diffstat (limited to 'lib/verify.c')
-rw-r--r--lib/verify.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/verify.c b/lib/verify.c
index 8c8d1026e..28a031139 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -262,12 +262,13 @@ static int rpmVerifyScript(rpmts ts, Header h)
if (headerIsEntry(h, RPMTAG_VERIFYSCRIPT)) {
/* fake up a erasure transaction element */
- (void) rpmtsAddEraseElement(ts, h, -1);
+ rpmte p = rpmteNew(ts, h, TR_REMOVED, NULL, NULL);
+ rpmteSetHeader(p, h);
- rc = (rpmteProcess(rpmtsElement(ts, 0), PKG_VERIFY) != RPMRC_OK);
+ rc = (rpmpsmRun(ts, p, PKG_VERIFY) != RPMRC_OK);
/* clean up our fake transaction bits */
- rpmtsEmpty(ts);
+ rpmteFree(p);
}
return rc;