Allow absolute paths in file lists again (SuseBug:535594, RhBug:521760)
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 15 Sep 2009 07:56:58 +0000 (10:56 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 15 Sep 2009 07:56:58 +0000 (10:56 +0300)
- patch from OpenSUSE / Michael Schroeder
- build-time generated file lists should be placed in the build directory,
  but at least one valid use case for this is things like %files -f %{SOURCE10}

build/files.c

index b5c5437..061494d 100644 (file)
@@ -1755,9 +1755,13 @@ static rpmRC processPackageFiles(rpmSpec spec, Package pkg,
 
        argvSplit(&filelists, getStringBuf(pkg->fileFile), "\n");
        for (fp = filelists; *fp != NULL; fp++) {
-           ffn = rpmGetPath("%{_builddir}/",
-               (spec->buildSubdir ? spec->buildSubdir : "") ,
-               "/", *fp, NULL);
+           if (**fp == '/') {
+               ffn = rpmGetPath(*fp, NULL);
+           } else {
+               ffn = rpmGetPath("%{_builddir}/",
+                   (spec->buildSubdir ? spec->buildSubdir : "") ,
+                   "/", *fp, NULL);
+           }
            fd = fopen(ffn, "r");
 
            if (fd == NULL || ferror(fd)) {