diff options
author | Slava Barinov <v.barinov@samsung.com> | 2018-10-03 11:33:36 +0300 |
---|---|---|
committer | Dongkyun Son <dongkyun.s@samsung.com> | 2018-10-29 12:33:00 +0000 |
commit | b05a3cf2c82b4981f55ac264a4790d79307a0950 (patch) | |
tree | 30a26134ba8efdbe1eb6465be6b58220d90dfcea | |
parent | db1f91e6048a9fb1c0e0441fde192def20995319 (diff) | |
download | rpm-b05a3cf2c82b4981f55ac264a4790d79307a0950.tar.gz rpm-b05a3cf2c82b4981f55ac264a4790d79307a0950.tar.bz2 rpm-b05a3cf2c82b4981f55ac264a4790d79307a0950.zip |
Add BUILDINFO rpm tagsubmit/tizen_base/20181031.095739accepted/tizen/base/20181102.125658
The tag is intended for storage of Sanitizer build information or toolchain
details. The tag is array of strings and it can be added to .spec file using
line
BuildInfo: buildtag1 buildtag2
or by defining tag trough
%define _buildinfo buildtag1
Also the tag value can be queried using regular rpm query syntax:
rpm -qp --queryformat "[%{BUILDINFO}\n]"
The storage is intended for use at least for sanitized firmwares, but can be
reused for storing any information required for Tizen build details.
Change-Id: Icfc0c384c5a5d3b82973ee0be9345e396723174c
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
-rw-r--r-- | build/parsePreamble.c | 12 | ||||
-rw-r--r-- | lib/rpmtag.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 523e452e3..c3370538a 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -837,6 +837,7 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, break; } case RPMTAG_COLLECTIONS: + case RPMTAG_BUILDINFO: if (addOrAppendListEntry(pkg->header, tag, field)) goto exit; break; @@ -920,6 +921,7 @@ static struct PreambleRec_s const preambleList[] = { {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildsupplements")}, {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildenhances")}, {RPMTAG_SECMANIFEST, 0, 0, LEN_AND_STR("manifest")}, + {RPMTAG_BUILDINFO, 0, 0, LEN_AND_STR("buildinfo")}, {0, 0, 0, 0} }; @@ -1058,7 +1060,15 @@ 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 * still contain unexpanded macros but it cannot be empty or '/', and it diff --git a/lib/rpmtag.h b/lib/rpmtag.h index 025a0a415..51691018e 100644 --- a/lib/rpmtag.h +++ b/lib/rpmtag.h @@ -307,6 +307,8 @@ typedef enum rpmTag_e { RPMTAG_OBSOLETENEVRS = 5043, /* s[] extension */ RPMTAG_CONFLICTNEVRS = 5044, /* s[] extension */ RPMTAG_FILENLINKS = 5045, /* i[] extension */ + /* Skip numbers which might be used in new RPM versions */ + RPMTAG_BUILDINFO = 7000, /* s[] information about build */ RPMTAG_FIRSTFREE_TAG /*!< internal */ } rpmTag; |