diff options
author | SoonKyu Park <sk7.park@samsung.com> | 2016-01-14 15:16:11 +0900 |
---|---|---|
committer | SoonKyu Park <sk7.park@samsung.com> | 2016-01-14 16:41:46 +0900 |
commit | 6ee9615a00c4b4c1726309ad54dad1193434a3e0 (patch) | |
tree | a0d9da9a7aff3770a3aa5b6221dfd975b1c9a100 | |
parent | 9cf156d6583a9f9581000bb12ff047980ebcef03 (diff) | |
download | rpm-6ee9615a00c4b4c1726309ad54dad1193434a3e0.tar.gz rpm-6ee9615a00c4b4c1726309ad54dad1193434a3e0.tar.bz2 rpm-6ee9615a00c4b4c1726309ad54dad1193434a3e0.zip |
Change how to add Package Provide to debuginfo package : add Package Provide using addPackageProvides_for_debuginfo_pkgsubmit/tizen_common/20160119.101937submit/tizen_base/20160115.000631accepted/tizen/common/20160120.100937accepted/tizen/base/20160115.111010accepted/tizen_common
Change-Id: Iee094726b58250b7e86ebd3b508e30eb7c5389c9
-rw-r--r-- | build/files.c | 47 | ||||
-rw-r--r-- | fileattrs/debuginfo.attr | 3 |
2 files changed, 49 insertions, 1 deletions
diff --git a/build/files.c b/build/files.c index 63cac8bc3..bb259253c 100644 --- a/build/files.c +++ b/build/files.c @@ -290,6 +290,42 @@ static VFA_t const verifyAttrs[] = { { NULL, 0 } }; +/** + * Add 'provides' information to debuginfo package + * @param h Header information from debuginfo package + * @return nothing + */ +static void addPackageProvides_for_debuginfo_pkg(Header h) +{ + const char *arch, *name; + char *evr, *isaprov; + rpmsenseFlags pflags = RPMSENSE_EQUAL; + + /* <name> = <evr> provide */ + name = headerGetString(h, RPMTAG_NAME); + arch = headerGetString(h, RPMTAG_ARCH); + evr = headerGetAsString(h, RPMTAG_EVR); + headerPutString(h, RPMTAG_PROVIDENAME, name); + headerPutString(h, RPMTAG_PROVIDEVERSION, evr); + headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pflags, 1); + + /* + * <name>(<isa>) = <evr> provide + * FIXME: noarch needs special casing for now as BuildArch: noarch doesn't + * cause reading in the noarch macros :-/ + */ + + isaprov = rpmExpand(name, "%{?_isa}", NULL); + if (!rstreq(arch, "noarch") && !rstreq(name, isaprov)) { + headerPutString(h, RPMTAG_PROVIDENAME, isaprov); + headerPutString(h, RPMTAG_PROVIDEVERSION, evr); + headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pflags, 1); + } + + free(isaprov); + free(evr); +} + static rpmFlags vfaMatch(VFA_t *attrs, const char *token, rpmFlags *flags) { VFA_t *vfa; @@ -2234,9 +2270,13 @@ static rpmTag copyTagsForDebug[] = { static void addDebuginfoPackage(rpmSpec spec, Package pkg, char *buildroot) { const char *a; + const char *ver, *rel; elf_version(EV_CURRENT); a = headerGetString(pkg->header, RPMTAG_ARCH); + ver = headerGetAsString(pkg->header, RPMTAG_VERSION); + rel = headerGetAsString(pkg->header, RPMTAG_RELEASE); + if (strcmp(a, "noarch") != 0 && strcmp(a, "src") != 0 && strcmp(a, "nosrc") != 0) { Package dbg; @@ -2314,6 +2354,9 @@ static void addDebuginfoPackage(rpmSpec spec, Package pkg, char *buildroot) /* Set name, summary and group. */ snprintf (tmp, 1024, "%s-debuginfo", name); headerPutString(dbg->header, RPMTAG_NAME, tmp); + headerPutString(dbg->header, RPMTAG_VERSION, ver); + headerPutString(dbg->header, RPMTAG_RELEASE, rel); + headerPutString(dbg->header, RPMTAG_ARCH, a); snprintf (tmp, 1024, "Debug information for package %s", name); headerPutString(dbg->header, RPMTAG_SUMMARY, tmp); snprintf (tmp, 1024, "This package provides debug information for package %s.\n" @@ -2321,6 +2364,10 @@ static void addDebuginfoPackage(rpmSpec spec, Package pkg, char *buildroot) "package or when debugging this package.", name); headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp); headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug"); + + /* Add 'provides' information to debuginfo package. */ + addPackageProvides_for_debuginfo_pkg(dbg->header); + /* Inherit other tags from parent. */ headerCopyTags (pkg->header, dbg->header, copyTagsForDebug); diff --git a/fileattrs/debuginfo.attr b/fileattrs/debuginfo.attr index 91fd995f0..5f82e84bd 100644 --- a/fileattrs/debuginfo.attr +++ b/fileattrs/debuginfo.attr @@ -1,2 +1,3 @@ -%__debuginfo_provides %{_rpmconfigdir}/debuginfo.prov +# Change how to add "package provide" to debuginfo package : add "package provide" using addPackageProvides_for_debuginfo_pkg +#%__debuginfo_provides %{_rpmconfigdir}/debuginfo.prov %__debuginfo_path ^/usr/lib/debug/ |