rpm/0005-Fix-behavior-when-_build_id_links-is-undefined.patch

33 lines
1.3 KiB
Diff
Raw Normal View History

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