rpm --verify -p <rpm> doesn't run verifyscripts since rpm-4.8. For rpm-4.9 it segfaults. The code fakes an TR_REMOVE TE, which works for installed packages but fails if an rpm is given on the command line.
It segfaults in 4.9 because of the collection code. I don't think collections should be run for --verify ;-) Patch attached. It now calls rpmteNew() directly and uses rpmteSetHeader() to attach the heade. I also needed to change the code in rpmte so that it no longer calls rpmteOpen() for a PKG_VERIFY goal, but that doesn't seem to be bad anyway. Cheers, Michael. -- Michael Schroeder m...@suse.de SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
--- ./lib/rpmte.c.orig 2011-05-12 15:22:06.000000000 +0000 +++ ./lib/rpmte.c 2011-05-12 15:23:39.000000000 +0000 @@ -905,15 +905,19 @@ int rpmteProcess(rpmte te, pkgGoal goal) } } - rpmteRunAllCollections(te, PLUGINHOOK_COLL_PRE_REMOVE); - - if (rpmteOpen(te, reset_fi)) { + if (goal == PKG_VERIFY) { failed = rpmpsmRun(te->ts, te, goal); - rpmteClose(te, reset_fi); - } + } else { + rpmteRunAllCollections(te, PLUGINHOOK_COLL_PRE_REMOVE); + + if (rpmteOpen(te, reset_fi)) { + failed = rpmpsmRun(te->ts, te, goal); + rpmteClose(te, reset_fi); + } - rpmteRunAllCollections(te, PLUGINHOOK_COLL_POST_ADD); - rpmteRunAllCollections(te, PLUGINHOOK_COLL_POST_ANY); + rpmteRunAllCollections(te, PLUGINHOOK_COLL_POST_ADD); + rpmteRunAllCollections(te, PLUGINHOOK_COLL_POST_ANY); + } /* XXX should %pretrans failure fail the package install? */ if (failed && !scriptstage) { --- ./lib/verify.c.orig 2011-05-12 15:22:01.000000000 +0000 +++ ./lib/verify.c 2011-05-12 15:22:49.000000000 +0000 @@ -267,11 +267,11 @@ static int rpmVerifyScript(rpmts ts, Hea if (headerIsEntry(h, RPMTAG_VERIFYSCRIPT)) { /* fake up a erasure transaction element */ - (void) rpmtsAddEraseElement(ts, h, -1); - - rc = (rpmteProcess(rpmtsElement(ts, 0), PKG_VERIFY) != RPMRC_OK); - + rpmte p = rpmteNew(ts, h, TR_REMOVED, NULL, NULL); + rpmteSetHeader(p, h); + rc = (rpmteProcess(p, PKG_VERIFY) != RPMRC_OK); /* clean up our fake transaction bits */ + rpmteFree(p); rpmtsEmpty(ts); }
_______________________________________________ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint