SHA256
6
0
forked from pool/rpm

Accepting request 18841 from Base:System

Copy from Base:System/rpm based on submit request 18841 from user mlschroe

OBS-URL: https://build.opensuse.org/request/show/18841
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=84
This commit is contained in:
OBS User autobuild
2009-08-28 13:54:03 +00:00
committed by Git OBS Bridge
parent 77a1925059
commit a76d6c30a2
64 changed files with 3179 additions and 3463 deletions

View File

@@ -1,23 +1,22 @@
Index: rpm-4.4.2.3/build/files.c
Index: build/files.c
===================================================================
--- rpm-4.4.2.3.orig/build/files.c 2009-07-27 17:59:07.000000000 +0200
+++ rpm-4.4.2.3/build/files.c 2009-07-27 18:02:00.000000000 +0200
@@ -28,6 +28,10 @@
#define _RPMTE_INTERNAL
#include "rpmte.h"
--- build/files.c.orig
+++ build/files.c
@@ -17,6 +17,10 @@
#include <rpm/rpmfileutil.h> /* rpmDoDigest() */
#include <rpm/rpmlog.h>
+#if HAVE_GELF_H
+#include <gelf.h>
+#endif
+
#include "buildio.h"
#include "legacy.h" /* XXX domd5, expandFileList, compressFileList */
@@ -2485,6 +2489,128 @@ exit:
#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
#include "rpmio/base64.h"
#include "rpmio/fts.h"
@@ -2220,12 +2224,136 @@ exit:
return rc;
}
+
+/* Query the build-id from the ELF file NAME and store it in the newly
+ allocated *build_id array of size *build_id_size. Returns -1 on
+ error. */
@@ -139,40 +138,31 @@ Index: rpm-4.4.2.3/build/files.c
+ 0
+};
+
/*@-incondefs@*/
int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
/*@globals check_fileList @*/
@@ -2492,12 +2618,16 @@ int processBinaryFiles(Spec spec, int in
+
int processBinaryFiles(rpmSpec spec, int installSpecialDoc, int test)
{
Package pkg;
int res = 0;
+ char *buildrooturl;
int rc = RPMRC_OK;
+ char *buildroot;
check_fileList = newStringBuf();
+ buildrooturl = rpmGenPath(spec->rootURL, spec->buildRootURL, NULL);
+ buildroot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL);
genSourceRpmName(spec);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
const char *n, *v, *r;
int rc;
+ int type, count;
+ char *ap;
if (pkg->fileList == NULL)
continue;
@@ -2508,6 +2638,116 @@ int processBinaryFiles(Spec spec, int in
if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)))
res = rc;
@@ -2238,8 +2366,109 @@ int processBinaryFiles(rpmSpec spec, int
(void) headerNEVRA(pkg->header, &n, NULL, &v, &r, &a);
rpmlog(RPMLOG_NOTICE, _("Processing files: %s-%s-%s.%s\n"), n, v, r, a);
- if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)) != RPMRC_OK ||
- (rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
+ if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test)) != RPMRC_OK)
+ goto exit;
+
+ /* BEGIN DEBUGPKG */
+#if HAVE_GELF_H && HAVE_LIBELF
+ elf_version(EV_CURRENT);
+
+ /* Now we have the file list of pkg in pkg->cpioList. Iterate over
+ them and build a file list containing debug information for them. */
+ if (headerGetEntry (pkg->header, RPMTAG_ARCH, &type, (void **)&ap, &count)
+ && type == RPM_STRING_TYPE && count == 1
+ && strcmp (ap, "noarch") != 0
+ && strcmp (ap, "src") != 0)
+ if (strcmp(a, "noarch") != 0 && strcmp(a, "src") != 0 && strcmp(a, "nosrc") != 0)
+ {
+ Package dbg;
+ rpmfi fi = pkg->cpioList;
@@ -194,10 +184,10 @@ Index: rpm-4.4.2.3/build/files.c
+
+ name = rpmfiFN (fi);
+ /* Skip leading buildroot. */
+ base = name + strlen (buildrooturl);
+ base = name + strlen (buildroot);
+ /* Pre-pend %buildroot/usr/lib/debug and append .debug. */
+ snprintf (tmp, 1024, "%s/usr/lib/debug%s.debug",
+ buildrooturl, base);
+ buildroot, base);
+ /* If that file exists we have debug information for it. */
+ if (access (tmp, F_OK) != 0)
+ continue;
@@ -250,37 +240,33 @@ Index: rpm-4.4.2.3/build/files.c
+ headerNVR (pkg->header, &name, NULL, NULL);
+ /* Set name, summary and group. */
+ snprintf (tmp, 1024, "%s-debuginfo", name);
+ headerAddEntry (dbg->header, RPMTAG_NAME, RPM_STRING_TYPE, tmp, 1);
+ headerPutString(dbg->header, RPMTAG_NAME, tmp);
+ snprintf (tmp, 1024, "Debug information for package %s", name);
+ headerAddEntry (dbg->header, RPMTAG_SUMMARY, RPM_STRING_TYPE,
+ tmp, 1);
+ headerPutString(dbg->header, RPMTAG_SUMMARY, tmp);
+ snprintf (tmp, 1024, "This package provides debug information for package %s.\n"
+ "Debug information is useful when developing applications that use this\n"
+ "package or when debugging this package.", name);
+ headerAddEntry (dbg->header, RPMTAG_DESCRIPTION, RPM_STRING_TYPE,
+ tmp, 1);
+ headerAddEntry (dbg->header, RPMTAG_GROUP, RPM_STRING_TYPE,
+ "Development/Debug", 1);
+ headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp);
+ headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug");
+ /* Inherit other tags from parent. */
+ headerCopyTags (pkg->header, dbg->header,
+ (int_32 *)copyTagsForDebug);
+ headerCopyTags (pkg->header, dbg->header, copyTagsForDebug);
+
+ /* Build up the files list. */
+ dbg->fileList = files;
+ }
+ }
+
+ /* END DEBUGPKG */
+#endif
+ /* END DEBUGPKG */
+
if ((rc = rpmfcGenerateDepends(spec, pkg)))
res = rc;
}
Index: rpm-4.4.2.3/macros.in
+ if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
goto exit;
if (strcmp(a, "noarch") == 0 && headerGetColor(pkg->header) != 0) {
Index: macros.in
===================================================================
--- rpm-4.4.2.3.orig/macros.in 2009-07-27 17:59:07.000000000 +0200
+++ rpm-4.4.2.3/macros.in 2009-07-27 17:59:07.000000000 +0200
@@ -173,24 +173,10 @@
--- macros.in.orig
+++ macros.in
@@ -176,24 +176,10 @@
# Template for debug information sub-package.
%debug_package \
%global __debug_package 1\
@@ -305,10 +291,10 @@ Index: rpm-4.4.2.3/macros.in
%description debugsource\
This package provides debug sources for package %{name}.\
Debug sources are useful when developing applications that use this\
Index: rpm-4.4.2.3/scripts/find-debuginfo.sh
Index: scripts/find-debuginfo.sh
===================================================================
--- rpm-4.4.2.3.orig/scripts/find-debuginfo.sh 2009-07-27 17:59:06.000000000 +0200
+++ rpm-4.4.2.3/scripts/find-debuginfo.sh 2009-07-27 17:59:10.000000000 +0200
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -274,19 +274,11 @@ while read nlinks inum f; do
fi
done || exit