teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame 0005-Fix-behavior-when-_build_id_links-is-undefined.patch

Panu Matilainen 5b4d98
From 1a8a0364fd049f3b4432633160fba12aa137f88d Mon Sep 17 00:00:00 2001
Panu Matilainen 5b4d98
Message-Id: <1a8a0364fd049f3b4432633160fba12aa137f88d.1488964568.git.pmatilai@redhat.com>
Panu Matilainen 5b4d98
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
Panu Matilainen 5b4d98
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
Panu Matilainen 5b4d98
From: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 5b4d98
Date: Mon, 3 Oct 2016 12:36:46 +0300
Panu Matilainen 5b4d98
Subject: [PATCH 05/11] Fix behavior when %_build_id_links is undefined
Panu Matilainen 5b4d98
Panu Matilainen 5b4d98
Commit bbfe1f86b2e4b5c0bd499d9f3dd9de9c9c20fff2 tries to behave sanely
Panu Matilainen 5b4d98
and use compat setting when %_build_id_links is undefined, but
Panu Matilainen 5b4d98
rpmExpand() never returns NULL so the original check is incorrect.
Panu Matilainen 5b4d98
Check for empty string instead.
Panu Matilainen 5b4d98
---
Panu Matilainen 5b4d98
 build/files.c | 2 +-
Panu Matilainen 5b4d98
 1 file changed, 1 insertion(+), 1 deletion(-)
Panu Matilainen 5b4d98
Panu Matilainen 5b4d98
diff --git a/build/files.c b/build/files.c
Panu Matilainen 5b4d98
index eb39856..6215bf8 100644
Panu Matilainen 5b4d98
--- a/build/files.c
Panu Matilainen 5b4d98
+++ b/build/files.c
Panu Matilainen 5b4d98
@@ -1648,7 +1648,7 @@ static int generateBuildIDs(FileList fl)
Panu Matilainen 5b4d98
     /* How are we supposed to create the build-id links?  */
Panu Matilainen 5b4d98
     char *build_id_links_macro = rpmExpand("%{?_build_id_links}", NULL);
Panu Matilainen 5b4d98
     int build_id_links;
Panu Matilainen 5b4d98
-    if (build_id_links_macro == NULL) {
Panu Matilainen 5b4d98
+    if (*build_id_links_macro == '\0') {
Panu Matilainen 5b4d98
 	rpmlog(RPMLOG_WARNING,
Panu Matilainen 5b4d98
 	       _("_build_id_links macro not set, assuming 'compat'\n"));
Panu Matilainen 5b4d98
 	build_id_links = BUILD_IDS_COMPAT;
Panu Matilainen 5b4d98
-- 
Panu Matilainen 5b4d98
2.9.3
Panu Matilainen 5b4d98