Require %files section for package generation again
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 23 Dec 2010 07:24:25 +0000 (09:24 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 23 Dec 2010 07:24:25 +0000 (09:24 +0200)
- 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

build/files.c
build/pack.c
build/parseFiles.c
build/spec.c
tests/data/SPECS/verifyscript.spec
tests/data/SPECS/versiontest.spec

index 71cc590..8d7fb2e 100644 (file)
@@ -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);
index 839b816..7db2a97 100644 (file)
@@ -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;
        
index f7a8369..7c51c3a 100644 (file)
@@ -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) {
index 9fbaa22..19b6bb6 100644 (file)
@@ -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;
 
index c6bd732..cc7a124 100644 (file)
@@ -14,3 +14,6 @@ BuildArch:    noarch
 if not posix.access("/var/checkme", "f") then
    error("bad")
 end
+
+%files
+%defattr(-,root,root)
index 892c130..e241c83 100644 (file)
@@ -12,3 +12,6 @@ BuildArch:    noarch
 
 %clean
 rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)