summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Barinov <v.barinov@samsung.com>2018-12-12 10:59:45 +0300
committerSlava Barinov <v.barinov@samsung.com>2018-12-27 14:49:56 +0300
commit6c595f38457231d53c27dd28446b9bf71bf248af (patch)
tree8e97ddc5ed134218e4aeae8aa1c9bb87ba256398
parentb05a3cf2c82b4981f55ac264a4790d79307a0950 (diff)
downloadrpm-6c595f38457231d53c27dd28446b9bf71bf248af.tar.gz
rpm-6c595f38457231d53c27dd28446b9bf71bf248af.tar.bz2
rpm-6c595f38457231d53c27dd28446b9bf71bf248af.zip
Move %_buildinfo setup into %pack section
This allows to change %_buildinfo tag during the package build if required and allows customization of tag basing on build environment, e.g. for ASan builds. Change-Id: I0104c0eed3c16ac6edccc2c7a74fb12d38fff8aa Signed-off-by: Slava Barinov <v.barinov@samsung.com>
-rw-r--r--build/pack.c23
-rw-r--r--build/parsePreamble.c8
2 files changed, 22 insertions, 9 deletions
diff --git a/build/pack.c b/build/pack.c
index 6480cecaa..b6c808e09 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -330,7 +330,28 @@ static rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileNam
rasprintf(cookie, "%s %d", buildHost(), (int) (*getBuildTime()));
headerPutString(h, RPMTAG_COOKIE, *cookie);
}
-
+
+ /*
+ * Add system-wide Tizen build information
+ */
+ char *buildinfo = rpmExpand("%{?_buildinfo}", NULL);
+ if (buildinfo && *buildinfo) {
+ int err;
+ int count = 0;
+ char **strings = NULL;
+
+ if ((err = poptParseArgvString(buildinfo, &count, &strings))) {
+ rpmlog(RPMLOG_ERR, _("Can't parse BUILDINFO tag: %s\n"), poptStrerror(xx));
+ goto exit;
+ }
+
+ if (count)
+ headerPutStringArray(h, RPMTAG_BUILDINFO, strings, count);
+
+ strings = _free(strings);
+ }
+ free(buildinfo);
+
/* Reallocate the header into one contiguous region. */
h = headerReload(h, RPMTAG_HEADERIMMUTABLE);
if (h == NULL) { /* XXX can't happen */
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index c3370538a..f02e14e92 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -1060,14 +1060,6 @@ int parsePreamble(rpmSpec spec, int initialPackage)
}
}
- {
- /*
- * Add system-wide Tizen build information
- */
- char *value = rpmExpand("%{?_buildinfo}", NULL);
- addOrAppendListEntry(pkg->header, RPMTAG_BUILDINFO, value);
- }
-
/*
* Expand buildroot one more time to get %{version} and the like
* from the main package, validate sanity. The spec->buildRoot could