From: Panu Matilainen Date: Thu, 23 Dec 2010 07:24:25 +0000 (+0200) Subject: Require %files section for package generation again X-Git-Tag: rpm-4.10.0-beta1~773 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b76fa1a7fdf738ccd45dd70a5489d5110a6d5534;p=platform%2Fupstream%2Frpm.git Require %files section for package generation again - Turns out this change does more harm than good, people are actually relying on this behavior to avoid zillion conditionals in the spec. We'll want a saner way to conditionally disable/enable packages but until we have that, revert to the former longstanding behavior. - This effectively reverts commit d010ec1c9026b35f5b2521be965c03c826894ce8 --- diff --git a/build/files.c b/build/files.c index 71cc590..8d7fb2e 100644 --- a/build/files.c +++ b/build/files.c @@ -2117,6 +2117,10 @@ rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { char *nvr; const char *a; + + if (pkg->fileList == NULL) + continue; + headerPutString(pkg->header, RPMTAG_SOURCERPM, spec->sourceRpmName); nvr = headerGetAsString(pkg->header, RPMTAG_NVRA); diff --git a/build/pack.c b/build/pack.c index 839b816..7db2a97 100644 --- a/build/pack.c +++ b/build/pack.c @@ -680,6 +680,9 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { char *fn; + if (pkg->fileList == NULL) + continue; + if ((rc = processScriptFiles(spec, pkg))) return rc; diff --git a/build/parseFiles.c b/build/parseFiles.c index f7a8369..7c51c3a 100644 --- a/build/parseFiles.c +++ b/build/parseFiles.c @@ -72,6 +72,8 @@ int parseFiles(rpmSpec spec) } } + pkg->fileList = argvNew(); + if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) { nextPart = PART_NONE; } else if (rc < 0) { diff --git a/build/spec.c b/build/spec.c index 9fbaa22..19b6bb6 100644 --- a/build/spec.c +++ b/build/spec.c @@ -99,7 +99,7 @@ Package newPackage(rpmSpec spec) p->header = headerNew(); p->autoProv = 1; p->autoReq = 1; - p->fileList = argvNew(); + p->fileList = NULL; p->fileFile = NULL; p->policyList = NULL; diff --git a/tests/data/SPECS/verifyscript.spec b/tests/data/SPECS/verifyscript.spec index c6bd732..cc7a124 100644 --- a/tests/data/SPECS/verifyscript.spec +++ b/tests/data/SPECS/verifyscript.spec @@ -14,3 +14,6 @@ BuildArch: noarch if not posix.access("/var/checkme", "f") then error("bad") end + +%files +%defattr(-,root,root) diff --git a/tests/data/SPECS/versiontest.spec b/tests/data/SPECS/versiontest.spec index 892c130..e241c83 100644 --- a/tests/data/SPECS/versiontest.spec +++ b/tests/data/SPECS/versiontest.spec @@ -12,3 +12,6 @@ BuildArch: noarch %clean rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root)