diff --git a/lib/depends.cc b/lib/depends.cc index 8b44cdebad..d91e4fb627 100644 --- a/lib/depends.cc +++ b/lib/depends.cc @@ -453,14 +453,14 @@ int rpmtsAddInstallElement(rpmts ts, Header h, fnpyKey key, int upgrade, rpmRelocation * relocs) { int op = (upgrade == 0) ? RPMTE_INSTALL : RPMTE_UPGRADE; - if (rpmtsSetupTransactionPlugins(ts) == RPMRC_FAIL) + if (rpmtsSetupTransactionPlugins(ts, h) == RPMRC_FAIL) return 1; return addPackage(ts, h, key, op, relocs); } int rpmtsAddReinstallElement(rpmts ts, Header h, fnpyKey key) { - if (rpmtsSetupTransactionPlugins(ts) == RPMRC_FAIL) + if (rpmtsSetupTransactionPlugins(ts, h) == RPMRC_FAIL) return 1; /* TODO: pull relocations from installed package */ /* TODO: should reinstall of non-installed package fail? */ @@ -470,7 +470,7 @@ int rpmtsAddReinstallElement(rpmts ts, Header h, fnpyKey key) int rpmtsAddRestoreElement(rpmts ts, Header h) { tsMembers tsmem = rpmtsMembers(ts); - if (rpmtsSetupTransactionPlugins(ts) == RPMRC_FAIL) + if (rpmtsSetupTransactionPlugins(ts, h) == RPMRC_FAIL) return 1; rpmte p = rpmteNew(ts, h, TR_RESTORED, NULL, NULL, 0); @@ -485,7 +485,7 @@ int rpmtsAddRestoreElement(rpmts ts, Header h) int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset) { - if (rpmtsSetupTransactionPlugins(ts) == RPMRC_FAIL) + if (rpmtsSetupTransactionPlugins(ts, h) == RPMRC_FAIL) return 1; return removePackage(ts, h, NULL); } diff --git a/lib/rpmts_internal.hh b/lib/rpmts_internal.hh index d1832d102f..4f66b0950c 100644 --- a/lib/rpmts_internal.hh +++ b/lib/rpmts_internal.hh @@ -131,7 +131,7 @@ RPM_GNUC_INTERNAL int rpmtsSolve(rpmts ts, rpmds key); RPM_GNUC_INTERNAL -rpmRC rpmtsSetupTransactionPlugins(rpmts ts); +rpmRC rpmtsSetupTransactionPlugins(rpmts ts, Header h); RPM_GNUC_INTERNAL rpmRC runScript(rpmts ts, rpmte te, Header h, ARGV_const_t prefixes, diff --git a/lib/transaction.cc b/lib/transaction.cc index 4d411fe40a..8a3f368c87 100644 --- a/lib/transaction.cc +++ b/lib/transaction.cc @@ -1590,13 +1590,17 @@ static int rpmtsProcess(rpmts ts) return rc; } -rpmRC rpmtsSetupTransactionPlugins(rpmts ts) +rpmRC rpmtsSetupTransactionPlugins(rpmts ts, Header h) { rpmRC rc = RPMRC_OK; ARGV_t files = NULL; int nfiles = 0; char *dsoPath = NULL; + /* Source packages aren't really installed, only unpacked */ + if (headerIsSource(h)) + return RPMRC_OK; + /* * Assume allocated equals initialized. There are some oddball cases * (verification of non-installed package) where this is not true diff --git a/tests/rpmdevel.at b/tests/rpmdevel.at index 03908c88d6..2bf28322b7 100644 --- a/tests/rpmdevel.at +++ b/tests/rpmdevel.at @@ -43,6 +43,9 @@ runroot rpmbuild --quiet -bb \ /data/SPECS/simple.spec \ /data/SPECS/fakeshell.spec +runroot rpmbuild --quiet -bs \ + /data/SPECS/simple.spec + runroot rpm -U /build/RPMS/noarch/fakeshell-1.0-1.noarch.rpm cmake /data/debugplugin && make && make install DESTDIR=${RPMTEST} @@ -70,5 +73,12 @@ debug_psm_post: simple-1.0-1.noarch:0 debug_tsm_post: 0 debug_cleanup ]) -RPMTEST_CLEANUP +RPMTEST_CHECK([ +runroot rpm -i /build/SRPMS/simple-1.0-1.src.rpm +], +[0], +[], +[]) + +RPMTEST_CLEANUP