Skip to content

Commit

Permalink
Don't run plugins for srpm
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnks committed Nov 21, 2024
1 parent d5de4c7 commit 269023f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
12 changes: 10 additions & 2 deletions lib/fsm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down
14 changes: 13 additions & 1 deletion tests/rpmdevel.at
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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

0 comments on commit 269023f

Please sign in to comment.