diff --git a/lib/fsm.cc b/lib/fsm.cc index 63580c25ad..4879fc306a 100644 --- a/lib/fsm.cc +++ b/lib/fsm.cc @@ -875,13 +875,21 @@ static rpmfi fsmIterFini(rpmfi fi, struct diriter_s *di) return rpmfiFree(fi); } +static rpmPlugins fsmPlugins(rpmts ts, rpmte te) +{ + if (headerIsEntry(rpmteHeader(te), RPMTAG_SOURCEPACKAGE)) + return NULL; + else + return rpmtsPlugins(ts); +} + int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files, rpmpsm psm, char ** failedFile) { FD_t payload = rpmtePayload(te); rpmfi fi = NULL; rpmfs fs = rpmteGetFileStates(te); - rpmPlugins plugins = rpmtsPlugins(ts); + rpmPlugins plugins = fsmPlugins(ts, te); int rc = 0; int fx = -1; int fc = rpmfilesFC(files); @@ -1123,7 +1131,7 @@ int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfiles files, struct diriter_s di = { -1, -1 }; rpmfi fi = fsmIter(NULL, files, RPMFI_ITER_BACK, &di); rpmfs fs = rpmteGetFileStates(te); - rpmPlugins plugins = rpmtsPlugins(ts); + rpmPlugins plugins = fsmPlugins(ts, te); int fc = rpmfilesFC(files); int fx = -1; struct filedata_s *fdata = (struct filedata_s *)xcalloc(fc, sizeof(*fdata)); diff --git a/tests/rpmdevel.at b/tests/rpmdevel.at index 03908c88d6..471d034b4e 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,14 @@ 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], +[], +[debug_init +debug_cleanup +]) + +RPMTEST_CLEANUP