teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.7.1-abs-filelist.patch

Panu Matilainen 62b405
commit 4018bbd08e84fd0cc227dcb8d2dc20693ce2296a
Panu Matilainen 62b405
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 62b405
Date:   Tue Sep 15 10:56:58 2009 +0300
Panu Matilainen 62b405
Panu Matilainen 62b405
    Allow absolute paths in file lists again (SuseBug:535594, RhBug:521760)
Panu Matilainen 62b405
    - patch from OpenSUSE / Michael Schroeder
Panu Matilainen 62b405
    - build-time generated file lists should be placed in the build directory,
Panu Matilainen 62b405
      but at least one valid use case for this is things like %files -f %{SOURCE10}
Panu Matilainen 62b405
Panu Matilainen 62b405
diff --git a/build/files.c b/build/files.c
Panu Matilainen 62b405
index b5c5437..061494d 100644
Panu Matilainen 62b405
--- a/build/files.c
Panu Matilainen 62b405
+++ b/build/files.c
Panu Matilainen 62b405
@@ -1755,9 +1755,13 @@ static rpmRC processPackageFiles(rpmSpec spec, Package pkg,
Panu Matilainen 62b405
 
Panu Matilainen 62b405
 	argvSplit(&filelists, getStringBuf(pkg->fileFile), "\n");
Panu Matilainen 62b405
 	for (fp = filelists; *fp != NULL; fp++) {
Panu Matilainen 62b405
-	    ffn = rpmGetPath("%{_builddir}/",
Panu Matilainen 62b405
-		(spec->buildSubdir ? spec->buildSubdir : "") ,
Panu Matilainen 62b405
-		"/", *fp, NULL);
Panu Matilainen 62b405
+	    if (**fp == '/') {
Panu Matilainen 62b405
+		ffn = rpmGetPath(*fp, NULL);
Panu Matilainen 62b405
+	    } else {
Panu Matilainen 62b405
+		ffn = rpmGetPath("%{_builddir}/",
Panu Matilainen 62b405
+		    (spec->buildSubdir ? spec->buildSubdir : "") ,
Panu Matilainen 62b405
+		    "/", *fp, NULL);
Panu Matilainen 62b405
+	    }
Panu Matilainen 62b405
 	    fd = fopen(ffn, "r");
Panu Matilainen 62b405
 
Panu Matilainen 62b405
 	    if (fd == NULL || ferror(fd)) {