Accepting request 561871 from Base:System

->

OBS-URL: https://build.opensuse.org/request/show/561871
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=254
This commit is contained in:
Dominique Leuenberger 2018-01-13 20:33:10 +00:00 committed by Git OBS Bridge
commit 8145329d29
59 changed files with 879 additions and 2278 deletions

View File

@ -1,62 +0,0 @@
From 42906a9c5da4c89128ed8ffb619f8ef1fa2d9b93 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Fri, 27 Jan 2017 13:01:57 +0100
Subject: [PATCH 1/4] set SOURCE_DATE_EPOCH from changelog
if requested by macro
to allow for more reproducible builds of packages.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
(cherry picked from commit 0e87aed1785d0531c40b23889f8338744f6abb3a)
---
build/build.c | 15 +++++++++++++++
macros.in | 4 ++++
2 files changed, 19 insertions(+)
diff --git a/build/build.c b/build/build.c
index 04b039c..89b04ce 100644
--- build/build.c
+++ build/build.c
@@ -209,6 +209,21 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
int test = (what & RPMBUILD_NOBUILD);
char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL;
+ if (rpmExpandNumeric("%{?source_date_epoch_from_changelog}") &&
+ getenv("SOURCE_DATE_EPOCH") == NULL) {
+ /* Use date of first (== latest) changelog entry */
+ Header h = spec->packages->header;
+ struct rpmtd_s td;
+ if (headerGet(h, RPMTAG_CHANGELOGTIME, &td, (HEADERGET_MINMEM|HEADERGET_RAW))) {
+ char sdestr[22];
+ snprintf(sdestr, sizeof(sdestr), "%lli",
+ (long long) rpmtdGetNumber(&td));
+ rpmlog(RPMLOG_NOTICE, _("setting %s=%s\n"), "SOURCE_DATE_EPOCH", sdestr);
+ setenv("SOURCE_DATE_EPOCH", sdestr, 0);
+ rpmtdFreeData(&td);
+ }
+ }
+
/* XXX TODO: rootDir is only relevant during build, eliminate from spec */
spec->rootDir = buildArgs->rootdir;
if (!spec->recursing && spec->BACount) {
diff --git a/macros.in b/macros.in
index fd57f2e..85f172a 100644
--- macros.in
+++ macros.in
@@ -210,6 +210,10 @@ package or when debugging this package.\
# Any older entry is not packaged in binary packages.
%_changelog_trimtime 0
+# If true, set the SOURCE_DATE_EPOCH environment variable
+# to the timestamp of the topmost changelog entry
+%source_date_epoch_from_changelog 0
+
# The directory where newly built binary packages will be written.
%_rpmdir %{_topdir}/RPMS
--
2.10.2

View File

@ -1,191 +0,0 @@
From b74958824c7e0d7c12550ba22d9b31da040d2cd4 Mon Sep 17 00:00:00 2001
From: Pavlina <pavlina@dhcp-27-209.brq.redhat.com>
Date: Thu, 6 Oct 2016 08:59:47 +0200
Subject: [PATCH 2/4] Extend %changelog to support full timestamps (#903)
The newly accepted date format is
Mon Jan 6 09:02:22 CEST 2016
(like output of "date" command). Original format "Mon Jun 6 2016" is still supported.
(cherry picked from commit 57f94a582602f0353cdb17a02dc12c4461d4f32d)
---
build/parseChangelog.c | 106 +++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 89 insertions(+), 17 deletions(-)
diff --git a/build/parseChangelog.c b/build/parseChangelog.c
index ff301b9..82fd096 100644
--- build/parseChangelog.c
+++ build/parseChangelog.c
@@ -32,17 +32,20 @@ static int sameDate(const struct tm *ot, const struct tm *nt)
/**
* Parse date string to seconds.
+ * accepted date formats are "Mon Jun 6 2016" (original one)
+ * and "Thu Oct 6 06:48:39 CEST 2016" (extended one)
* @param datestr date string (e.g. 'Wed Jan 1 1997')
* @retval secs secs since the unix epoch
* @return 0 on success, -1 on error
*/
-static int dateToTimet(const char * datestr, time_t * secs)
+static int dateToTimet(const char * datestr, time_t * secs, int * date_words)
{
int rc = -1; /* assume failure */
struct tm time, ntime;
const char * const * idx;
char *p, *pe, *q, *date, *tz;
-
+ char tz_name[10]; /* name of timezone (if extended format is used) */
+
static const char * const days[] =
{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", NULL };
static const char * const months[] =
@@ -80,26 +83,93 @@ static int dateToTimet(const char * datestr, time_t * secs)
if (*p == '\0') goto exit;
pe = p; SKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0';
- /* make this noon so the day is always right (as we make this UTC) */
- time.tm_hour = 12;
-
time.tm_mday = strtol(p, &q, 10);
if (!(q && *q == '\0')) goto exit;
if (time.tm_mday < 0 || time.tm_mday > lengths[time.tm_mon]) goto exit;
- /* year */
- p = pe; SKIPSPACE(p);
- if (*p == '\0') goto exit;
- pe = p; SKIPNONSPACE(pe); if (*pe != '\0') *pe = '\0';
+ /* first part of year entry (original format) / time entry (extended format)*/
+ p = pe;
+ SKIPSPACE(p);
+ if (*p == '\0')
+ goto exit;
+
+ /* in the original format here is year record (e.g. 1999),
+ * in the extended one here is time stamp (e.g. 10:22:30).
+ * Choose the format
+ */
+ if ((p[1]==':') || ((p[1]!='\0') && ((p[2]==':')))) {
+ /* it can be extended format */
+ *date_words = 6;
+
+ /* second part of time entry */
+ /* hours */
+ time.tm_hour = strtol(p, &q, 10);
+ if ( (time.tm_hour < 0) || (time.tm_hour > 23) )
+ goto exit;
+ if (*q!=':')
+ goto exit;
+ p = ++q;
+ /* minutes */
+ time.tm_min = strtol(p, &q, 10);
+ if ( (time.tm_min < 0) || (time.tm_min > 59) )
+ goto exit;
+ if (*q != ':')
+ goto exit;
+ p = ++q;
+ /* time - seconds */
+ time.tm_sec = strtol(p, &q, 10);
+ if ( (time.tm_sec < 0) || (time.tm_sec > 59) )
+ goto exit;
+ p = q;
+
+ /* time zone name */
+ SKIPSPACE(p);
+ if (*p == '\0')
+ goto exit;
+ pe = p;
+ SKIPNONSPACE(pe);
+ if (*pe != '\0')
+ *pe++ = '\0';
+ if (((int)(pe-p) + 1) > 9 )
+ goto exit;
+ strncpy(tz_name, p, (int)(pe-p));
+ tz_name[(int)(pe-p)] = '\0';
+
+ /* first part of year entry */
+ p = pe;
+ SKIPSPACE(p);
+ if (*p == '\0')
+ goto exit;
+ } else {
+ *date_words = 4;
+ /* the original format */
+ /* make this noon so the day is always right (as we make this UTC) */
+ time.tm_hour = 12;
+ }
+
+ /* year - second part */
+ pe = p;
+ SKIPNONSPACE(pe);
+ if (*pe != '\0')
+ *pe = '\0';
time.tm_year = strtol(p, &q, 10);
if (!(q && *q == '\0')) goto exit;
if (time.tm_year < 1990 || time.tm_year >= 3000) goto exit;
time.tm_year -= 1900;
- /* chnagelog date is always in UTC */
+ /* change time zone and compute calendar time representation */
tz = getenv("TZ");
- if (tz) tz = xstrdup(tz);
- setenv("TZ", "UTC", 1);
+ if (tz)
+ tz = xstrdup(tz);
+ if (*date_words == 6) {
+ /* changelog date is in read time zone */
+ tz = getenv("TZ");
+ if (tz) tz = xstrdup(tz);
+ setenv("TZ", tz_name, 1);
+ } else {
+ /* changelog date is always in UTC */
+ setenv("TZ", "UTC", 1);
+ }
ntime = time; /* struct assignment */
*secs = mktime(&ntime);
unsetenv("TZ");
@@ -107,6 +177,7 @@ static int dateToTimet(const char * datestr, time_t * secs)
setenv("TZ", tz, 1);
free(tz);
}
+
if (*secs == -1) goto exit;
/* XXX Turn this into a hard error in a release or two */
@@ -135,6 +206,7 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb)
time_t lastTime = 0;
time_t trimtime = rpmExpandNumeric("%{?_changelog_trimtime}");
char *date, *name, *text, *next;
+ int date_words; /* number of words in date string */
s = sp = argvJoin(sb, "");
@@ -160,12 +232,8 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb)
/* 4 fields of date */
date++;
s = date;
- for (i = 0; i < 4; i++) {
- SKIPSPACE(s);
- SKIPNONSPACE(s);
- }
SKIPSPACE(date);
- if (dateToTimet(date, &time)) {
+ if (dateToTimet(date, &time, &date_words)) {
rpmlog(RPMLOG_ERR, _("bad date in %%changelog: %s\n"), date);
goto exit;
}
@@ -174,6 +242,10 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb)
_("%%changelog not in descending chronological order\n"));
goto exit;
}
+ for (i = 0; i < date_words; i++) {
+ SKIPSPACE(s);
+ SKIPNONSPACE(s);
+ }
lastTime = time;
/* skip space to the name */
--
2.10.2

View File

@ -1,82 +0,0 @@
From f2aa612c5a2a99e1186853a3d00d43607bdc6aa2 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Sun, 13 Mar 2016 10:20:47 +0100
Subject: [PATCH 3/4] Allow SOURCE_DATE_EPOCH to override file timestamps
Limit the maximum date to SOURCE_DATE_EPOCH or use origtime if not defined
similar to the tar --clamp-mtime option
based on a patch by Nicolas Vigier <boklm at torproject.org>
(cherry picked from commit 8d84878ee05b2e63858af3a5a49d98e9e2933b1b)
---
build/files.c | 22 ++++++++++++++++++++++
macros.in | 5 +++++
2 files changed, 27 insertions(+)
diff --git build/files.c build/files.c
index b76ce04..48b03e9 100644
--- build/files.c
+++ build/files.c
@@ -9,6 +9,7 @@
#define MYALLPERMS 07777
#include <errno.h>
+#include <stdlib.h>
#include <regex.h>
#if WITH_CAP
#include <sys/capability.h>
@@ -939,6 +940,24 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc)
uint32_t defaultalgo = PGPHASHALGO_MD5, digestalgo;
rpm_loff_t totalFileSize = 0;
Header h = pkg->header; /* just a shortcut */
+ int override_date = 0;
+ time_t source_date_epoch;
+ char *srcdate = getenv("SOURCE_DATE_EPOCH");
+
+ /* Limit the maximum date to SOURCE_DATE_EPOCH if defined
+ * similar to the tar --clamp-mtime option
+ * https://reproducible-builds.org/specs/source-date-epoch/
+ */
+ if (srcdate && rpmExpandNumeric("%{?clamp_mtime_to_source_date_epoch}")) {
+ char *endptr;
+ errno = 0;
+ source_date_epoch = strtol(srcdate, &endptr, 10);
+ if (srcdate == endptr || *endptr || errno != 0) {
+ rpmlog(RPMLOG_ERR, _("unable to parse %s=%s\n"), "SOURCE_DATE_EPOCH", srcdate);
+ exit(28);
+ }
+ override_date = 1;
+ }
/*
* See if non-md5 file digest algorithm is requested. If not
@@ -1070,6 +1089,9 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc)
}
}
+ if (override_date && flp->fl_mtime > source_date_epoch) {
+ flp->fl_mtime = source_date_epoch;
+ }
/*
* For items whose size varies between systems, always explicitly
* cast to the header type before inserting.
diff --git macros.in macros.in
index 85f172a..e0d7b7f 100644
--- macros.in
+++ macros.in
@@ -214,6 +214,11 @@ package or when debugging this package.\
# to the timestamp of the topmost changelog entry
%source_date_epoch_from_changelog 0
+# If true, make sure that timestamps in built rpms
+# are not later than the value of SOURCE_DATE_EPOCH.
+# Is ignored when SOURCE_DATE_EPOCH is not set.
+%clamp_mtime_to_source_date_epoch 0
+
# The directory where newly built binary packages will be written.
%_rpmdir %{_topdir}/RPMS
--
2.10.2

View File

@ -1,50 +0,0 @@
From 686ff4634d69999740c93eea761b09c3fb17c2f6 Mon Sep 17 00:00:00 2001
From: Nicolas Vigier <boklm@torproject.org>
Date: Thu, 3 Dec 2015 12:57:22 +0100
Subject: [PATCH 4/4] Allow SOURCE_DATE_EPOCH to override RPMTAG_BUILDTIME
SOURCE_DATE_EPOCH environment variable is a distribution-agnostic
standard for build systems to exchange a timestamp.
SOURCE_DATE_EPOCH specification is available at:
https://reproducible-builds.org/specs/source-date-epoch
Signed-off-by: Dhiru Kholia <dhiru@openwall.com>
(cherry picked from commit b8a54d6a1e9bb6140b6b47e23dc707e4b967537e)
---
build/pack.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git build/pack.c build/pack.c
index 094419e..8305b42 100644
--- build/pack.c
+++ build/pack.c
@@ -154,9 +154,23 @@ exit:
static rpm_time_t * getBuildTime(void)
{
static rpm_time_t buildTime[1];
+ char *srcdate;
+ time_t epoch;
+ char *endptr;
+
+ if (buildTime[0] == 0) {
+ srcdate = getenv("SOURCE_DATE_EPOCH");
+ if (srcdate) {
+ errno = 0;
+ epoch = strtol(srcdate, &endptr, 10);
+ if (srcdate == endptr || *endptr || errno != 0)
+ rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n"));
+ else
+ buildTime[0] = (int32_t) epoch;
+ } else
+ buildTime[0] = (int32_t) time(NULL);
+ }
- if (buildTime[0] == 0)
- buildTime[0] = (int32_t) time(NULL);
return buildTime;
}
--
2.10.2

66
bigarchive.diff Normal file
View File

@ -0,0 +1,66 @@
--- lib/signature.c.orig 2018-01-05 10:59:06.358348915 +0000
+++ lib/signature.c 2018-01-05 12:25:13.224472739 +0000
@@ -118,6 +118,8 @@ rpmRC rpmGenerateSignature(char *SHA256,
char *reservedSpace;
int spaceSize = 32; /* always reserve a bit of space */
int gpgSize = rpmExpandNumeric("%{__gpg_reserved_space}");
+ rpm_off_t size32 = size;
+ rpm_off_t payloadSize32 = payloadSize;
/* Prepare signature */
if (SHA256) {
@@ -149,21 +151,32 @@ rpmRC rpmGenerateSignature(char *SHA256,
rpmtdReset(&td);
td.count = 1;
- if (payloadSize < UINT32_MAX) {
- rpm_off_t p = payloadSize;
- rpm_off_t s = size;
- td.type = RPM_INT32_TYPE;
+ td.type = RPM_INT32_TYPE;
- td.tag = RPMSIGTAG_PAYLOADSIZE;
- td.data = &p;
- headerPut(sig, &td, HEADERPUT_DEFAULT);
+ td.tag = RPMSIGTAG_PAYLOADSIZE;
+ td.data = &payloadSize32;
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
- td.tag = RPMSIGTAG_SIZE;
- td.data = &s;
- headerPut(sig, &td, HEADERPUT_DEFAULT);
- } else {
+ td.tag = RPMSIGTAG_SIZE;
+ td.data = &size32;
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
+
+ if (payloadSize >= UINT32_MAX) {
+ /*
+ * Put the 64bit size variants into the header, but
+ * modify spaceSize so that the resulting header has
+ * the same size. Note that this only works if
+ * RPMSIGTAG_RESERVEDSPACE is the last tag in the header!
+ */
rpm_loff_t p = payloadSize;
rpm_loff_t s = size;
+ int newsigSize, oldsigSize;
+
+ oldsigSize = headerSizeof(sig, HEADER_MAGIC_YES);
+
+ headerDel(sig, RPMSIGTAG_PAYLOADSIZE);
+ headerDel(sig, RPMSIGTAG_SIZE);
+
td.type = RPM_INT64_TYPE;
td.tag = RPMSIGTAG_LONGARCHIVESIZE;
@@ -174,8 +187,8 @@ rpmRC rpmGenerateSignature(char *SHA256,
td.data = &s;
headerPut(sig, &td, HEADERPUT_DEFAULT);
- /* adjust for the size difference between 64- and 32bit tags */
- spaceSize -= 8;
+ newsigSize = headerSizeof(sig, HEADER_MAGIC_YES);
+ spaceSize -= newsigSize - oldsigSize;
}
if (gpgSize > 0)

View File

@ -1,15 +1,15 @@
--- ./scripts/Makefile.am.orig 2016-10-13 07:12:21.467778490 +0000
+++ ./scripts/Makefile.am 2017-01-19 12:09:27.378564186 +0000
@@ -26,6 +26,7 @@ rpmconfig_SCRIPTS = \
appdata.prov \
--- ./scripts/Makefile.am.orig 2017-10-05 10:04:57.571602038 +0000
+++ ./scripts/Makefile.am 2017-12-01 14:29:56.760975726 +0000
@@ -27,6 +27,7 @@ EXTRA_DIST = \
rpmconfig_SCRIPTS = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
brp-strip brp-strip-comment-note brp-python-hardlink \
+ brp-suse \
brp-strip-shared brp-strip-static-archive \
check-files check-prereqs \
check-buildroot check-rpaths check-rpaths-worker \
--- ./scripts/brp-strip-comment-note.orig 2017-01-19 12:09:27.378564186 +0000
+++ ./scripts/brp-strip-comment-note 2017-01-19 12:13:02.079982258 +0000
--- ./scripts/brp-strip-comment-note.orig 2017-08-10 08:08:07.150108692 +0000
+++ ./scripts/brp-strip-comment-note 2017-12-01 14:29:56.761975721 +0000
@@ -16,6 +16,8 @@ esac
# for already stripped elf files in the build root
for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
@ -19,8 +19,8 @@
sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped.*/\1/p'`; do
note="-R .note"
if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
--- ./scripts/brp-strip.orig 2017-01-19 12:09:27.379564183 +0000
+++ ./scripts/brp-strip 2017-01-19 12:10:34.113383581 +0000
--- ./scripts/brp-strip.orig 2017-08-10 08:08:07.150108692 +0000
+++ ./scripts/brp-strip 2017-12-01 14:29:56.761975721 +0000
@@ -15,6 +15,7 @@ esac
for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
@ -29,8 +29,8 @@
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped.*/\1/p'`; do
$STRIP -g "$f" || :
done
--- ./scripts/brp-suse.orig 2017-01-19 12:09:27.379564183 +0000
+++ ./scripts/brp-suse 2017-01-19 12:09:27.379564183 +0000
--- ./scripts/brp-suse.orig 2017-12-01 14:29:56.762975717 +0000
+++ ./scripts/brp-suse 2017-12-01 14:29:56.761975721 +0000
@@ -0,0 +1,13 @@
+#! /bin/sh
+

View File

@ -8,7 +8,7 @@
+CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure \
--enable-shared --enable-static \
- --with-uniquename=_rpmdb --srcdir=$db_dist
+ --with-uniquename=_rpmdb --srcdir=$db_dist $ARGS
+ --with-uniquename=_rpmdb --srcdir=$db_dist --with-pic $ARGS
mv Makefile Makefile.orig
cat Makefile.orig | sed -e '/^install[:-]/c\

View File

@ -1,38 +0,0 @@
From: Jan Blunck <jblunck@suse.de>
Subject: Let debuginfo packages provide the build-id
This patch lets debuginfo packages provide build-id like follows:
debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517
Users can therefore ask zypper to install the correct debuginfo package with:
zypper install -C "debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517"
--- ./macros.in.orig 2011-05-11 15:59:08.000000000 +0000
+++ ./macros.in 2011-05-11 15:59:31.000000000 +0000
@@ -182,7 +182,8 @@
%package debuginfo\
Summary: Debug information for package %{name}\
Group: Development/Debug\
-AutoReqProv: 0\
+AutoReq: 0\
+AutoProv: 1\
#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
%description debuginfo\
This package provides debug information for package %{name}.\
--- ./scripts/debuginfo.prov.orig 2011-05-11 15:59:31.000000000 +0000
+++ ./scripts/debuginfo.prov 2011-05-11 15:59:31.000000000 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+while read instfile ; do
+ case $instfile in
+ */usr/lib/debug/.build-id/*.debug)
+ if [ -f "$instfile" ] ; then
+ BUILDID=$(echo $instfile | sed -ne 's|.*/usr/lib/debug/.build-id/\([0-9a-f]*\)/\([0-9a-f]*\)\.debug|\1\2|p')
+ echo "debuginfo(build-id) = $BUILDID"
+ fi
+ ;;
+ esac
+done

View File

@ -1,21 +0,0 @@
--- ./doc/rpm.8.orig 2017-07-05 14:31:21.186733161 +0000
+++ ./doc/rpm.8 2017-07-05 14:32:12.097733071 +0000
@@ -65,7 +65,7 @@ rpm \- RPM Package Manager
.PP
- [\fB--changelog\fR] [\fB-c,--configfiles\fR] [\fB--conflicts\fR]
+ [\fB--changelog\fR] [\fB--changes\fR] [\fB-c,--configfiles\fR] [\fB--conflicts\fR]
[\fB-d,--docfiles\fR] [\fB--dump\fR] [\fB--enhances\fR] [\fB--filesbypkg\fR]
[\fB-i,--info\fR] [\fB--last\fR] [\fB-l,--list\fR] [\fB--obsoletes\fR]
[\fB--provides\fR] [\fB--qf,--queryformat \fIQUERYFMT\fB\fR]
@@ -615,6 +615,9 @@ Query all packages that enhance \fICAPAB
\fB--changelog\fR
Display change information for the package.
.TP
+\fB--changes\fR
+Display change information for the package with full time stamps.
+.TP
\fB-c, --configfiles\fR
List only configuration files (implies \fB-l\fR).
.TP

View File

@ -1,5 +1,5 @@
--- ./build/parseReqs.c.orig 2017-01-19 13:11:21.618153943 +0000
+++ ./build/parseReqs.c 2017-01-19 13:24:32.661841405 +0000
--- ./build/parseReqs.c.orig 2017-10-05 10:04:56.887602165 +0000
+++ ./build/parseReqs.c 2017-12-01 16:00:06.956343096 +0000
@@ -42,7 +42,7 @@ static rpmRC checkEpoch(const char *s, c
return RPMRC_OK;
}
@ -38,15 +38,15 @@
_free(N);
_free(EVR);
} else if (type == RPMRICH_PARSE_OP) {
@@ -231,6 +237,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
@@ -223,6 +229,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
goto exit;
}
data.spec = spec;
+ data.tagflags = tagflags;
data.sb = newStringBuf();
if (rpmrichParse(&r, &emsg, parseRCPOTRichCB, &data) != RPMRC_OK) {
if (rpmrichParseForTag(&r, &emsg, parseRCPOTRichCB, &data, nametag) != RPMRC_OK) {
freeStringBuf(data.sb);
@@ -282,7 +289,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
@@ -274,7 +281,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
}
/* check that dependency is well-formed */
@ -55,9 +55,9 @@
goto exit;
if (nametag == RPMTAG_FILETRIGGERNAME ||
--- ./macros.in.orig 2017-01-19 13:15:43.113390933 +0000
+++ ./macros.in 2017-01-19 13:15:56.263352524 +0000
@@ -413,7 +413,7 @@ package or when debugging this package.\
--- ./macros.in.orig 2017-12-01 16:00:02.705355493 +0000
+++ ./macros.in 2017-12-01 16:00:06.957343106 +0000
@@ -456,7 +456,7 @@ package or when debugging this package.\
%_invalid_encoding_terminates_build 0
# Should invalid version format in requires, provides, ... terminate a build?

View File

@ -1,369 +0,0 @@
Build convertdb1, too.
--- ./Makefile.am.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:18:21.000000000 +0000
@@ -174,6 +174,10 @@ bin_PROGRAMS += rpmqpack
rpmqpack_SOURCES = rpmqpack.c
rpmqpack_LDADD = lib/librpm.la
+bin_PROGRAMS += convertdb1
+convertdb1_SOURCES = tools/convertdb1.c
+convertdb1_LDADD = lib/librpm.la
+
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
--- tools/convertdb1.c.orig 2011-05-12 13:31:37.000000000 +0000
+++ tools/convertdb1.c 2011-05-12 13:31:28.000000000 +0000
@@ -0,0 +1,351 @@
+#if defined(HAVE_CONFIG_H)
+#include "system.h"
+const char *__progname;
+#else
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+#endif
+
+#include <rpmlib.h>
+#include <rpmts.h>
+#include <rpmdb.h>
+#include <rpmio.h>
+#include <rpmmacro.h>
+
+#define FA_MAGIC 0x02050920
+
+struct faFileHeader{
+ unsigned int magic;
+ unsigned int firstFree;
+};
+
+struct faHeader {
+ unsigned int size;
+ unsigned int freeNext; /* offset of the next free block, 0 if none */
+ unsigned int freePrev;
+ unsigned int isFree;
+
+ /* note that the u16's appear last for alignment/space reasons */
+};
+
+
+static int fadFileSize;
+
+static ssize_t Pread(FD_t fd, void * buf, size_t count, off_t offset) {
+ if (Fseek(fd, offset, SEEK_SET) < 0)
+ return -1;
+ return Fread(buf, sizeof(char), count, fd);
+}
+
+static FD_t fadOpen(const char * path)
+{
+ struct faFileHeader newHdr;
+ FD_t fd;
+ struct stat stb;
+
+ fd = Fopen(path, "r.fdio");
+ if (!fd || Ferror(fd))
+ return NULL;
+
+ if (fstat(Fileno(fd), &stb)) {
+ Fclose(fd);
+ return NULL;
+ }
+ fadFileSize = stb.st_size;
+
+ /* is this file brand new? */
+ if (fadFileSize == 0) {
+ Fclose(fd);
+ return NULL;
+ }
+ if (Pread(fd, &newHdr, sizeof(newHdr), 0) != sizeof(newHdr)) {
+ Fclose(fd);
+ return NULL;
+ }
+ if (newHdr.magic != FA_MAGIC) {
+ Fclose(fd);
+ return NULL;
+ }
+ /*@-refcounttrans@*/ return fd /*@=refcounttrans@*/ ;
+}
+
+static int fadNextOffset(FD_t fd, unsigned int lastOffset)
+{
+ struct faHeader header;
+ int offset;
+
+ offset = (lastOffset)
+ ? (lastOffset - sizeof(header))
+ : sizeof(struct faFileHeader);
+
+ if (offset >= fadFileSize)
+ return 0;
+
+ if (Pread(fd, &header, sizeof(header), offset) != sizeof(header))
+ return 0;
+
+ if (!lastOffset && !header.isFree)
+ return (offset + sizeof(header));
+
+ do {
+ offset += header.size;
+
+ if (Pread(fd, &header, sizeof(header), offset) != sizeof(header))
+ return 0;
+
+ if (!header.isFree) break;
+ } while (offset < fadFileSize && header.isFree);
+
+ if (offset < fadFileSize) {
+ /* Sanity check this to make sure we're not going in loops */
+ offset += sizeof(header);
+
+ if (offset <= lastOffset) return -1;
+
+ return offset;
+ } else
+ return 0;
+}
+
+static int fadFirstOffset(FD_t fd)
+{
+ return fadNextOffset(fd, 0);
+}
+
+/*@-boundsread@*/
+static int dncmp(const void * a, const void * b)
+ /*@*/
+{
+ const char *const * first = a;
+ const char *const * second = b;
+ return strcmp(*first, *second);
+}
+/*@=boundsread@*/
+
+static void compressFilelist(Header h)
+{
+ struct rpmtd_s fileNames;
+ char ** dirNames;
+ const char ** baseNames;
+ uint32_t * dirIndexes;
+ rpm_count_t count;
+ int xx, i;
+ int dirIndex = -1;
+
+ /*
+ * This assumes the file list is already sorted, and begins with a
+ * single '/'. That assumption isn't critical, but it makes things go
+ * a bit faster.
+ */
+
+ if (headerIsEntry(h, RPMTAG_DIRNAMES)) {
+ xx = headerDel(h, RPMTAG_OLDFILENAMES);
+ return; /* Already converted. */
+ }
+
+ if (!headerGet(h, RPMTAG_OLDFILENAMES, &fileNames, HEADERGET_MINMEM))
+ return;
+ count = rpmtdCount(&fileNames);
+ if (count < 1)
+ return;
+
+ dirNames = xmalloc(sizeof(*dirNames) * count); /* worst case */
+ baseNames = xmalloc(sizeof(*dirNames) * count);
+ dirIndexes = xmalloc(sizeof(*dirIndexes) * count);
+
+ /* HACK. Source RPM, so just do things differently */
+ { const char *fn = rpmtdGetString(&fileNames);
+ if (fn && *fn != '/') {
+ dirIndex = 0;
+ dirNames[dirIndex] = xstrdup("");
+ while ((i = rpmtdNext(&fileNames)) >= 0) {
+ dirIndexes[i] = dirIndex;
+ baseNames[i] = rpmtdGetString(&fileNames);
+ }
+ goto exit;
+ }
+ }
+
+ while ((i = rpmtdNext(&fileNames)) >= 0) {
+ char ** needle;
+ char savechar;
+ char * baseName;
+ size_t len;
+ const char *filename = rpmtdGetString(&fileNames);
+
+ if (filename == NULL) /* XXX can't happen */
+ continue;
+ baseName = strrchr(filename, '/') + 1;
+ len = baseName - filename;
+ needle = dirNames;
+ savechar = *baseName;
+ *baseName = '\0';
+ if (dirIndex < 0 ||
+ (needle = bsearch(&filename, dirNames, dirIndex + 1, sizeof(dirNames[0]), dncmp)) == NULL) {
+ char *s = xmalloc(len + 1);
+ rstrlcpy(s, filename, len + 1);
+ dirIndexes[i] = ++dirIndex;
+ dirNames[dirIndex] = s;
+ } else
+ dirIndexes[i] = needle - dirNames;
+
+ *baseName = savechar;
+ baseNames[i] = baseName;
+ }
+
+exit:
+ if (count > 0) {
+ headerPutUint32(h, RPMTAG_DIRINDEXES, dirIndexes, count);
+ headerPutStringArray(h, RPMTAG_BASENAMES, baseNames, count);
+ headerPutStringArray(h, RPMTAG_DIRNAMES,
+ (const char **) dirNames, dirIndex + 1);
+ }
+
+ rpmtdFreeData(&fileNames);
+ for (i = 0; i <= dirIndex; i++) {
+ free(dirNames[i]);
+ }
+ free(dirNames);
+ free(baseNames);
+ free(dirIndexes);
+
+ xx = headerDel(h, RPMTAG_OLDFILENAMES);
+}
+
+/*
+ * Up to rpm 3.0.4, packages implicitly provided their own name-version-release.
+ * Retrofit an explicit "Provides: name = epoch:version-release.
+ */
+static void providePackageNVR(Header h)
+{
+ const char *name;
+ char *pEVR;
+ rpmsenseFlags pFlags = RPMSENSE_EQUAL;
+ int bingo = 1;
+ struct rpmtd_s pnames;
+ rpmds hds, nvrds;
+
+ /* Generate provides for this package name-version-release. */
+ pEVR = headerGetEVR(h, &name);
+ if (!(name && pEVR))
+ return;
+
+ /*
+ * Rpm prior to 3.0.3 does not have versioned provides.
+ * If no provides at all are available, we can just add.
+ */
+ if (!headerGet(h, RPMTAG_PROVIDENAME, &pnames, HEADERGET_MINMEM)) {
+ goto exit;
+ }
+
+ /*
+ * Otherwise, fill in entries on legacy packages.
+ */
+ if (!headerIsEntry(h, RPMTAG_PROVIDEVERSION)) {
+ while (rpmtdNext(&pnames) >= 0) {
+ rpmsenseFlags fdummy = RPMSENSE_ANY;
+
+ headerPutString(h, RPMTAG_PROVIDEVERSION, "");
+ headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &fdummy, 1);
+ }
+ goto exit;
+ }
+
+ /* see if we already have this provide */
+ hds = rpmdsNew(h, RPMTAG_PROVIDENAME, 0);
+ nvrds = rpmdsSingle(RPMTAG_PROVIDENAME, name, pEVR, pFlags);
+ if (rpmdsFind(hds, nvrds) >= 0) {
+ bingo = 0;
+ }
+ rpmdsFree(hds);
+ rpmdsFree(nvrds);
+
+exit:
+ if (bingo) {
+ const char *evr = pEVR;
+ headerPutString(h, RPMTAG_PROVIDENAME, name);
+ headerPutString(h, RPMTAG_PROVIDEVERSION, evr);
+ headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pFlags, 1);
+ }
+ rpmtdFreeData(&pnames);
+ free(pEVR);
+}
+/*@=bounds@*/
+
+static rpmdb db;
+
+int
+main(int argc, char ** argv)
+{
+ FD_t fd;
+ int offset;
+ Header h;
+ const char *name;
+ const char *version;
+ const char *release;
+ rpmts ts;
+
+ if (argc != 2)
+ {
+ fprintf(stderr, "usage: %s <packages.rpm>\n", argv[0]);
+ exit(1);
+ }
+ if ((fd = fadOpen(argv[1])) == 0)
+ {
+ fprintf(stderr, "could not open %s\n", argv[1]);
+ exit(1);
+ }
+ rpmInitMacros(NULL, "/usr/lib/rpm/macros");
+
+ /* speed things up */
+ (void) rpmDefineMacro(NULL, "_rpmdb_rebuild %{nil}", -1);
+
+ ts = rpmtsCreate();
+
+ if (rpmtsOpenDB(ts, O_RDWR)) {
+ fprintf(stderr, "could not open rpm database\n");
+ exit(1);
+ }
+
+ for (offset = fadFirstOffset(fd); offset; offset = fadNextOffset(fd, offset))
+ {
+ rpmdbMatchIterator mi;
+
+ /* have to use lseek instead of Fseek because headerRead
+ * uses low level IO
+ */
+ if (lseek(Fileno(fd), (off_t)offset, SEEK_SET) == -1)
+ {
+ perror("lseek");
+ continue;
+ }
+ h = headerRead(fd, HEADER_MAGIC_NO);
+ if (!h)
+ continue;
+ compressFilelist(h);
+ providePackageNVR(h);
+ headerNVR(h, &name, &version, &release);
+ mi = rpmdbInitIterator(db, RPMTAG_NAME, name, 0);
+ rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, version);
+ rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, release);
+ if (rpmdbNextIterator(mi))
+ {
+ printf("%s-%s-%s is already in database\n", name, version, release);
+ rpmdbFreeIterator(mi);
+ headerFree(h);
+ continue;
+ }
+ rpmdbFreeIterator(mi);
+ if (rpmtsHeaderAddDB(ts, h))
+ {
+ fprintf(stderr, "could not add %s-%s-%s!\n", name, version, release);
+ }
+ headerFree(h);
+ }
+ Fclose(fd);
+ rpmtsCloseDB(ts);
+ rpmtsFree(ts);
+ return 0;
+}
+

View File

@ -1,10 +1,7 @@
Always use DB_PRIVATE. Unfortunately no longer configurable
in the macros file.
--- ./lib/backend/db3.c.orig 2013-07-12 12:09:45.000000000 +0000
+++ ./lib/backend/db3.c 2013-07-12 12:11:07.000000000 +0000
@@ -164,7 +164,7 @@ static int db_init(rpmdb rdb, const char
int lockfd = -1;
--- ./lib/backend/db3.c.orig 2017-12-01 15:44:53.609993968 +0000
+++ ./lib/backend/db3.c 2017-12-01 15:45:05.462959735 +0000
@@ -416,7 +416,7 @@ static int db_init(rpmdb rdb, const char
int rdonly = ((rdb->db_mode & O_ACCMODE) == O_RDONLY);
struct dbConfig_s * cfg = &rdb->cfg;
/* This is our setup, thou shall not have other setups before us */
- uint32_t eflags = (DB_CREATE|DB_INIT_MPOOL|DB_INIT_CDB);

View File

@ -1,6 +1,6 @@
--- ./lib/rpmdb.c.orig 2016-10-21 09:44:00.306962087 +0000
+++ ./lib/rpmdb.c 2017-01-19 10:36:12.529219141 +0000
@@ -450,9 +450,11 @@ int rpmdbClose(rpmdb db)
--- ./lib/rpmdb.c.orig 2017-10-05 10:05:27.459594162 +0000
+++ ./lib/rpmdb.c 2017-12-01 14:19:12.361872712 +0000
@@ -387,9 +387,11 @@ int rpmdbClose(rpmdb db)
{
rpmdb * prev, next;
int rc = 0;
@ -12,21 +12,21 @@
prev = &rpmdbRock;
while ((next = *prev) != NULL && next != db)
@@ -487,7 +489,7 @@ int rpmdbClose(rpmdb db)
@@ -424,7 +426,7 @@ int rpmdbClose(rpmdb db)
db = _free(db);
- if (rpmdbRock == NULL) {
+ if (rpmdbRock == NULL && (dbmode & (O_RDWR|O_WRONLY)) != 0) {
(void) rpmsqEnable(-SIGHUP, NULL);
(void) rpmsqEnable(-SIGINT, NULL);
(void) rpmsqEnable(-SIGTERM, NULL);
@@ -572,7 +574,7 @@ static int openDatabase(const char * pre
rpmsqActivate(0);
}
exit:
@@ -505,7 +507,7 @@ static int openDatabase(const char * pre
/* Try to ensure db home exists, error out if we can't even create */
rc = rpmioMkpath(rpmdbHome(db), 0755, getuid(), getgid());
if (rc == 0) {
- if (rpmdbRock == NULL) {
+ if (rpmdbRock == NULL && (db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
(void) rpmsqEnable(SIGHUP, NULL);
(void) rpmsqEnable(SIGINT, NULL);
(void) rpmsqEnable(SIGTERM, NULL);
rpmsqActivate(1);
}

View File

@ -1,128 +0,0 @@
Index: tools/debugedit.c
===================================================================
--- tools/debugedit.c.orig 2017-02-27 13:35:18.727800856 +0100
+++ tools/debugedit.c 2017-02-27 14:22:33.975985617 +0100
@@ -162,7 +162,7 @@ strptr (DSO *dso, int sec, off_t offset)
{
if (data->d_buf
&& offset >= data->d_off
- && offset < data->d_off + data->d_size)
+ && offset < data->d_off + (off_t)data->d_size)
return (const char *) data->d_buf + (offset - data->d_off);
}
}
@@ -505,9 +505,10 @@ static int
edit_dwarf2_line (DSO *dso, uint32_t off, char *comp_dir, int phase)
{
unsigned char *ptr = debug_sections[DEBUG_LINE].data, *dir;
- unsigned char **dirt;
+ char **dirt;
unsigned char *endsec = ptr + debug_sections[DEBUG_LINE].size;
unsigned char *endcu, *endprol;
+ char line_base;
unsigned char opcode_base;
uint32_t value, dirt_cnt;
size_t comp_dir_len = !comp_dir ? 0 : strlen (comp_dir);
@@ -555,6 +556,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
return 1;
}
+ line_base = (char) (ptr[2 + (value >= 4)] & 0xff);
opcode_base = ptr[4 + (value >= 4)];
ptr = dir = ptr + 4 + (value >= 4) + opcode_base;
@@ -566,13 +568,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off
++value;
}
- dirt = (unsigned char **) alloca (value * sizeof (unsigned char *));
+ dirt = (char **) alloca (value * sizeof (unsigned char *));
dirt[0] = (unsigned char *) ".";
dirt_cnt = 1;
ptr = dir;
while (*ptr != 0)
{
- dirt[dirt_cnt++] = ptr;
+ dirt[dirt_cnt++] = (char *)ptr;
ptr = (unsigned char *) strchr ((char *)ptr, 0) + 1;
}
ptr++;
@@ -685,7 +687,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
if (dest_dir)
{
- unsigned char *srcptr, *buf = NULL;
+ char *srcptr, *buf = NULL;
size_t base_len = strlen (base_dir);
size_t dest_len = strlen (dest_dir);
size_t shrank = 0;
@@ -699,11 +701,14 @@ edit_dwarf2_line (DSO *dso, uint32_t off
ptr = dir;
}
else
- ptr = srcptr = dir;
+ {
+ ptr = dir;
+ srcptr = (char *)dir;
+ }
while (*srcptr != 0)
{
size_t len = strlen ((char *)srcptr) + 1;
- const unsigned char *readptr = srcptr;
+ const char *readptr = srcptr;
char *orig = strdup ((const char *) srcptr);
@@ -730,11 +735,18 @@ edit_dwarf2_line (DSO *dso, uint32_t off
if (shrank > 0)
{
- if (--shrank == 0)
- error (EXIT_FAILURE, 0,
- "canonicalization unexpectedly shrank by one character");
+ if (shrank == 1)
+ {
+ /* For size 1 we can't append a dummy entry as a '\0' tells
+ it the directory table ends prematurely and thus the file
+ table will end up empty. Simply append a / to the last
+ directory entry in this case. */
+ *(ptr - 1) = '/';
+ *ptr++ = '\0';
+ }
else
{
+ --shrank;
memset (ptr, 'X', shrank);
ptr += shrank;
*ptr++ = '\0';
@@ -769,21 +781,26 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
dirty_section (DEBUG_STR);
}
- else if (ptr != srcptr)
+ else if ((char *)ptr != srcptr)
memmove (ptr, srcptr, len);
srcptr += len;
ptr += len;
- dir = srcptr;
+ dir = (unsigned char *)srcptr;
read_uleb128 (srcptr);
read_uleb128 (srcptr);
read_uleb128 (srcptr);
if (ptr != dir)
- memmove (ptr, dir, srcptr - dir);
- ptr += srcptr - dir;
+ memmove (ptr, dir, (unsigned char *)srcptr - dir);
+ ptr += (unsigned char *)srcptr - dir;
}
*ptr = '\0';
free (buf);
}
+
+ ptr++;
+ /* fill the rest until the line number program starts with NOP opcode */
+ memset(ptr, opcode_base - line_base, endprol - ptr);
+ /* don't touch the line number program */
return 0;
}

View File

@ -1,51 +0,0 @@
Include compilation directory in source file list if used.
--- ./tools/debugedit.c.orig 2017-03-01 12:51:20.851951816 +0000
+++ ./tools/debugedit.c 2017-03-01 12:54:14.020391379 +0000
@@ -512,6 +512,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
uint32_t value, dirt_cnt;
size_t comp_dir_len = !comp_dir ? 0 : strlen (comp_dir);
size_t abs_file_cnt = 0, abs_dir_cnt = 0;
+ int comp_dir_used = 0;
if (phase != 0)
return 0;
@@ -620,6 +621,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
memcpy (s, comp_dir, comp_dir_len);
s[comp_dir_len] = '/';
p += comp_dir_len + 1;
+ comp_dir_used = 1;
}
memcpy (p, dirt[value], dir_len);
p[dir_len] = '/';
@@ -657,6 +659,30 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
++ptr;
+ if (comp_dir_used && list_file_fd != -1
+ && (base_dir == NULL || has_prefix (comp_dir, base_dir)))
+ {
+ char *p;
+ size_t size;
+ ssize_t ret;
+
+ size = comp_dir_len + 1;
+ p = comp_dir;
+ if (base_dir)
+ {
+ p += strlen (base_dir);
+ size -= strlen (base_dir);
+ }
+ while (size > 0)
+ {
+ ret = write (list_file_fd, p, size);
+ if (ret == -1)
+ break;
+ size -= ret;
+ p += ret;
+ }
+ }
+
if (dest_dir)
{
unsigned char *srcptr, *buf = NULL;

94
debugedit-macro.diff Normal file
View File

@ -0,0 +1,94 @@
--- ./tools/debugedit.c.orig 2017-12-15 12:17:02.564975374 +0000
+++ ./tools/debugedit.c 2017-12-15 12:17:29.058901941 +0000
@@ -71,6 +71,14 @@
#define DW_FORM_ref_udata 0x15
#define DW_FORM_indirect 0x16
+#define DW_MACRO_GNU_define 1
+#define DW_MACRO_GNU_undef 2
+#define DW_MACRO_GNU_start_file 3
+#define DW_MACRO_GNU_end_file 4
+#define DW_MACRO_GNU_define_indirect 5
+#define DW_MACRO_GNU_undef_indirect 6
+#define DW_MACRO_GNU_transparent_include 7
+
/* Unfortunately strtab manipulation functions were only officially added
to elfutils libdw in 0.167. Before that there were internal unsupported
ebl variants. While libebl.h isn't supported we'll try to use it anyway
@@ -2209,6 +2217,67 @@ edit_dwarf2 (DSO *dso)
}
}
+ /* the macro section also contains offsets into the str section,
+ * so we need to update those as well if we update the strings
+ */
+ if (need_strp_update && debug_sections[DEBUG_MACRO].data)
+ {
+ ptr = debug_sections[DEBUG_MACRO].data;
+ endsec = ptr + debug_sections[DEBUG_MACRO].size;
+ int op = 0, macro_version, macro_flags;
+
+ while (ptr < endsec)
+ {
+ if (!op)
+ {
+ macro_version = read_16 (ptr);
+ macro_flags = read_8 (ptr);
+ if (macro_version != 4 || (macro_flags & ~2) != 0)
+ error (1, 0, "unhandled .debug_macro version/flags");
+ if ((macro_flags & 2) != 0)
+ ptr += 4;
+ }
+ op = read_8 (ptr);
+ if (!op)
+ continue;
+ switch(op)
+ {
+ case DW_MACRO_GNU_define:
+ case DW_MACRO_GNU_undef:
+ read_uleb128 (ptr);
+ ptr = (unsigned char *) strchr ((char *) ptr, '\0') + 1;
+ break;
+ case DW_MACRO_GNU_start_file:
+ read_uleb128 (ptr);
+ read_uleb128 (ptr);
+ break;
+ case DW_MACRO_GNU_define_indirect:
+ case DW_MACRO_GNU_undef_indirect:
+ read_uleb128 (ptr);
+ if (phase == 0)
+ {
+ size_t idx = read_32 (ptr);
+ record_existing_string_entry_idx (&dso->strings, idx);
+ }
+ else
+ {
+ struct stridxentry *entry;
+ size_t idx, new_idx;
+ idx = do_read_32 (ptr);
+ entry = string_find_entry (&dso->strings, idx);
+ new_idx = strent_offset (entry->entry);
+ write_32 (ptr, new_idx);
+ }
+ break;
+ case DW_MACRO_GNU_transparent_include:
+ ptr += 4;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
/* Same for the debug_str section. Make sure everything is
in place for phase 1 updating of debug_info
references. */
@@ -2238,6 +2307,8 @@ edit_dwarf2 (DSO *dso)
new strp, strings and/or linep offsets. */
if (need_strp_update || need_string_replacement || need_stmt_update)
dirty_section (DEBUG_INFO);
+ if (need_strp_update)
+ dirty_section (DEBUG_MACRO);
/* Update any debug_info relocations addends we might have touched. */
if (relbuf != NULL && reltype == SHT_RELA)

View File

@ -1,26 +1,26 @@
Make debugedit build without dwarf.h
--- ./Makefile.am.orig 2016-10-21 09:44:00.299962090 +0000
+++ ./Makefile.am 2017-01-19 10:25:42.252270176 +0000
@@ -155,7 +155,6 @@ rpm2archive_LDADD += @WITH_NSS_LIB@ @WIT
--- ./Makefile.am.orig 2017-12-01 14:15:13.963574699 +0000
+++ ./Makefile.am 2017-12-01 14:16:10.634407860 +0000
@@ -154,7 +154,6 @@ rpm2archive_LDADD += @WITH_POPT_LIB@ @WI
if LIBELF
-if LIBDWARF
if LIBDW
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
rpmlibexec_PROGRAMS += debugedit
@@ -172,7 +171,6 @@ rpmlibexec_PROGRAMS += sepdebugcrcfix
sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c
sepdebugcrcfix_LDADD = @WITH_LIBELF_LIB@
endif
-endif
rpmlibexec_PROGRAMS += rpmdeps
rpmdeps_SOURCES = tools/rpmdeps.c
--- ./tools/debugedit.c.orig 2016-10-13 07:12:21.471778488 +0000
+++ ./tools/debugedit.c 2017-01-19 10:25:42.252270176 +0000
@@ -37,7 +37,37 @@
@@ -168,7 +167,6 @@ else
debugedit_LDADD += @WITH_LIBDW_LIB@ -lebl
endif # HAVE_LIBDW_STRTAB
endif # LIBDW
-endif # LIBDWARF
rpmlibexec_PROGRAMS += elfdeps
elfdeps_SOURCES = tools/elfdeps.c
elfdeps_LDADD = rpmio/librpmio.la
--- ./tools/debugedit.c.orig 2017-10-05 10:04:57.714602011 +0000
+++ ./tools/debugedit.c 2017-12-01 14:15:13.965574668 +0000
@@ -39,7 +39,37 @@
#include <popt.h>
#include <gelf.h>
@ -57,5 +57,5 @@ Make debugedit build without dwarf.h
+#define DW_FORM_ref_udata 0x15
+#define DW_FORM_indirect 0x16
#include <rpm/rpmio.h>
#include <rpm/rpmpgp.h>
/* Unfortunately strtab manipulation functions were only officially added
to elfutils libdw in 0.167. Before that there were internal unsupported

View File

@ -1,6 +1,6 @@
--- ./scripts/find-debuginfo.sh.orig 2017-01-19 13:03:40.090496764 +0000
+++ ./scripts/find-debuginfo.sh 2017-01-19 13:03:55.515451969 +0000
@@ -315,6 +315,17 @@ while read nlinks inum f; do
--- ./scripts/find-debuginfo.sh.orig 2017-12-01 15:40:27.006764372 +0000
+++ ./scripts/find-debuginfo.sh 2017-12-01 15:41:17.270619182 +0000
@@ -348,6 +348,16 @@ while read nlinks inum f; do
;;
*) continue ;;
esac
@ -10,11 +10,10 @@
+ case $ftype in
+ *ELF*) ;;
+ *)
+ echo "$f is not an ELF file, skipping"
+ continue
+ ;;
+ echo "$f is not an ELF file, skipping"
+ continue
+ ;;
+ esac
+
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
if [ $nlinks -gt 1 ]; then
var=seen_$inum
if test -n "${!var}"; then

View File

@ -1,12 +1,11 @@
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 15:59:44.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 16:10:22.000000000 +0000
@@ -186,7 +186,8 @@ make_id_link()
--- ./scripts/find-debuginfo.sh.orig 2017-12-01 15:39:07.239994681 +0000
+++ ./scripts/find-debuginfo.sh 2017-12-01 15:39:34.942914702 +0000
@@ -321,7 +321,7 @@ debug_link()
get_debugfn()
{
dn=$(dirname "${1#$RPM_BUILD_ROOT}")
- bn=$(basename "$1" .debug).debug
+# Do not strip existing .debug suffixes
+ bn=$(basename "$1").debug
- bn=$(basename "$1" .debug)${unique_debug_suffix}.debug
+ bn=$(basename "$1")${unique_debug_suffix}.debug
debugdn=${debugdir}${dn}
debugfn=${debugdn}/${bn}
}

View File

@ -1,57 +0,0 @@
Subject: Split sources for debugging into separate -debugsource package
At the moment the -debuginfo package also include the sources where used to
build the binary. The patches moves them into a separate package -debugsource.
--- ./macros.in.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./macros.in 2011-05-11 15:36:05.000000000 +0000
@@ -190,6 +190,18 @@ Debug information is useful when develop
package or when debugging this package.\
%files debuginfo -f debugfiles.list\
%defattr(-,root,root)\
+\
+%package debugsource\
+Summary: Debug sources for package %{name}\
+Group: Development/Debug\
+AutoReqProv: 0\
+Requires: %{name}-debuginfo = %{version}-%{release}\
+%description debugsource\
+This package provides debug sources for package %{name}.\
+Debug sources are useful when developing applications that use this\
+package or when debugging this package.\
+%files debugsource -f debugsources.list\
+%defattr(-,root,root)\
%{nil}
%_defaultdocdir %{_datadir}/doc/packages
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 14:46:18.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 15:36:05.000000000 +0000
@@ -187,8 +187,8 @@ set -o pipefail
strict_error=ERROR
$strict || strict_error=WARNING
-# Strip ELF binaries
-find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z |
+# Strip ELF binaries (and no static libraries)
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | sort -z |
xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
@@ -300,10 +300,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -
(cd "${RPM_BUILD_ROOT}/usr"
test ! -d lib/debug || find lib/debug ! -type d
- test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
) | sed 's,^,/usr/,' >> "$LISTFILE"
fi
+: > "$SOURCEFILE"
+if [ -d "${RPM_BUILD_ROOT}/usr/src" ]; then
+ (cd "${RPM_BUILD_ROOT}/usr"
+ test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
+ ) | sed 's,^,/usr/,' >> "$SOURCEFILE"
+fi
+
# Append to $1 only the lines from stdin not already in the file.
append_uniq()
{

View File

@ -1,439 +1,6 @@
--- ./build/files.c.orig 2017-02-16 09:52:49.292092380 +0000
+++ ./build/files.c 2017-03-22 13:32:42.911865500 +0000
@@ -21,6 +21,10 @@
#include <rpm/rpmlog.h>
#include <rpm/rpmbase64.h>
+#if HAVE_GELF_H
+#include <gelf.h>
+#endif
+
#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
#include "misc/fts.h"
#include "lib/rpmfi_internal.h" /* XXX fi->apath */
@@ -2155,13 +2159,302 @@ exit:
return rc;
}
+#if HAVE_GELF_H && HAVE_LIBELF
+/* 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. */
+
+static int
+getELFBuildId (const char *name,
+ unsigned char **id, size_t *id_size)
+{
+ int fd, i;
+ Elf *elf;
+ GElf_Ehdr ehdr;
+ Elf_Data *build_id = NULL;
+ size_t build_id_offset = 0, build_id_size = 0;
+
+ /* Now query the build-id of the file and add the
+ corresponding links in the .build-id tree.
+ The following code is based on tools/debugedit.c. */
+ fd = open (name, O_RDONLY);
+ if (fd < 0)
+ return -1;
+ elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
+ if (elf == NULL)
+ {
+ fprintf (stderr, "cannot open ELF file: %s",
+ elf_errmsg (-1));
+ close (fd);
+ return -1;
+ }
+ if (elf_kind (elf) != ELF_K_ELF
+ || gelf_getehdr (elf, &ehdr) == NULL
+ || (ehdr.e_type != ET_DYN
+ && ehdr.e_type != ET_EXEC
+ && ehdr.e_type != ET_REL))
+ {
+ elf_end (elf);
+ close (fd);
+ return -1;
+ }
+ for (i = 0; i < ehdr.e_shnum; ++i)
+ {
+ Elf_Scn *s = elf_getscn (elf, i);
+ GElf_Shdr shdr;
+ Elf_Data *data;
+ Elf32_Nhdr nh;
+ Elf_Data dst =
+ {
+ .d_version = EV_CURRENT, .d_type = ELF_T_NHDR,
+ .d_buf = &nh, .d_size = sizeof nh
+ };
+ Elf_Data src = dst;
+
+ gelf_getshdr (s, &shdr);
+ /* LD creates .note.gnu.build-id with SHF_ALLOC but the DWZ
+ common debuginfo only file only has non-allocated sections. */
+ if (shdr.sh_type != SHT_NOTE)
+ continue;
+
+ /* Look for a build-ID note here. */
+ data = elf_rawdata (s, NULL);
+ src.d_buf = data->d_buf;
+ assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr));
+ while ((unsigned char *)data->d_buf + data->d_size - (unsigned char *)src.d_buf > (int) sizeof nh
+ && elf32_xlatetom (&dst, &src, ehdr.e_ident[EI_DATA]))
+ {
+ Elf32_Word len = sizeof nh + nh.n_namesz;
+ len = (len + 3) & ~3;
+
+ if (nh.n_namesz == sizeof "GNU" && nh.n_type == 3
+ && !memcmp ((unsigned char *)src.d_buf + sizeof nh, "GNU", sizeof "GNU"))
+ {
+ build_id = data;
+ build_id_offset = (unsigned char *)src.d_buf + len - (unsigned char *)data->d_buf;
+ build_id_size = nh.n_descsz;
+ break;
+ }
+
+ len += nh.n_descsz;
+ len = (len + 3) & ~3;
+ src.d_buf = (unsigned char *)src.d_buf + len;
+ }
+
+ if (build_id != NULL)
+ break;
+ }
+
+ if (build_id == NULL)
+ return -1;
+
+ *id = malloc (build_id_size);
+ *id_size = build_id_size;
+ memcpy (*id, (unsigned char *)build_id->d_buf + build_id_offset, build_id_size);
+
+ elf_end (elf);
+ close (fd);
+
+ return 0;
+}
+
+
+static rpmTag copyTagsForDebug[] = {
+ RPMTAG_EPOCH,
+ RPMTAG_VERSION,
+ RPMTAG_RELEASE,
+ RPMTAG_LICENSE,
+ RPMTAG_PACKAGER,
+ RPMTAG_DISTRIBUTION,
+ RPMTAG_DISTURL,
+ RPMTAG_VENDOR,
+ RPMTAG_ICON,
+ RPMTAG_URL,
+ RPMTAG_CHANGELOGTIME,
+ RPMTAG_CHANGELOGNAME,
+ RPMTAG_CHANGELOGTEXT,
+ RPMTAG_PREFIXES,
+ RPMTAG_RHNPLATFORM,
+ RPMTAG_OS,
+ RPMTAG_DISTTAG,
+ RPMTAG_CVSID,
+ RPMTAG_ARCH,
+ 0
+};
+
+/* Add a new debuginfo package based on PKG with FILES. */
+
+static Package addDebuginfoPackage(rpmSpec spec, Package pkg, ARGV_t files)
+{
+ const char *name;
+ char tmp[1024];
+ Package dbg = newPackage(NULL, spec->pool, &spec->packages);
+ name = headerGetString(pkg->header, RPMTAG_NAME);
+ /* Set name, summary and group. */
+ snprintf(tmp, 1024, "%s-debuginfo", name);
+ headerPutString(dbg->header, RPMTAG_NAME, tmp);
+ 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"
+ "Debug information is useful when developing applications that use this\n"
+ "package or when debugging this package.", name);
+ headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp);
+ headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug");
+ /* Inherit other tags from parent. */
+ headerCopyTags(spec->packages->header,
+ dbg->header, copyTagsForDebug);
+
+ /* Add self-provides */
+ dbg->ds = rpmdsThis(dbg->header, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL);
+ addPackageProvides(dbg);
+
+ /* Build up the files list. */
+ dbg->fileList = files;
+ return dbg;
+}
+
+/* Process the filelist of PKG and see to eventually create a debuginfo
+ packge for it. */
+
+static Package processDebuginfo(rpmSpec spec, Package pkg, char *buildroot)
+{
+ const char *a;
+
+ elf_version(EV_CURRENT);
+ a = headerGetString(pkg->header, RPMTAG_ARCH);
+ if (strcmp(a, "noarch") != 0)
+ {
+ rpmfi fi = rpmfilesIter(pkg->cpioList, RPMFI_ITER_FWD);
+ char tmp[1024];
+ const char *name;
+ ARGV_t files = NULL;
+ int seen_build_id = 0;
+
+ /* Check if the current package has files with debug info
+ and record them. */
+ fi = rpmfiInit(fi, 0);
+ while (rpmfiNext(fi) >= 0)
+ {
+ int i;
+ unsigned char *build_id = NULL;
+ size_t build_id_size = 0;
+ struct stat sbuf;
+
+ name = rpmfiFN(fi);
+ /* Pre-pend %buildroot/usr/lib/debug and append .debug. */
+ snprintf(tmp, 1024, "%s/usr/lib/debug%s.debug",
+ buildroot, name);
+ /* If that file exists we have debug information for it. */
+ if (access(tmp, F_OK) != 0)
+ continue;
+
+ /* Append the file list preamble. */
+ if (!files)
+ {
+ argvAdd(&files, "%defattr(-,root,root)");
+ argvAdd(&files, "%dir /usr/lib/debug");
+ }
+ /* Add the files main debug-info file. */
+ snprintf(tmp, 1024, "/usr/lib/debug/%s.debug", name);
+ argvAdd(&files, tmp);
+
+ snprintf(tmp, 1024, "%s%s", buildroot, name);
+ /* Do not bother to check build-ids for symbolic links.
+ We'll handle them for the link target. */
+ if (lstat(tmp, &sbuf) == -1 || S_ISLNK(sbuf.st_mode))
+ continue;
+
+ /* Try to gather the build-id from the binary. */
+ if (getELFBuildId(tmp, &build_id, &build_id_size) == -1)
+ continue;
+
+ /* If we see build-id links for the first time add the
+ directory. */
+ if (!seen_build_id)
+ {
+ seen_build_id = 1;
+ argvAdd(&files, "%dir /usr/lib/debug/.build-id");
+ }
+
+ /* From the build-id construct the two links pointing back
+ to the debug information file and the binary. */
+ snprintf(tmp, 1024, "/usr/lib/debug/.build-id/%02x/",
+ build_id[0]);
+ for (i = 1; i < build_id_size; ++i)
+ sprintf(tmp + strlen(tmp), "%02x", build_id[i]);
+ argvAdd(&files, tmp);
+ sprintf(tmp + strlen(tmp), ".debug");
+ argvAdd(&files, tmp);
+
+ free(build_id);
+ }
+
+ /* If there are debuginfo files for this package add a
+ new debuginfo package. */
+ if (files)
+ return addDebuginfoPackage (spec, pkg, files);
+ }
+ return NULL;
+}
+
+
+static char *addDebugDWZ(ARGV_t *filesp, char *buildroot)
+{
+ char tmp[1024];
+ struct stat sbuf;
+ char *dwz_dbg_buildid = NULL;
+ DIR *d;
+ struct dirent *de;
+ int i;
+
+ snprintf(tmp, 1024, "%s%s", buildroot, "/usr/lib/debug/.dwz");
+ if (lstat(tmp, &sbuf) != 0 || !S_ISDIR(sbuf.st_mode))
+ return NULL;
+ d = opendir(tmp);
+ if (!d)
+ return NULL;
+
+ argvAdd(filesp, "/usr/lib/debug/.dwz");
+ while ((de = readdir (d))) {
+ unsigned char *build_id = NULL;
+ size_t build_id_size = 0;
+
+ snprintf(tmp, 1024, "%s/usr/lib/debug/.dwz/%s", buildroot, de->d_name);
+ if (lstat(tmp, &sbuf) == -1 || !S_ISREG(sbuf.st_mode))
+ continue;
+ if (getELFBuildId(tmp, &build_id, &build_id_size) == -1)
+ continue;
+ snprintf(tmp, 1024, "/usr/lib/debug/.build-id/%02x/", build_id[0]);
+ for (i = 1; i < build_id_size; ++i)
+ sprintf(tmp + strlen(tmp), "%02x", build_id[i]);
+ sprintf(tmp + strlen(tmp), ".debug");
+ argvAdd(filesp, tmp);
+ if (!dwz_dbg_buildid) {
+ for (i = 0; i < build_id_size; ++i)
+ sprintf(tmp + 2 * i, "%02x", build_id[i]);
+ dwz_dbg_buildid = xstrdup(tmp);
+ }
+ free(build_id);
+ }
+ closedir(d);
+ return dwz_dbg_buildid;
+}
+
+#endif
+
rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
int installSpecialDoc, int test)
{
Package pkg;
rpmRC rc = RPMRC_OK;
+ char *buildroot;
+ Package first_dbg = NULL, dwz_dbg = NULL;
+ int processing_dbg = 0;
+ int main_pkg_got_dbg = 0;
+ char *dwz_dbg_buildid = NULL;
check_fileList = newStringBuf();
+ buildroot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL);
genSourceRpmName(spec);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
@@ -2179,8 +2472,40 @@ rpmRC processBinaryFiles(rpmSpec spec, r
rpmlog(RPMLOG_NOTICE, _("Processing files: %s\n"), nvr);
free(nvr);
- if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK ||
- (rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
+#if HAVE_GELF_H && HAVE_LIBELF
+ if (pkg == first_dbg) {
+ /* If we have multiple debug packages then we put
+ DWZ generated files into %name-debuginfo which
+ may already exist. Otherwise put the DWZ data
+ into the only debug package. */
+ processing_dbg = 1;
+ if (!first_dbg->next || main_pkg_got_dbg) {
+ dwz_dbg_buildid = addDebugDWZ(&first_dbg->fileList, buildroot);
+ dwz_dbg = pkg;
+ } else {
+ ARGV_t files = NULL;
+ dwz_dbg_buildid = addDebugDWZ(&files, buildroot);
+ dwz_dbg = addDebuginfoPackage(spec, spec->packages, files);
+ }
+ }
+#endif
+ if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK)
+ goto exit;
+#if HAVE_GELF_H && HAVE_LIBELF
+ if (!processing_dbg) {
+ Package dbg = processDebuginfo(spec, pkg, buildroot);
+ if (dbg && !first_dbg) {
+ first_dbg = dbg;
+ if (pkg == spec->packages)
+ main_pkg_got_dbg = 1;
+ }
+ }
+ /* If we have DWZ info and it is not in PKG then add a requires. */
+ if (dwz_dbg_buildid && pkg != dwz_dbg)
+ addReqProv(pkg, RPMTAG_REQUIRENAME,
+ "debuginfo(build-id)", dwz_dbg_buildid, RPMSENSE_EQUAL, 0);
+#endif
+ if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
goto exit;
a = headerGetString(pkg->header, RPMTAG_ARCH);
@@ -2215,6 +2540,7 @@ rpmRC processBinaryFiles(rpmSpec spec, r
}
exit:
check_fileList = freeStringBuf(check_fileList);
+ _free(dwz_dbg_buildid);
return rc;
}
--- ./build/parseSpec.c.orig 2017-03-22 12:10:11.304029953 +0000
+++ ./build/parseSpec.c 2017-03-22 12:10:20.142010341 +0000
@@ -564,7 +564,7 @@ static void initSourceHeader(rpmSpec spe
}
/* Add extra provides to package. */
-static void addPackageProvides(Package pkg)
+void addPackageProvides(Package pkg)
{
const char *arch, *name;
char *evr, *isaprov;
--- ./build/rpmbuild_internal.h.orig 2017-02-16 09:40:09.788649545 +0000
+++ ./build/rpmbuild_internal.h 2017-03-22 12:10:20.143010339 +0000
@@ -442,6 +442,13 @@ int addReqProv(Package pkg, rpmTagVal ta
/** \ingroup rpmbuild
+ * Add self-provides to package.
+ * @param pkg package
+ */
+RPM_GNUC_INTERNAL
+void addPackageProvides(Package pkg);
+
+/** \ingroup rpmbuild
* Add rpmlib feature dependency.
* @param pkg package
* @param feature rpm feature name (i.e. "rpmlib(Foo)" for feature Foo)
--- ./macros.in.orig 2017-03-22 12:10:11.307029946 +0000
+++ ./macros.in 2017-03-22 12:10:20.143010339 +0000
@@ -186,24 +186,10 @@
# Template for debug information sub-package.
%debug_package \
%global __debug_package 1\
-%package debuginfo\
-Summary: Debug information for package %{name}\
-Group: Development/Debug\
-AutoReq: 0\
-AutoProv: 1\
-#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
-%description debuginfo\
-This package provides debug information for package %{name}.\
-Debug information is useful when developing applications that use this\
-package or when debugging this package.\
-%files debuginfo -f debugfiles.list\
-%defattr(-,root,root)\
-\
%package debugsource\
Summary: Debug sources for package %{name}\
Group: Development/Debug\
AutoReqProv: 0\
-Requires: %{name}-debuginfo = %{version}-%{release}\
%description debugsource\
This package provides debug sources for package %{name}.\
Debug sources are useful when developing applications that use this\
--- ./scripts/find-debuginfo.sh.orig 2017-03-22 12:10:11.303029955 +0000
+++ ./scripts/find-debuginfo.sh 2017-03-22 12:10:20.144010337 +0000
@@ -220,6 +220,11 @@ debug_link()
# Provide .2, .3, ... symlinks to all filename instances of this build-id.
make_id_dup_link()
{
+ # See https://bugzilla.redhat.com/show_bug.cgi?id=641377 for the reasoning,
+ # but it has seveal drawbacks as we would need to split the .1 suffixes into
+ # different subpackages and it's about impossible to predict the number
+ # -> perhaps later
+ return
local id="$1" file="$2" idfile
local n=1
@@ -424,19 +429,11 @@ if $run_dwz && type dwz >/dev/null 2>&1
--- ./scripts/find-debuginfo.sh.orig 2017-12-01 15:35:59.023537837 +0000
+++ ./scripts/find-debuginfo.sh 2017-12-01 15:36:30.351447397 +0000
@@ -548,19 +548,25 @@ if $run_dwz \
fi
fi
@ -455,6 +22,20 @@
+# the debuglink section contains only the destination of those links.
+# Creating those links anyway results in debuginfo packages for
+# devel packages just because of the .so symlinks in them.
+
+## For each symlink whose target has a .debug file,
+## make a .debug symlink to that file.
+#find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print |
+#while read f
+#do
+# t=$(readlink -m "$f").debug
+# f=${f#$RPM_BUILD_ROOT}
+# t=${t#$RPM_BUILD_ROOT}
+# if [ -f "$debugdir$t" ]; then
+# echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
+# debug_link "/usr/lib/debug$t" "${f}.debug"
+# fi
+#done
if [ -s "$SOURCEFILE" ]; then
mkdir -p "${RPM_BUILD_ROOT}/usr/src/debug"
# See also debugedit invocation. Directories must match up.

20
editdwarf.diff Normal file
View File

@ -0,0 +1,20 @@
debugedit: edit_dwarf2 check lndx is in range before checking r_offset.
upstream commit 7e9af0c000868ad6272a9577f9daed991599419b
--- ./tools/debugedit.c.orig 2017-12-05 11:59:10.287010024 +0000
+++ ./tools/debugedit.c 2017-12-05 12:00:02.776862694 +0000
@@ -2171,10 +2171,10 @@ edit_dwarf2 (DSO *dso)
r_offset = rel.r_offset;
}
- while (r_offset > (dso->lines.table[lndx].old_idx
- + 4
- + dso->lines.table[lndx].unit_length)
- && lndx < dso->lines.used)
+ while (lndx < dso->lines.used
+ && r_offset > (dso->lines.table[lndx].old_idx
+ + 4
+ + dso->lines.table[lndx].unit_length))
lndx++;
if (lndx >= dso->lines.used)

View File

@ -1,6 +1,6 @@
--- ./lib/transaction.c.orig 2017-01-19 13:46:06.163983390 +0000
+++ ./lib/transaction.c 2017-01-19 13:47:03.649807918 +0000
@@ -1435,7 +1435,9 @@ rpmRC runScript(rpmts ts, rpmte te, ARGV
--- ./lib/transaction.c.orig 2017-12-01 16:02:14.150972487 +0000
+++ ./lib/transaction.c 2017-12-01 16:02:56.139850122 +0000
@@ -1460,7 +1460,9 @@ rpmRC runScript(rpmts ts, rpmte te, Head
int warn_only = (stag != RPMTAG_PREIN &&
stag != RPMTAG_PREUN &&
stag != RPMTAG_PRETRANS &&
@ -10,11 +10,11 @@
+ rpmExpandNumeric("%{_fail_on_postinstall_errors}")));
rpmdb rdb = rpmtsGetRdb(ts);
sfd = rpmtsNotify(ts, te, RPMCALLBACK_SCRIPT_START, stag, 0);
--- ./macros.in.orig 2017-01-19 13:44:57.362193434 +0000
+++ ./macros.in 2017-01-19 13:45:13.038145574 +0000
@@ -1374,6 +1374,11 @@ end}
%{-S:%{expand:%__scm_setup_%{-S*} %{!-v:-q}}}\
/* Fake up a transaction element for triggers from rpmdb */
--- ./macros.in.orig 2017-12-01 16:02:14.170972428 +0000
+++ ./macros.in 2017-12-01 16:02:56.140850119 +0000
@@ -1468,6 +1468,11 @@ end}
%{expand:%__scm_setup_%{__scm} %{!-v:-q}}\
%{!-N:%autopatch %{-v} %{-p:-p%{-p*}}}
+# Should errors in %post scriptlet be propagated as errors?

View File

@ -1,75 +1,56 @@
---
fileattrs/Makefile.am | 3 ++-
fileattrs/debuginfo.attr | 2 ++
fileattrs/elf.attr | 3 ++-
fileattrs/elflib.attr | 4 ++++
fileattrs/firmware.attr | 2 ++
fileattrs/kernel.attr | 2 ++
fileattrs/kmp.attr | 4 ++++
fileattrs/perl.attr | 3 ++-
fileattrs/perllib.attr | 3 ++-
fileattrs/sysvinit.attr | 2 ++
10 files changed, 24 insertions(+), 4 deletions(-)
--- fileattrs/Makefile.am.orig
+++ fileattrs/Makefile.am
@@ -7,6 +7,7 @@ fattrsdir = $(rpmconfigdir)/fileattrs
--- ./fileattrs/Makefile.am.orig 2017-12-01 15:46:21.021741182 +0000
+++ ./fileattrs/Makefile.am 2017-12-01 15:48:54.108298271 +0000
@@ -8,6 +8,6 @@ fattrsdir = $(rpmconfigdir)/fileattrs
fattrs_DATA = \
appdata.attr desktop.attr elf.attr font.attr libtool.attr perl.attr \
perllib.attr pkgconfig.attr python.attr ocaml.attr script.attr \
debuginfo.attr desktop.attr elf.attr font.attr libtool.attr metainfo.attr \
perl.attr perllib.attr pkgconfig.attr python.attr ocaml.attr script.attr \
- mono.attr
+ mono.attr debuginfo.attr elflib.attr firmware.attr kernel.attr \
+ kmp.attr sysvinit.attr
+ mono.attr elflib.attr firmware.attr kernel.attr kmp.attr sysvinit.attr
EXTRA_DIST = $(fattrs_DATA)
--- /dev/null
+++ fileattrs/debuginfo.attr
@@ -0,0 +1,2 @@
+%__debuginfo_provides %{_rpmconfigdir}/debuginfo.prov
+%__debuginfo_path ^/usr/lib/debug/
--- fileattrs/elf.attr.orig
+++ fileattrs/elf.attr
--- ./fileattrs/elf.attr.orig 2017-12-01 15:46:28.171720501 +0000
+++ ./fileattrs/elf.attr 2017-12-01 15:47:49.339485678 +0000
@@ -1,4 +1,5 @@
%__elf_provides %{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
%__elf_requires %{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
-%__elf_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*$
+%__elf_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*executable
-%__elf_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*$
+%__elf_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*executable
%__elf_flags exeonly
+%__elf_exclude_path ^/usr/lib/debug/
--- /dev/null
+++ fileattrs/elflib.attr
--- ./fileattrs/elflib.attr.orig 2017-12-01 15:46:28.171720501 +0000
+++ ./fileattrs/elflib.attr 2017-12-01 15:46:28.171720501 +0000
@@ -0,0 +1,4 @@
+%__elflib_provides %{_rpmconfigdir}/elfdeps --assume-exec --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
+%__elflib_requires %{_rpmconfigdir}/elfdeps --assume-exec --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
+%__elflib_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*shared object
+%__elflib_exclude_path ^/usr/lib/debug/
--- /dev/null
+++ fileattrs/firmware.attr
--- ./fileattrs/firmware.attr.orig 2017-12-01 15:46:28.171720501 +0000
+++ ./fileattrs/firmware.attr 2017-12-01 15:46:28.171720501 +0000
@@ -0,0 +1,2 @@
+%__firmware_provides %{_rpmconfigdir}/firmware.prov
+%__firmware_path /lib/firmware/
--- /dev/null
+++ fileattrs/kernel.attr
--- ./fileattrs/kernel.attr.orig 2017-12-01 15:46:28.172720497 +0000
+++ ./fileattrs/kernel.attr 2017-12-01 15:46:28.172720497 +0000
@@ -0,0 +1,2 @@
+%__kernel_provides %{_rpmconfigdir}/find-provides.ksyms --opensuse 0%{?is_opensuse}
+%__kernel_path ^(/lib/modules/[^/]*/kernel/.*\.ko(\.gz)?|/boot/vmlinu[xz].*)$
--- /dev/null
+++ fileattrs/kmp.attr
--- ./fileattrs/kmp.attr.orig 2017-12-01 15:46:28.172720497 +0000
+++ ./fileattrs/kmp.attr 2017-12-01 15:46:28.172720497 +0000
@@ -0,0 +1,4 @@
+%__kmp_provides %{_rpmconfigdir}/find-provides.ksyms --opensuse 0%{?is_opensuse}
+%__kmp_requires %{_rpmconfigdir}/find-requires.ksyms --opensuse 0%{?is_opensuse}
+%__kmp_supplements %{_rpmconfigdir}/find-supplements.ksyms
+%__kmp_path ^/lib/modules/[^/]*/(updates|extra)/.*\.ko(\.gz)?
--- fileattrs/perl.attr.orig
+++ fileattrs/perl.attr
--- ./fileattrs/perl.attr.orig 2017-08-10 08:08:07.113108701 +0000
+++ ./fileattrs/perl.attr 2017-12-01 15:46:28.172720497 +0000
@@ -1,3 +1,4 @@
-%__perl_requires %{_rpmconfigdir}/perl.req
+# disabled for now
+#%__perl_requires %{_rpmconfigdir}/perl.req
%__perl_magic ^.*[Pp]erl .*$
%__perl_flags exeonly
--- fileattrs/perllib.attr.orig
+++ fileattrs/perllib.attr
--- ./fileattrs/perllib.attr.orig 2017-08-10 08:08:07.113108701 +0000
+++ ./fileattrs/perllib.attr 2017-12-01 15:46:28.172720497 +0000
@@ -1,5 +1,6 @@
%__perllib_provides %{_rpmconfigdir}/perl.prov
-%__perllib_requires %{_rpmconfigdir}/perl.req
@ -78,8 +59,8 @@
%__perllib_magic ^Perl[[:digit:]] module source.*
%__perllib_path \\.pm$
%__perllib_flags magic_and_path
--- /dev/null
+++ fileattrs/sysvinit.attr
--- ./fileattrs/sysvinit.attr.orig 2017-12-01 15:46:28.172720497 +0000
+++ ./fileattrs/sysvinit.attr 2017-12-01 15:46:28.172720497 +0000
@@ -0,0 +1,2 @@
+%__sysvinit_provides %{_rpmconfigdir}/sysvinitdeps.sh --provides
+%__sysvinit_path ^/etc/init\.d/

View File

@ -1,90 +0,0 @@
Support for finding Python translation files in %python_sitelib
or %python_sitearch.
Sascha Peilicke <speilicke@suse.com>
--- ./scripts/find-lang.sh.orig 2017-01-19 13:07:41.062796290 +0000
+++ ./scripts/find-lang.sh 2017-01-19 13:07:48.561774470 +0000
@@ -35,6 +35,7 @@ Additional options:
--without-gnome do not find GNOME help files
--with-mate find MATE help files
--without-kde do not find KDE help files
+ --with-python find Python translation files
--with-qt find Qt translation files
--with-html find HTML files
--with-man find localized man pages
@@ -61,6 +62,7 @@ shift
GNOME=
MATE=#
KDE=
+PYTHON=#
QT=#
MAN=#
HTML=#
@@ -93,6 +95,10 @@ while test $# -gt 0 ; do
KDE=#
shift
;;
+ --with-python )
+ PYTHON=
+ shift
+ ;;
--with-qt )
QT=
shift
@@ -136,21 +142,25 @@ MO_NAME_NEW=$MO_NAME.tmp.$$
rm -f $MO_NAME_NEW
# remove languages we do not yet support - but give out statistics
-find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
- if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then
- find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do
- echo -n "removing translation $file: "
- msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null -
+if [ -d "$TOP_DIR/usr/share/locale/" ] ; then
+ find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then
+ find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do
+ echo -n "removing translation $file: "
+ msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null -
+ done
+ rm -rf $TOP_DIR/usr/share/locale/$dir
+ fi
done
- rm -rf $TOP_DIR/usr/share/locale/$dir
- fi
-done
-find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do
- if ! rpm -ql filesystem | egrep -q "/usr/share/help/$dir"$; then
- echo "removing help translation /usr/share/help/$dir"
- rm -rf $TOP_DIR/usr/share/help/$dir
- fi
-done
+fi
+if [ -d "$TOP_DIR/usr/share/help/" ] ; then
+ find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | egrep -q "/usr/share/help/$dir"$; then
+ echo "removing help translation /usr/share/help/$dir"
+ rm -rf $TOP_DIR/usr/share/help/$dir
+ fi
+ done
+fi
find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
@@ -201,6 +211,16 @@ s:'"$TOP_DIR"'::
s:^[^%].*::
'"$ONLY_C"'/%lang(C)/!d
'"$NO_C"'/%lang(C)/d
+s:%lang(C) ::
+/^$/d' >> $MO_NAME_NEW
+
+find "$TOP_DIR" -type f -o -type l|sed '
+s:'"$TOP_DIR"'::
+'"$NO_ALL_NAME$PYTHON"'s:\(/usr/lib.*/python.*/site-packages/'"$NAME"'$\):%dir \1:
+'"$ALL_NAME$PYTHON"'s:\(/usr/lib.*/python.*/site-packages/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
+s:^[^%].*::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW

View File

@ -1,23 +1,6 @@
Author: Fabian Vogt <fvogt@suse.com>
Subject: Handle special cases of qt translations correctly
References: boo#1027925
Some KDE frameworks write their translations to files like this:
/usr/share/locale/ca/LC_MESSAGES/libkirigami2plugin_qt.qm
Without this patch it gets detected as %lang(qt), which is obviously
incorrect. This copies two lines from the .mo handling and adjusts
them to handle _qt.qm files as well. "qt" is not an official ISO language
code, so this should not break anything in the past or hopefully the future.
Signed-off-by: Fabian Vogt <fvogt@suse.com>
---
scripts/find-lang.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- scripts/find-lang.sh.orig
+++ scripts/find-lang.sh
@@ -303,9 +303,11 @@ s:%lang(C) ::
--- ./scripts/find-lang.sh.orig 2017-12-01 16:07:23.339071251 +0000
+++ ./scripts/find-lang.sh 2017-12-01 16:13:00.392088317 +0000
@@ -296,7 +296,9 @@ s:%lang(C) ::
find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
@ -25,9 +8,6 @@ Signed-off-by: Fabian Vogt <fvogt@suse.com>
+'"$ALL_NAME$QT"'s:\(.*/locale/\)\([^/]\+\)\(/.\+/\)\([^/]\+_qt\.qm$\):%lang(\2) \1\2\3\4:
+'"$NO_ALL_NAME$QT"'s:\(.*/locale/\)\([^/]\+\)\(/.\+/\)\('"$NAME"'_qt\.qm$\):%lang(\2) \1\2\3\4:
+'"$NO_ALL_NAME$QT"'s:^\([^%].*/'"$NAME"'_\([a-zA-Z]\{2\}\([_@].*\)\?\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
-'"$ALL_NAME$QT"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
+'"$ALL_NAME$QT"'s:^\([^%].*/[^/_]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
'"$ALL_NAME$QT"'s:^\([^%].*/\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/_]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:

View File

@ -7,9 +7,9 @@ behavior to reflect that policy.
Signed-off-by: Jan Blunck <jblunck@suse.de>
--- ./scripts/find-debuginfo.sh.orig 2012-06-01 13:12:04.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2012-06-01 13:12:17.000000000 +0000
@@ -133,7 +133,17 @@ debug_link()
--- ./scripts/find-debuginfo.sh.orig 2017-12-01 15:26:21.939199791 +0000
+++ ./scripts/find-debuginfo.sh 2017-12-01 15:27:03.153081225 +0000
@@ -305,7 +305,17 @@ debug_link()
local l="/usr/lib/debug$2"
local t="$1"
echo >> "$LINKSFILE" "$l $t"
@ -27,15 +27,4 @@ Signed-off-by: Jan Blunck <jblunck@suse.de>
+ esac
}
# Provide .2, .3, ... symlinks to all filename instances of this build-id.
@@ -186,8 +196,8 @@ make_id_link()
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
- if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
- elfcmp "$root_idfile" "$RPM_BUILD_ROOT$file" ; then
+ if cmp -s "$RPM_BUILD_ROOT$other" "$RPM_BUILD_ROOT$file" ||
+ elfcmp "$RPM_BUILD_ROOT$other" "$RPM_BUILD_ROOT$file" ; then
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
get_debugfn()

View File

@ -1,47 +1,15 @@
Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig 2017-02-16 10:54:14.779025209 +0100
+++ scripts/find-debuginfo.sh 2017-07-26 14:39:24.338122534 +0200
@@ -224,6 +224,20 @@ make_id_dup_link()
debug_link "$file" "/$idfile"
}
--- ./scripts/find-debuginfo.sh.orig 2017-10-05 10:04:57.586602035 +0000
+++ ./scripts/find-debuginfo.sh 2017-12-01 14:45:15.439290101 +0000
@@ -326,12 +326,18 @@ trap 'rm -rf "$temp"' EXIT
+# Compare two binaries but ignore the .note.gnu.build-id section
+elfcmp()
+{
+ local tmp1=$(mktemp -t ${1##*/}.XXXXXX)
+ local tmp2=$(mktemp -t ${2##*/}.XXXXXX)
+
+ objcopy -R .note.gnu.build-id -R .gnu_debuglink $1 $tmp1
+ objcopy -R .note.gnu.build-id -R .gnu_debuglink $2 $tmp2
+ cmp -s $tmp1 $tmp2
+ local res=$?
+ rm -f $tmp1 $tmp2
+ return $res
+}
+
# Make a build-id symlink for id $1 with suffix $3 to file $2.
make_id_link()
{
@@ -244,7 +258,7 @@ make_id_link()
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
- eu-elfcmp -q "$root_idfile" "$RPM_BUILD_ROOT$file" 2> /dev/null; then
+ elfcmp "$root_idfile" "$RPM_BUILD_ROOT$file" ; then
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
@@ -273,12 +287,18 @@ strict_error=ERROR
$strict || strict_error=WARNING
# Strip ELF binaries
# Build a list of unstripped ELF files and their hardlinks
touch "$temp/primary"
-find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \
- \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
- -print |
-file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped.*/\1/p' |
-xargs --no-run-if-empty stat -c '%h %D_%i %n' |
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z |
+find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | sort -z |
+xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
+ case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
@ -53,23 +21,24 @@ Index: scripts/find-debuginfo.sh
+ ;;
+ *) continue ;;
+ esac
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
@@ -302,7 +322,11 @@ while read nlinks inum f; do
if [ $nlinks -gt 1 ]; then
var=seen_$inum
if test -n "${!var}"; then
@@ -364,6 +370,8 @@ do_file()
if [ "$no_recompute_build_id" = "true" ]; then
no_recompute="-n"
fi
echo "extracting debug info from $f"
- id=$(${lib_rpm_dir}/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
+ mode=$(stat -c %a "$f")
+ chmod +w "$f"
+ id=$($(DEBUGEDIT=$(which debugedit 2>/dev/null); \
+ echo ${DEBUGEDIT:-/usr/lib/rpm/debugedit}) \
+ -b "$RPM_BUILD_DIR" -d /usr/src/debug \
-i -l "$SOURCEFILE" "$f") || exit
if [ $nlinks -gt 1 ]; then
eval linkedid_$inum=\$id
@@ -323,13 +347,25 @@ while read nlinks inum f; do
id=$(${lib_rpm_dir}/debugedit -b "$debug_base_name" -d "$debug_dest_name" \
$no_recompute -i \
${build_id_seed:+--build-id-seed="$build_id_seed"} \
@@ -387,17 +395,30 @@ do_file()
# just has its file names collected and adjusted.
case "$dn" in
/usr/lib/debug/*)
+ chmod $mode "$f"
return ;;
esac
mkdir -p "${debugdn}"
@ -80,7 +49,7 @@ Index: scripts/find-debuginfo.sh
- strip_to_debug "${debugfn}" "$f"
- chmod u-w "$f"
- fi
+ objcopy --only-keep-debug $f $debugfn || :
+ objcopy --only-keep-debug "$f" "$debugfn" || :
+ (
+ shopt -s extglob
+ strip_option="--strip-all"
@ -96,26 +65,26 @@ Index: scripts/find-debuginfo.sh
+ if test "$NO_DEBUGINFO_STRIP_DEBUG" = true ; then
+ strip_option=
+ fi
+ objcopy --add-gnu-debuglink=$debugfn -R .comment -R .GCC.command.line $strip_option $f
+ chmod $mode $f
+ objcopy --add-gnu-debuglink="$debugfn" -R .comment -R .GCC.command.line $strip_option "$f"
+ chmod $mode "$f"
+ ) || :
# strip -g implies we have full symtab, don't add mini symtab in that case.
$strip_g || ($include_minidebug && add_minidebug "${debugfn}" "$f")
@@ -366,7 +402,7 @@ if $run_dwz && type dwz >/dev/null 2>&1
# It only makes sense to add a minisymtab for executables and shared
@@ -507,7 +528,7 @@ if $run_dwz \
rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null
if [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" ]; then
id="`readelf -Wn "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" \
- 2>/dev/null | sed -n 's/^ Build ID: \([0-9a-f]\+\)/\1/p'`"
+ 2>/dev/null | sed -n 's/^.* Build ID: \([0-9a-f]\+\)/\1/p'`"
[ -n "$id" ] \
&& make_id_link "$id" "/usr/lib/debug/.dwz/${dwz_multifile_name}" .debug
fi
@@ -399,12 +435,14 @@ if [ -s "$SOURCEFILE" ]; then
# stupid cpio creates new directories in mode 0700, fixup
find "${RPM_BUILD_ROOT}/usr/src/debug" -type d -print0 |
xargs --no-run-if-empty -0 chmod a+rx
+ find "${RPM_BUILD_ROOT}/usr/src/debug" -type f -print0 |
# dwz invalidates .gnu_debuglink CRC32 in the main files.
@@ -551,12 +572,14 @@ if [ -s "$SOURCEFILE" ]; then
# and non-standard modes may be inherented from original directories, fixup
find "${RPM_BUILD_ROOT}${debug_dest_name}" -type d -print0 |
xargs --no-run-if-empty -0 chmod 0755
+ find "${RPM_BUILD_ROOT}${debug_dest_name}" -type f -print0 |
+ xargs --no-run-if-empty -0 chmod a+r
fi

View File

@ -1,29 +1,23 @@
---
scripts/Makefile.am | 2 +
scripts/find-provides.ksyms | 60 ++++++++++++++++++++++++++++++++++++++++++++
scripts/find-requires.ksyms | 29 +++++++++++++++++++++
3 files changed, 91 insertions(+)
--- scripts/Makefile.am.orig
+++ scripts/Makefile.am
@@ -16,6 +16,7 @@ EXTRA_DIST = \
--- ./scripts/Makefile.am.orig 2017-12-01 14:48:23.171746842 +0000
+++ ./scripts/Makefile.am 2017-12-01 14:49:09.395612962 +0000
@@ -18,6 +18,7 @@ EXTRA_DIST = \
tgpg vpkg-provides.sh \
find-requires find-provides \
find-requires.php find-provides.php \
+ find-requires.ksyms find-provides.ksyms \
mono-find-requires mono-find-provides \
ocaml-find-requires.sh ocaml-find-provides.sh \
pkgconfigdeps.sh libtooldeps.sh appdata.prov \
@@ -32,6 +33,7 @@ rpmconfig_SCRIPTS = \
check-buildroot check-rpaths check-rpaths-worker \
pkgconfigdeps.sh libtooldeps.sh metainfo.prov \
@@ -34,6 +35,7 @@ rpmconfig_SCRIPTS = \
debuginfo.prov \
find-lang.sh find-requires find-provides \
perl.prov perl.req pythondeps.sh \
perl.prov perl.req pythondeps.sh pythondistdeps.py \
+ find-requires.ksyms find-provides.ksyms \
metainfo.prov \
mono-find-requires mono-find-provides \
pkgconfigdeps.sh libtooldeps.sh \
ocaml-find-requires.sh ocaml-find-provides.sh \
--- /dev/null
+++ scripts/find-provides.ksyms
--- ./scripts/find-provides.ksyms.orig 2017-12-01 14:48:28.374731785 +0000
+++ ./scripts/find-provides.ksyms 2017-12-01 14:48:28.374731785 +0000
@@ -0,0 +1,60 @@
+#! /bin/bash
+
@ -85,8 +79,8 @@
+ | sed -r -ne "s/^0*([0-9a-f]+) A __crc_(.+)/ksym($flavor:\\2) = \\1/p"
+done \
+| sort -u
--- /dev/null
+++ scripts/find-requires.ksyms
--- ./scripts/find-requires.ksyms.orig 2017-12-01 14:48:28.375731781 +0000
+++ ./scripts/find-requires.ksyms 2017-12-01 14:48:28.375731781 +0000
@@ -0,0 +1,29 @@
+#! /bin/bash
+

View File

@ -1,5 +1,5 @@
--- ./scripts/find-lang.sh.orig 2016-10-13 07:12:21.467778490 +0000
+++ ./scripts/find-lang.sh 2017-01-19 12:45:51.491544036 +0000
--- ./scripts/find-lang.sh.orig 2017-10-05 10:04:57.586602035 +0000
+++ ./scripts/find-lang.sh 2017-12-01 14:51:31.189202268 +0000
@@ -30,11 +30,11 @@ the top of the tree containing the files
PACKAGE_NAME is the %{name} of the package. This should also be
the basename of the .mo files. the output is written to
@ -107,12 +107,7 @@
find $TOP_DIR -type d|sed '
s:'"$TOP_DIR"'::
@@ -162,11 +176,11 @@ s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MATE"'s:\(.*/mate/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) \1\2:
'"$ALL_NAME$MATE"'s:\(.*/mate/help/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
'"$ALL_NAME$MATE"'s:\(.*/mate/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]/.\+\)::
-'"$ALL_NAME$GNOME"'s:\(.*/mate/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) \1\2:
+'"$ALL_NAME$MATE"'s:\(.*/mate/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) \1\2:
@@ -166,14 +180,14 @@ s:'"$TOP_DIR"'::
s:%lang(.*) .*/mate/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
s:^\([^%].*\)::
s:%lang(C) ::
@ -121,6 +116,14 @@
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MATE"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
'"$ALL_NAME$MATE"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
s:^\([^%].*\)::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type f|sed '
s:'"$TOP_DIR"'::
@@ -181,7 +195,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MATE"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
@ -147,8 +150,17 @@
+/^$/d' >> $MO_NAME_NEW
fi
KF5_HTML=`kf5-config --expandvars --install html 2>/dev/null`
@@ -219,7 +233,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
fi
find "$TOP_DIR" -type d|sed '
@@ -217,7 +231,7 @@ s:'"$TOP_DIR"'::
@@ -230,7 +244,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$HTML"'s:\(.*/doc/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
@ -157,7 +169,7 @@
find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
@@ -228,7 +242,7 @@ s:'"$TOP_DIR"'::
@@ -243,7 +257,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
@ -166,7 +178,7 @@
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
@@ -236,17 +250,22 @@ s:'"$TOP_DIR"'::
@@ -251,17 +265,22 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
s:%lang(C) ::

156
hardlink.diff Normal file
View File

@ -0,0 +1,156 @@
Create first hard link file and keep open, write it at end
upstream commit e276991614fd127f21aba94946f81f22cb7e6b73
upstream commit 0afe0c3c6cba64d8b7adcdec6ed70f8d32961b58
upstream commit ef3ff412c33a71be6b3543a50c244377dff3d9e7
--- ./lib/fsm.c.orig 2017-10-05 10:04:56.977602149 +0000
+++ ./lib/fsm.c 2017-12-05 12:05:19.529973029 +0000
@@ -218,56 +218,76 @@ static int linkSane(FD_t wfd, const char
sb.st_dev == lsb.st_dev && sb.st_ino == lsb.st_ino);
}
-/** \ingroup payload
- * Create file from payload stream.
- * @return 0 on success
- */
-static int expandRegular(rpmfi fi, const char *dest, rpmpsm psm, int exclusive, int nodigest, int nocontent)
+static void wfd_close(FD_t *wfdp)
{
- FD_t wfd = NULL;
- int rc = 0;
+ if (wfdp && *wfdp) {
+ int myerrno = errno;
+ static int oneshot = 0;
+ static int flush_io = 0;
+ if (!oneshot) {
+ flush_io = rpmExpandNumeric("%{?_flush_io}");
+ oneshot = 1;
+ }
+ if (flush_io) {
+ int fdno = Fileno(*wfdp);
+ fsync(fdno);
+ }
+ Fclose(*wfdp);
+ *wfdp = NULL;
+ errno = myerrno;
+ }
+}
+static int wfd_open(FD_t *wfdp, const char *dest, int exclusive)
+{
+ int rc = 0;
/* Create the file with 0200 permissions (write by owner). */
{
mode_t old_umask = umask(0577);
- wfd = Fopen(dest, exclusive ? "wx.ufdio" : "a.ufdio");
+ *wfdp = Fopen(dest, exclusive ? "wx.ufdio" : "a.ufdio");
umask(old_umask);
/* If reopening, make sure the file is what we expect */
- if (!exclusive && wfd != NULL && !linkSane(wfd, dest)) {
+ if (!exclusive && *wfdp != NULL && !linkSane(*wfdp, dest)) {
rc = RPMERR_OPEN_FAILED;
goto exit;
}
}
- if (Ferror(wfd)) {
+ if (Ferror(*wfdp)) {
rc = RPMERR_OPEN_FAILED;
goto exit;
}
+ return 0;
+
+exit:
+ wfd_close(wfdp);
+ return rc;
+}
+
+/** \ingroup payload
+ * Create file from payload stream.
+ * @return 0 on success
+ */
+static int expandRegular(rpmfi fi, const char *dest, rpmpsm psm, int exclusive, int nodigest, int nocontent)
+{
+ FD_t wfd = NULL;
+ int rc;
+
+ rc = wfd_open(&wfd, dest, exclusive);
+ if (rc != 0)
+ goto exit;
+
if (!nocontent)
rc = rpmfiArchiveReadToFilePsm(fi, wfd, nodigest, psm);
+ wfd_close(&wfd);
exit:
- if (wfd) {
- int myerrno = errno;
- static int oneshot = 0;
- static int flush_io = 0;
- if (!oneshot) {
- flush_io = rpmExpandNumeric("%{?_flush_io}");
- oneshot = 1;
- }
- if (flush_io) {
- int fdno = Fileno(wfd);
- fsync(fdno);
- }
- Fclose(wfd);
- errno = myerrno;
- }
return rc;
}
static int fsmMkfile(rpmfi fi, const char *dest, rpmfiles files,
rpmpsm psm, int nodigest, int *setmeta,
- int * firsthardlink)
+ int * firsthardlink, FD_t *firstlinkfile)
{
int rc = 0;
int numHardlinks = rpmfiFNlink(fi);
@@ -276,7 +296,7 @@ static int fsmMkfile(rpmfi fi, const cha
/* Create first hardlinked file empty */
if (*firsthardlink < 0) {
*firsthardlink = rpmfiFX(fi);
- rc = expandRegular(fi, dest, psm, 1, nodigest, 1);
+ rc = wfd_open(firstlinkfile, dest, 1);
} else {
/* Create hard links for others */
char *fn = rpmfilesFN(files, *firsthardlink);
@@ -294,7 +314,8 @@ static int fsmMkfile(rpmfi fi, const cha
rc = expandRegular(fi, dest, psm, 1, nodigest, 0);
} else if (rpmfiArchiveHasContent(fi)) {
if (!rc)
- rc = expandRegular(fi, dest, psm, 0, nodigest, 0);
+ rc = rpmfiArchiveReadToFilePsm(fi, *firstlinkfile, nodigest, psm);
+ wfd_close(firstlinkfile);
*firsthardlink = -1;
} else {
*setmeta = 0;
@@ -861,6 +882,7 @@ int rpmPackageFilesInstall(rpmts ts, rpm
int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
int firsthardlink = -1;
+ FD_t firstlinkfile = NULL;
int skip;
rpmFileAction action;
char *tid = NULL;
@@ -932,7 +954,7 @@ int rpmPackageFilesInstall(rpmts ts, rpm
if (S_ISREG(sb.st_mode)) {
if (rc == RPMERR_ENOENT) {
rc = fsmMkfile(fi, fpath, files, psm, nodigest,
- &setmeta, &firsthardlink);
+ &setmeta, &firsthardlink, &firstlinkfile);
}
} else if (S_ISDIR(sb.st_mode)) {
if (rc == RPMERR_ENOENT) {
@@ -970,7 +992,8 @@ int rpmPackageFilesInstall(rpmts ts, rpm
/* we skip the hard linked file containing the content */
/* write the content to the first used instead */
char *fn = rpmfilesFN(files, firsthardlink);
- rc = expandRegular(fi, fn, psm, 0, nodigest, 0);
+ rc = rpmfiArchiveReadToFilePsm(fi, firstlinkfile, nodigest, psm);
+ wfd_close(&firstlinkfile);
firsthardlink = -1;
free(fn);
}

View File

@ -1,12 +1,12 @@
--- lib/header.c.orig 2012-04-03 13:29:24.000000000 +0000
+++ lib/header.c 2012-06-01 14:22:12.000000000 +0000
@@ -900,7 +900,8 @@ Header headerImport(void * blob, unsigne
--- ./lib/header.c.orig 2017-12-01 15:54:04.254399473 +0000
+++ ./lib/header.c 2017-12-01 15:55:36.389131237 +0000
@@ -929,7 +929,8 @@ rpmRC hdrblobImport(hdrblob blob, int fa
rdlen += REGION_TAG_COUNT;
- if (rdlen != dl)
- if (rdlen != blob->dl)
+ /* should be equality test, but can be off if entries are not perfectly aligned */
+ if (rdlen > dl)
+ if (rdlen > blob->dl)
goto errxit;
}

View File

@ -1,14 +1,14 @@
--- ./scripts/Makefile.am.orig 2017-01-19 13:05:33.490167306 +0000
+++ ./scripts/Makefile.am 2017-01-19 13:06:29.192005359 +0000
@@ -21,6 +21,7 @@ EXTRA_DIST = \
--- ./scripts/Makefile.am.orig 2017-12-01 15:44:10.626118239 +0000
+++ ./scripts/Makefile.am 2017-12-01 15:44:14.182107984 +0000
@@ -23,6 +23,7 @@ EXTRA_DIST = \
ocaml-find-requires.sh ocaml-find-provides.sh \
pkgconfigdeps.sh libtooldeps.sh appdata.prov \
pkgconfigdeps.sh libtooldeps.sh metainfo.prov \
fontconfig.prov desktop-file.prov script.req \
+ sysvinitdeps.sh \
macros.perl macros.php macros.python
rpmconfig_SCRIPTS = \
@@ -38,6 +39,7 @@ rpmconfig_SCRIPTS = \
@@ -41,6 +42,7 @@ rpmconfig_SCRIPTS = \
pkgconfigdeps.sh libtooldeps.sh \
ocaml-find-requires.sh ocaml-find-provides.sh \
fontconfig.prov desktop-file.prov script.req \
@ -16,8 +16,8 @@
rpmdb_loadcvt rpm2cpio.sh tgpg
rpmconfig_DATA = \
--- ./scripts/sysvinitdeps.sh.orig 2017-01-19 13:05:37.523155583 +0000
+++ ./scripts/sysvinitdeps.sh 2017-01-19 13:05:37.523155583 +0000
--- ./scripts/sysvinitdeps.sh.orig 2017-12-01 15:44:14.183107975 +0000
+++ ./scripts/sysvinitdeps.sh 2017-12-01 15:44:14.183107975 +0000
@@ -0,0 +1,17 @@
+#!/bin/sh
+

View File

@ -1,23 +1,7 @@
--- ./macros.in.orig 2017-02-16 09:40:09.908649457 +0000
+++ ./macros.in 2017-07-05 14:15:53.855734802 +0000
@@ -185,22 +185,22 @@
# Template for debug information sub-package.
%debug_package \
-%ifnarch noarch\
%global __debug_package 1\
%package debuginfo\
Summary: Debug information for package %{name}\
Group: Development/Debug\
AutoReqProv: 0\
+#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
%description debuginfo\
This package provides debug information for package %{name}.\
Debug information is useful when developing applications that use this\
package or when debugging this package.\
%files debuginfo -f debugfiles.list\
%defattr(-,root,root)\
-%endif\
--- ./macros.in.orig 2017-12-07 16:01:58.933485867 +0000
+++ ./macros.in 2017-12-07 16:02:25.273409983 +0000
@@ -224,7 +224,8 @@ package or when debugging this package.\
%endif\
%{nil}
-%_defaultdocdir %{_datadir}/doc
@ -25,8 +9,8 @@
+%_docdir_fmt %%{NAME}
%_defaultlicensedir %{_datadir}/licenses
# The path to the gzip executable (legacy, use %{__gzip} instead).
@@ -238,7 +238,8 @@ package or when debugging this package.\
# Following macros for filtering auto deps must not be used in spec files.
@@ -278,7 +279,8 @@ package or when debugging this package.\
%_tmppath %{_var}/tmp
# Path to top of build area.
@ -36,8 +20,8 @@
# The path to the unzip executable (legacy, use %{__unzip} instead).
%_unzipbin %{__unzip}
@@ -341,7 +342,7 @@ package or when debugging this package.\
# "w7.lzdio" lzma-alone level 7, lzma's default
@@ -382,7 +384,7 @@ package or when debugging this package.\
# "w6.lzdio" lzma-alone level 6, lzma's default
#
#%_source_payload w9.gzdio
-#%_binary_payload w9.gzdio
@ -45,7 +29,7 @@
# Algorithm to use for generating file checksum digests on build.
# If not specified or 0, MD5 is used.
@@ -448,6 +449,19 @@ package or when debugging this package.\
@@ -489,6 +491,19 @@ package or when debugging this package.\
#
#%_include_minidebuginfo 1
@ -62,10 +46,32 @@
+ --dwz-low-mem-die-limit %{_dwz_low_mem_die_limit}\\\
+ --dwz-max-die-limit %{_dwz_max_die_limit}
+
#
# Include a .gdb_index section in the .debug files.
# Requires _enable_debug_packages and gdb-add-index installed.
@@ -521,7 +536,7 @@ package or when debugging this package.\
# Same as for "separate" but if the __debug_package global is set then
# the -debuginfo package will have a compatibility link for the main
# ELF /usr/lib/debug/.build-id/xx/yyy -> /usr/lib/.build-id/xx/yyy
-%_build_id_links compat
+%_build_id_links alldebug
# Whether build-ids should be made unique between package version/releases
# when generating debuginfo packages. If set to 1 this will pass
@@ -550,10 +565,10 @@ package or when debugging this package.\
%_unique_debug_srcs 1
# Whether rpm should put debug source files into its own subpackage
-#%_debugsource_packages 1
+%_debugsource_packages 1
# Whether rpm should create extra debuginfo packages for each subpackage
-#%_debuginfo_subpackages 1
+%_debuginfo_subpackages 1
#
# Use internal dependency generator rather than external helpers?
%_use_internal_dependency_generator 1
@@ -459,16 +473,22 @@ package or when debugging this package.\
@@ -566,16 +581,22 @@ package or when debugging this package.\
# Directories whose contents should be considered as documentation.
%__docdir_path %{_datadir}/doc:%{_datadir}/man:%{_datadir}/info:%{_datadir}/gtk-doc/html:%{?_docdir}:%{?_mandir}:%{?_infodir}:%{?_javadocdir}:/usr/doc:/usr/man:/usr/info:/usr/X11R6/man
@ -90,7 +96,7 @@
#
# Path to file attribute classifications for automatic dependency
@@ -538,10 +558,10 @@ package or when debugging this package.\
@@ -654,10 +675,10 @@ package or when debugging this package.\
# Misc BDB tuning options
%__dbi_other mp_mmapsize=128Mb mp_size=1Mb
@ -103,7 +109,7 @@
#==============================================================================
# ---- GPG/PGP/PGP5 signature macros.
@@ -840,7 +860,7 @@ package or when debugging this package.\
@@ -969,7 +990,7 @@ package or when debugging this package.\
%_build_vendor %{_host_vendor}
%_build_os %{_host_os}
%_host @host@
@ -112,9 +118,20 @@
%_host_cpu @host_cpu@
%_host_vendor @host_vendor@
%_host_os @host_os@
@@ -1009,6 +1029,183 @@ done \
%python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")
%python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")
@@ -1095,7 +1116,9 @@ package or when debugging this package.\
#------------------------------------------------------------------------------
# arch macro for all supported ARM processors
-%arm armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl
+%arm armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl
+%arml armv3l armv4l armv5l armv5tel armv6l armv6hl armv7l armv7hl armv7hnl
+%armb armv4b armv5b armv5teb
#------------------------------------------------------------------------------
# arch macro for 32-bit MIPS processors
@@ -1125,6 +1148,183 @@ package or when debugging this package.\
# arch macro for all supported Alpha processors
%alpha alpha alphaev56 alphaev6 alphaev67
+# More useful perl macros (from Raul Dias <rsd@swi.com.br>)
+#
@ -294,20 +311,9 @@
+EOF
+
#------------------------------------------------------------------------------
# arch macro for all Intel i?86 compatibile processors
# (Note: This macro (and it's analogues) will probably be obsoleted when
@@ -1019,7 +1216,9 @@ done \
#------------------------------------------------------------------------------
# arch macro for all supported ARM processors
-%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl
+%arm armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl
+%arml armv3l armv4l armv5l armv5tel armv6l armv6hl armv7l armv7hl armv7hnl
+%armb armv4b armv5b armv5teb
#------------------------------------------------------------------------------
# arch macro for 32-bit MIPS processors
@@ -1174,3 +1373,24 @@ end}
# arch macro for all supported PowerPC 64 processors
%power64 ppc64 ppc64p7 ppc64le
@@ -1257,3 +1457,24 @@ end}
# \endverbatim
#*/

View File

@ -1,19 +0,0 @@
--- ./tools/sepdebugcrcfix.c.orig 2017-01-19 15:28:12.521321881 +0000
+++ ./tools/sepdebugcrcfix.c 2017-01-19 15:28:26.895267612 +0000
@@ -28,7 +28,6 @@
#include <error.h>
#include <libelf.h>
#include <gelf.h>
-#include <bfd.h>
#define _(x) x
#define static_assert(expr) \
@@ -46,7 +45,7 @@ static const bool false = 0, true = 1;
static unsigned long
calc_gnu_debuglink_crc32 (unsigned long crc,
const unsigned char *buf,
- bfd_size_type len)
+ size_t len)
{
static const unsigned long crc32_table[256] =
{

View File

@ -1,15 +1,15 @@
--- ./build/parsePreamble.c.orig 2014-02-20 14:51:56.798802270 +0000
+++ ./build/parsePreamble.c 2014-02-20 14:53:27.617802110 +0000
@@ -895,7 +895,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_SUGGESTFLAGS, 0, 0, LEN_AND_STR("suggests")},
{RPMTAG_SUPPLEMENTFLAGS, 0, 0, LEN_AND_STR("supplements")},
{RPMTAG_ENHANCEFLAGS, 0, 0, LEN_AND_STR("enhances")},
--- ./build/parsePreamble.c.orig 2017-12-01 15:42:35.766392406 +0000
+++ ./build/parsePreamble.c 2017-12-01 15:43:29.364237520 +0000
@@ -996,7 +996,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_SUGGESTNAME, 0, 0, LEN_AND_STR("suggests")},
{RPMTAG_SUPPLEMENTNAME, 0, 0, LEN_AND_STR("supplements")},
{RPMTAG_ENHANCENAME, 0, 0, LEN_AND_STR("enhances")},
- {RPMTAG_PREREQ, 2, 1, LEN_AND_STR("prereq")},
+ {RPMTAG_PREREQ, 2, 0, LEN_AND_STR("prereq")},
{RPMTAG_CONFLICTFLAGS, 0, 0, LEN_AND_STR("conflicts")},
{RPMTAG_OBSOLETEFLAGS, 0, 0, LEN_AND_STR("obsoletes")},
{RPMTAG_CONFLICTNAME, 0, 0, LEN_AND_STR("conflicts")},
{RPMTAG_OBSOLETENAME, 0, 0, LEN_AND_STR("obsoletes")},
{RPMTAG_PREFIXES, 0, 0, LEN_AND_STR("prefixes")},
@@ -904,7 +904,7 @@ static struct PreambleRec_s const preamb
@@ -1005,7 +1005,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarchitectures")},
{RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarch")},
{RPMTAG_BUILDCONFLICTS, 0, 0, LEN_AND_STR("buildconflicts")},

View File

@ -1,16 +0,0 @@
--- ./lib/transaction.c.orig 2016-04-21 12:21:53.649740302 +0000
+++ ./lib/transaction.c 2016-04-21 12:28:00.821356311 +0000
@@ -134,6 +134,13 @@ static rpmDiskSpaceInfo rpmtsCreateDSI(c
dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0)
? sfb.f_ffree : -1;
+ /* normalize block size to 4096 bytes if it is too big. */
+ if (dsi->bsize > 4096) {
+ uint64_t old_size = dsi->bavail * dsi->bsize;
+ dsi->bsize = 4096; /* Assume 4k block size */
+ dsi->bavail = old_size / dsi->bsize;
+ }
+
/* Find mount point belonging to this device number */
resolved_path = realpath(dirName, mntPoint);
if (!resolved_path) {

View File

@ -1,26 +0,0 @@
Support package statements like "package 1.2.3;" and "package 1.2.3 {", which are
new in Perl 5.12 and 5.14
--- ./scripts/perl.prov.orig 2017-06-09 15:20:11.869617486 +0200
+++ ./scripts/perl.prov 2017-06-09 15:04:59.840952250 +0200
@@ -129,9 +129,9 @@
# package name so we report all namespaces except some common
# false positives as if they were provided packages (really ugly).
- if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
+ if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*(?:v?([0-9_.]+)\s*)?[;{]/) {
$package = $1;
- undef $version;
+ $version = $2;
if ($package eq 'main') {
undef $package;
} else {
@@ -139,7 +139,7 @@
# the package definition is broken up over multiple blocks.
# In that case, don't stomp a previous $VERSION we might have
# found. (See BZ#214496.)
- $require{$package} = undef unless (exists $require{$package});
+ $require{$package} = $version unless (exists $require{$package});
}
}

View File

@ -1,13 +0,0 @@
Support a "first version wins" semantics.
--- ./scripts/perl.prov.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/perl.prov 2011-05-11 15:32:39.000000000 +0000
@@ -170,7 +170,7 @@ sub process_file {
$version = $1;
}
- $require{$package} = $version;
+ $require{$package} ||= $version;
}
# Allow someone to have a variable that defines virtual packages

View File

@ -1,3 +1,25 @@
-------------------------------------------------------------------
Tue Dec 19 09:39:25 UTC 2017 - jengelh@inai.de
- Update RPM groups
-------------------------------------------------------------------
Sat Oct 28 12:19:34 UTC 2017 - ngompa13@gmail.com
- Add a comment to note that prep and build stages come from rpm.spec
-------------------------------------------------------------------
Mon Oct 16 13:49:18 UTC 2017 - ngompa13@gmail.com
- Properly quote the conditional for Obsoletes+Provides
-------------------------------------------------------------------
Sun Oct 15 04:03:00 UTC 2017 - ngompa13@gmail.com
- Unify rpm-python and python3-rpm into singlespec
- Switch the build to use setuptools-based build, so that
the Python module is properly built with all its metadata
-------------------------------------------------------------------
Wed Nov 20 14:41:34 CET 2013 - mls@suse.de

View File

@ -1,7 +1,8 @@
#
# spec file for package rpm-python
# spec file for package python-rpm
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 Neal Gompa <ngompa13@gmail.com>.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,13 +17,13 @@
#
Name: rpm-python
Version: 4.13.0.1
Name: python-rpm
Version: 4.14.0
Release: 0
#!BuildIgnore: rpmlint-Factory
Summary: Python Bindings for Manipulating RPM Packages
License: GPL-2.0+
Group: System/Packages
Group: Development/Libraries/Python
Source99: rpm.spec
BuildRequires: file-devel
BuildRequires: libacl-devel
@ -35,18 +36,29 @@ BuildRequires: libtool
BuildRequires: lua-devel
BuildRequires: ncurses-devel
BuildRequires: popt-devel
BuildRequires: python-devel
BuildRequires: python-rpm-macros
BuildRequires: python2-devel
BuildRequires: python3-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel
Requires: rpm = %{version}
%py_requires
%if "%{python_flavor}" == "python2"
Obsoletes: rpm-python < %{version}-%{release}
Provides: rpm-python = %{version}-%{release}
%endif
# Enable Python build sourced from rpm spec
%global with_python 1
%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)}
%global with_python 2
%python_subpackages
%description
The rpm-python package contains a module that permits applications
written in the Python programming language to use the interface
supplied by RPM Package Manager libraries.
This package contains a module that permits applications written in
the Python programming language to use the interface supplied by
RPM Package Manager libraries.
This package should be installed if you want to develop Python programs
that will manipulate RPM packages and databases.
@ -54,20 +66,17 @@ that will manipulate RPM packages and databases.
%prep
%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/rpm.spec | sed -e '1d' -e '$d')}
%install
mkdir -p %{buildroot}%{_prefix}/lib
# only installing in python/ does not work because rpm links against
# installed libs at install time
%make_install
find %{buildroot} -not -type d -and -not -path %{buildroot}%{_libdir}/python%{py_ver}/site-packages/rpm/\* -print0 | xargs -0 rm
pushd %{buildroot}/%py_sitedir/rpm
rm -f _rpm*.a _rpm*.la
python %py_libdir/py_compile.py *.py
python -O %py_libdir/py_compile.py *.py
# The build stage is already declared and pulled in from rpm.spec
pushd python
%python_build
popd
%files
%defattr(-,root,root)
%{_libdir}/python*/*/*
%install
pushd python
%python_install
popd
%files %{python_files}
%{python_sitearch}/rpm*
%changelog

View File

@ -1,11 +0,0 @@
--- configure.ac
+++ configure.ac
@@ -537,7 +537,7 @@
])
CPPFLAGS="$save_CPPFLAGS"
save_LIBS="$LIBS"
- AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
+ AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION}mu python${PYTHON_VERSION} python],[
WITH_PYTHON_LIB="$ac_res"
],[AC_MSG_ERROR([missing python library])
])

View File

@ -1,33 +0,0 @@
-------------------------------------------------------------------
Fri Jul 12 15:36:43 CEST 2013 - mls@suse.de
- update to rpm-4.11.1
-------------------------------------------------------------------
Wed Jan 2 14:25:09 UTC 2013 - dmueller@suse.com
- Update to 4.10.2
-------------------------------------------------------------------
Sun Nov 4 08:54:25 UTC 2012 - coolo@suse.com
- fix build
-------------------------------------------------------------------
Sat Sep 22 13:24:30 UTC 2012 - idonmez@suse.com
- Update for rpm 4.10.0
-------------------------------------------------------------------
Tue Jan 17 10:29:20 UTC 2012 - saschpe@suse.de
- Spec file cleanup:
* Don't rm -rf %{buildroot}
* Removed %clean section
* Removed authors from description
-------------------------------------------------------------------
Mon Jan 9 17:12:41 CET 2012 - dmueller@suse.de
- Initial package

View File

@ -1,71 +0,0 @@
#
# spec file for package python3-rpm
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python3-rpm
Version: 4.13.0.1
Release: 0
Summary: Python Bindings for Manipulating RPM Packages
License: GPL-2.0+
Group: System/Packages
Source99: rpm.spec
BuildRequires: file-devel
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libelf-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
BuildRequires: libtool
BuildRequires: lua-devel
BuildRequires: ncurses-devel
BuildRequires: popt-devel
BuildRequires: python3-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel
Requires: rpm = %{version}
%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)}
%global with_python 3
%description
The python3-rpm package contains a module that permits applications
written in the Python programming language to use the interface
supplied by RPM Package Manager libraries.
This package should be installed if you want to develop Python programs
that will manipulate RPM packages and databases.
%prep
%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/rpm.spec | sed -e '1d' -e '$d')}
%install
mkdir -p %{buildroot}%{_prefix}/lib
# only installing in python/ does not work because rpm links against
# installed libs at install time
%make_install
find %{buildroot} -not -type d -and -not -path %{buildroot}%{_libdir}/python3*/site-packages/rpm/\* -print0 | xargs -0 rm
pushd %{buildroot}/%{_libdir}/python3*/site-packages/rpm
rm -f _rpm*.la _rpm*.a
python3 %{_libdir}/python3*/py_compile.py *.py
python3 -O %{_libdir}/python3*/py_compile.py *.py
popd
%files
%defattr(-,root,root)
%{_libdir}/python*/*/*
%changelog

7
pythondistdeps.diff Normal file
View File

@ -0,0 +1,7 @@
--- ./scripts/pythondistdeps.py.orig 2018-01-02 10:03:28.273247676 +0000
+++ ./scripts/pythondistdeps.py 2018-01-02 10:03:41.527207759 +0000
@@ -1,4 +1,3 @@
-#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2010 Per Øyvind Karlsen <proyvind@moondrake.org>

View File

@ -5,7 +5,7 @@
rm -f $MO_NAME_NEW
+# remove languages we do not yet support - but give out statistics
+find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
+test -d "$TOP_DIR/usr/share/locale/" && find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then
+ find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do
+ echo -n "removing translation $file: "
@ -14,7 +14,7 @@
+ rm -rf $TOP_DIR/usr/share/locale/$dir
+ fi
+done
+find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do
+test -d "$TOP_DIR/usr/share/help/" && find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | egrep -q "/usr/share/help/$dir"$; then
+ echo "removing help translation /usr/share/help/$dir"
+ rm -rf $TOP_DIR/usr/share/help/$dir

15
rofs.diff Normal file
View File

@ -0,0 +1,15 @@
Don't bother retrying locking on read-only filesystem (RhBug:1502134)
upstream commit f25752a8cd6b161f3002dc7839242872ecb59547
--- ./lib/rpmlock.c.orig 2017-08-10 08:08:07.122108699 +0000
+++ ./lib/rpmlock.c 2017-12-05 12:02:26.248459858 +0000
@@ -30,7 +30,8 @@ static rpmlock rpmlock_new(const char *l
(void) umask(oldmask);
if (lock->fd == -1) {
- lock->fd = open(lock_path, O_RDONLY);
+ if (errno != EROFS)
+ lock->fd = open(lock_path, O_RDONLY);
if (lock->fd == -1) {
free(lock);
lock = NULL;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:27fc7ba7d419622b1ce34d6507aa70b0808bc344021d298072a0c2ec165f9b0d
size 4305261

3
rpm-4.14.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:06a0ad54600d3c42e42e02701697a8857dc4b639f6476edefffa714d9f496314
size 4085209

View File

@ -1,6 +1,6 @@
--- ./macros.in.orig 2014-08-04 13:03:05.948860909 +0000
+++ ./macros.in 2014-08-04 13:03:24.830775270 +0000
@@ -885,7 +885,8 @@ posix.setenv("RPMBUILD_SOURCEDIR",rpm.ex
--- ./macros.in.orig 2017-12-01 15:50:47.587969729 +0000
+++ ./macros.in 2017-12-01 15:50:53.813951691 +0000
@@ -1039,7 +1039,8 @@ package or when debugging this package.\
--localstatedir=%{_localstatedir} \\\
--sharedstatedir=%{_sharedstatedir} \\\
--mandir=%{_mandir} \\\
@ -9,4 +9,4 @@
+ --disable-dependency-tracking
#------------------------------------------------------------------------------
# The "make" analogue, hiding the _smp_mflags magic from specs
# Tested features of make

View File

@ -1,6 +1,6 @@
--- ./build/pack.c.orig 2013-06-10 15:55:10.000000000 +0000
+++ ./build/pack.c 2013-07-12 11:59:37.000000000 +0000
@@ -540,6 +540,63 @@ static rpmRC checkPackages(char *pkgchec
--- ./build/pack.c.orig 2017-10-11 12:39:53.009897937 +0000
+++ ./build/pack.c 2017-12-04 16:02:29.299440578 +0000
@@ -641,6 +641,71 @@ static rpmRC checkPackages(char *pkgchec
return RPMRC_OK;
}
@ -8,9 +8,9 @@
+{
+ static int oneshot;
+ static int cuttime, minnum, maxnum;
+ int * times;
+ char ** names = 0, ** texts = 0;
+ int i, keep, count = 0;
+ rpm_count_t i, keep;
+ struct rpmtd_s timestd, namestd, textstd;
+ rpm_count_t count;
+
+ if (!oneshot) {
+ char *binarychangelogtrim = rpmExpand("%{?_binarychangelogtrim}", NULL);
@ -35,9 +35,12 @@
+ if (!cuttime && !minnum && !maxnum) {
+ return;
+ }
+ if (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) &times, &count))
+
+ if (!headerGet(h, RPMTAG_CHANGELOGTIME, &timestd, HEADERGET_MINMEM))
+ return;
+ count = rpmtdCount(&timestd);
+ if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) {
+ rpmtdFreeData(&timestd);
+ return;
+ }
+ keep = count;
@ -45,26 +48,31 @@
+ keep = maxnum;
+ if (cuttime) {
+ for (i = 0; i < keep; i++) {
+ if (i >= minnum && times[i] < cuttime)
+ uint32_t *tp = rpmtdNextUint32(&timestd);
+ if (i >= minnum && tp && *tp < cuttime)
+ break;
+ }
+ keep = i;
+ }
+ if (keep >= count)
+ if (keep >= count) {
+ rpmtdFreeData(&timestd);
+ return;
+ headerGetEntry(h, RPMTAG_CHANGELOGNAME, NULL, (void **) &names, &count);
+ headerGetEntry(h, RPMTAG_CHANGELOGTEXT, NULL, (void **) &texts, &count);
+ headerModifyEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, times, keep);
+ headerModifyEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, names, keep);
+ headerModifyEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, texts, keep);
+ free(names);
+ free(texts);
+ }
+ headerGet(h, RPMTAG_CHANGELOGNAME, &namestd, HEADERGET_MINMEM);
+ headerGet(h, RPMTAG_CHANGELOGTEXT, &textstd, HEADERGET_MINMEM);
+ timestd.count = namestd.count = textstd.count = keep;
+ headerMod(h, &timestd);
+ headerMod(h, &namestd);
+ headerMod(h, &textstd);
+ rpmtdFreeData(&textstd);
+ rpmtdFreeData(&namestd);
+ rpmtdFreeData(&timestd);
+}
+
rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
{
rpmRC rc;
@@ -547,6 +604,7 @@ rpmRC packageBinaries(rpmSpec spec, cons
@@ -648,6 +713,7 @@ rpmRC packageBinaries(rpmSpec spec, cons
Package pkg;
char *pkglist = NULL;
@ -72,9 +80,9 @@
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
char *fn;
--- ./build/parseChangelog.c.orig 2012-11-18 08:21:06.000000000 +0000
+++ ./build/parseChangelog.c 2013-07-12 11:59:37.000000000 +0000
@@ -183,6 +183,11 @@ static rpmRC addChangelog(Header h, ARGV
--- ./build/parseChangelog.c.orig 2017-10-05 10:04:56.859602170 +0000
+++ ./build/parseChangelog.c 2017-12-04 14:47:41.249346774 +0000
@@ -255,6 +255,11 @@ static rpmRC addChangelog(Header h, ARGV
goto exit;
}

View File

@ -1,3 +1,69 @@
-------------------------------------------------------------------
Fri Jan 5 13:26:50 CET 2018 - mls@suse.de
- fix signature header writing if the archive size is bigger
than 2 GByte
new patch: bigarchive.diff
-------------------------------------------------------------------
Tue Jan 2 11:04:52 CET 2018 - mls@suse.de
- remove shebang from pythondistdeps.py
new patch: pythondistdeps.diff
-------------------------------------------------------------------
Tue Dec 19 09:39:25 UTC 2017 - jengelh@inai.de
- Update RPM groups
-------------------------------------------------------------------
Fri Dec 15 13:18:39 CET 2017 - mls@suse.de
- patch debugedit so that it also handles the .debug.macro section
new patch: debugedit-macro.diff
-------------------------------------------------------------------
Thu Dec 7 17:02:52 CET 2017 - mls@suse.de
- switch build id generation to "alldebug" mode
-------------------------------------------------------------------
Mon Dec 4 18:35:41 UTC 2017 - kukuk@suse.com
- Replace PreReq fillup with Requires(post), so that we can
deinstall it later if we don't need it anymore
-------------------------------------------------------------------
Fri Dec 1 17:15:13 CET 2017 - mls@suse.de
- update to rpm-4.14.0
* new with/without/unless rich dependencies
* multifile optimized debuginfo packages
* much improved macro engine
- dropped patches:
* 0001-set-SOURCE_DATE_EPOCH-from-changelog.patch
* 0002-Extend-changelog-to-support-full-timestamps-903.patch
* 0003-Allow-SOURCE_DATE_EPOCH-to-override-file-timestamps.patch
* 0004-Allow-SOURCE_DATE_EPOCH-to-override-RPMTAG_BUILDTIME.patch
* buildidprov.diff
* changes-doc.diff
* convertdb1static.diff
* debugedit-canon-fix.diff
* debugedit-comp-dir.diff
* debugsource-package.diff
* find-lang-python.patch
* nobfd.diff
* normalize_blocksize.diff
* perlprov-package.diff
* perlprov.diff
* python3-abi-kind.diff
* rpmrctests.diff
- new patches (backports from master):
* editdwarf.diff
* rofs.diff
* transfiletriggerpostun.diff
* hardlink.diff
-------------------------------------------------------------------
Thu Nov 23 13:41:13 UTC 2017 - rbrown@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package rpm
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,9 +17,7 @@
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
%{?!_fillupdir:%define _fillupdir /var/adm/fillup-templates}
Name: rpm
BuildRequires: binutils
@ -33,6 +31,7 @@ BuildRequires: gzip
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libdw-devel
BuildRequires: libelf-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
@ -48,13 +47,13 @@ BuildRequires: xz-devel
BuildRequires: zlib-devel
#!BuildIgnore: rpmlint-Factory
Provides: rpminst
PreReq: %fillup_prereq
Requires(post): %fillup_prereq
Summary: The RPM Package Manager
License: GPL-2.0+
Group: System/Packages
Version: 4.13.0.1
Version: 4.14.0
Release: 0
Source: http://ftp.rpm.org/releases/rpm-4.13.x/rpm-%{version}.tar.bz2
Source: http://ftp.rpm.org/releases/rpm-4.14.x/rpm-%{version}.tar.bz2
Source1: RPM-HOWTO.tar.bz2
Source4: rpm-suse_macros
Source5: rpmsort
@ -78,7 +77,6 @@ Patch15: dbfsync.diff
Patch16: dbrointerruptable.diff
Patch17: extcond.diff
Patch18: refreshtestarch.diff
Patch19: rpmrctests.diff
Patch20: waitlock.diff
Patch21: suspendlock.diff
Patch24: brp.diff
@ -94,22 +92,16 @@ Patch33: rpmpopt.diff
Patch34: rpmrc.diff
Patch35: taggedfileindex.diff
Patch36: rpmqpack.diff
Patch37: convertdb1static.diff
Patch38: build.diff
Patch41: debugedit-comp-dir.diff
Patch42: perlprov.diff
Patch43: rpm-shorten-changelog.diff
Patch44: debugsource-package.diff
Patch45: whatrequires-doc.diff
Patch46: remove-brp-strips.diff
Patch47: requires-ge-macro.diff
Patch48: debugedit-canon-fix.diff
Patch49: finddebuginfo-absolute-links.diff
Patch50: firmware.diff
Patch51: specfilemacro.diff
Patch52: modalias-encode.diff
Patch53: disttag-macro.diff
Patch54: buildidprov.diff
Patch55: debugsubpkg.diff
Patch56: debuglink.diff
Patch57: debuginfo-mono.patch
@ -126,29 +118,22 @@ Patch71: nomagiccheck.diff
Patch73: assumeexec.diff
Patch74: mono-find-requires.diff
Patch75: rpm-deptracking.patch
Patch76: python3-abi-kind.diff
Patch77: langnoc.diff
Patch78: headerchk2.diff
# PATCH-FEATURE-UPSTREAM 4.14 0e87aed1785d0531c40b23889f8338744f6abb3a
Patch80: 0001-set-SOURCE_DATE_EPOCH-from-changelog.patch
# PATCH-FEATURE-UPSTREAM 4.14 57f94a582602f0353cdb17a02dc12c4461d4f32d
Patch81: 0002-Extend-changelog-to-support-full-timestamps-903.patch
# PATCH-FEATURE-UPSTREAM 4.14 8d84878ee05b2e63858af3a5a49d98e9e2933b1b
Patch82: 0003-Allow-SOURCE_DATE_EPOCH-to-override-file-timestamps.patch
# PATCH-FEATURE-UPSTREAM 4.14 b8a54d6a1e9bb6140b6b47e23dc707e4b967537e
Patch83: 0004-Allow-SOURCE_DATE_EPOCH-to-override-RPMTAG_BUILDTIME.patch
Patch85: brp-compress-no-img.patch
Patch92: find-lang-python.patch
Patch93: weakdepscompat.diff
Patch94: checksepwarn.diff
Patch98: normalize_blocksize.diff
Patch99: enable-postin-scripts-error.diff
Patch100: rpm-findlang-inject-metainfo.patch
Patch101: nobfd.diff
Patch102: emptymanifest.diff
Patch103: find-lang-qt-qm.patch
Patch104: perlprov-package.diff
Patch105: changes-doc.diff
Patch104: editdwarf.diff
Patch105: rofs.diff
Patch106: transfiletriggerpostun.diff
Patch107: hardlink.diff
Patch108: debugedit-macro.diff
Patch109: pythondistdeps.diff
Patch110: bigarchive.diff
Patch6464: auto-config-update-aarch64-ppc64le.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
@ -165,8 +150,8 @@ in a central database. This way it is possible to get an overview of
all installed packages. RPM also supports database queries.
%package devel
Summary: Include Files and Libraries mandatory for Development
Group: System/Packages
Summary: Development files for librpm
Group: Development/Libraries/C and C++
Requires: rpm = %{version}
# for people confusing the one with the other
Recommends: rpm-build = %{version}
@ -235,16 +220,17 @@ rm -f rpmdb/db.h
%patch3 -p1
%patch -P 4
%patch5 -p1
%patch -P 11 -P 12 -P 13 -P 14 -P 15 -P 16 -P 17 -P 18 -P 19
%patch -P 11 -P 12 -P 13 -P 14 -P 15 -P 16 -P 17 -P 18
%patch -P 20 -P 21 -P 24 -P 25 -P 26 -P 27 -P 28 -P 29
%patch -P 30 -P 31 -P 32 -P 33 -P 34 -P 35 -P 36 -P 37 -P 38
%patch -P 41 -P 42 -P 43 -P 44 -P 45 -P 46 -P 47 -P 48 -P 49
%patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58
%patch -P 30 -P 31 -P 32 -P 33 -P 34 -P 35 -P 36 -P 38
%patch -P 43 -P 45 -P 46 -P 47 -P 49
%patch -P 50 -P 51 -P 52 -P 53 -P 55 -P 56 -P 57 -P 58
%patch -P 60 -P 61 -P 65 -P 66 -P 67 -P 68 -P 69
%patch -P 70 -P 71 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78
%patch -P 80 -P 81 -P 82 -P 83 -P 85
%patch -P 92 -P 93 -P 94 -P 98 -P 99
%patch -P 100 -P 101 -P 102 -P 103 -P 104 -P 105
%patch -P 70 -P 71 -P 73 -P 74 -P 75 -P 77 -P 78
%patch -P 85
%patch -P 93 -P 94 -P 99
%patch -P 100 -P 102 -P 103 -P 104 -P 105 -P 106 -P 107 -P 108
%patch -P 109 -P 110
%ifarch aarch64 ppc64le
%patch6464
@ -288,11 +274,10 @@ pushd beecrypt
make %{?_smp_mflags}
popd
export PYTHON=python%{with_python}
autoreconf -fi
sed -i -e 's,{PYTHON_VERSION}mu,{PYTHON_VERSION}mu python${PYTHON_VERSION}m,' configure
./configure --disable-dependency-tracking --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
--libdir=%{_libdir} --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --with-lua \
--without-external-db \
--with-vendor=suse \
--with-rundir=/run \
--without-archive \
@ -301,14 +286,14 @@ sed -i -e 's,{PYTHON_VERSION}mu,{PYTHON_VERSION}mu python${PYTHON_VERSION}m,' co
rm po/de.gmo
make %{?_smp_mflags}
make convertdb1
%install
mkdir -p %{buildroot}/usr/lib
mkdir -p %{buildroot}/usr/share/locale
ln -s ../share/locale %{buildroot}/usr/lib/locale
%make_install
install -m 755 convertdb1 %{buildroot}/usr/lib/rpm
mkdir -p %{buildroot}/bin
ln -s /usr/bin/rpm %{buildroot}/bin/rpm
install -m 644 db3/db.h %{buildroot}/usr/include/rpm
# remove .la file and the static variant of libpopt
# have to remove the dependency from other .la files as well
@ -374,7 +359,6 @@ popd
install -m 755 config.guess %{buildroot}/usr/lib/rpm
install -m 755 config.sub %{buildroot}/usr/lib/rpm
%endif
gzip -9 CHANGES
rm -rf %{buildroot}/%{_libdir}/python%{py_ver}
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/rpm-plugins/*.la
@ -400,12 +384,6 @@ test -f usr/lib/sysimage/rpm/Packages || rpmdb --initdb
%posttrans
# var/lib/rpm migration
if test ! -L var/lib/rpm ; then
if test -s var/lib/rpm/packages.rpm ; then
echo "converting rpm-3 database to rpm-4 format..."
usr/lib/rpm/convertdb1 var/lib/rpm/packages.rpm
mv -f var/lib/rpm/packages.rpm var/lib/rpm/packages.rpm3
rm -f var/lib/rpm/conflictsindex.rpm var/lib/rpm/fileindex.rpm var/lib/rpm/groupindex.rpm var/lib/rpm/nameindex.rpm var/lib/rpm/providesindex.rpm var/lib/rpm/requiredby.rpm var/lib/rpm/triggerindex.rpm
fi
# delete no longer maintained databases
rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion var/lib/rpm/Provideversion
@ -426,7 +404,7 @@ fi
%files -f rpm.lang
%defattr(-,root,root)
%doc CHANGES.gz COPYING GROUPS
%doc COPYING
%doc doc/manual
%doc RPM-HOWTO
/etc/rpm

View File

@ -1,6 +1,6 @@
--- ./rpmpopt.in.orig 2017-02-16 09:40:09.969649413 +0000
+++ ./rpmpopt.in 2017-07-05 14:13:49.599735022 +0000
@@ -100,12 +100,16 @@ Relocations : %|PREFIXES?{[%{PREFIXES} ]
--- ./rpmpopt.in.orig 2017-12-01 14:58:11.404041985 +0000
+++ ./rpmpopt.in 2017-12-01 14:59:06.275882759 +0000
@@ -101,7 +101,8 @@ Relocations : %|PREFIXES?{[%{PREFIXES} ]
%|URL?{URL : %{URL}\n}|\
%|BUGURL?{Bug URL : %{BUGURL}\n}|\
Summary : %{SUMMARY}\n\
@ -10,11 +10,3 @@
--POPTdesc=$"list descriptive information from package(s)"
rpm alias --changelog --qf '[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]' \
--POPTdesc=$"list change logs for this package"
+rpm alias --changes --qf '[* %{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]' \
+ --POPTdesc=$"list changes for this package with full time stamps"
+
rpm alias --xml --qf '[%{*:xml}\n]' \
--POPTdesc=$"list metadata in xml"

View File

@ -1,9 +1,6 @@
Provide rpmqpack, a fast way to list all installed packages are
check if some package is installed. This is a hack.
--- ./Makefile.am.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:15:27.000000000 +0000
@@ -170,6 +170,10 @@ rpmgraph_LDADD = lib/librpm.la rpmio/lib
--- ./Makefile.am.orig 2017-12-01 15:04:09.723014378 +0000
+++ ./Makefile.am 2017-12-01 15:04:13.396003910 +0000
@@ -187,6 +187,10 @@ rpmgraph_LDADD = lib/librpm.la rpmio/lib
dist_bin_SCRIPTS = scripts/gendiff
@ -14,19 +11,19 @@ check if some package is installed. This is a hack.
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
--- ./doc/Makefile.am.orig 2011-01-05 08:11:09.000000000 +0000
+++ ./doc/Makefile.am 2011-05-11 15:16:24.000000000 +0000
--- ./doc/Makefile.am.orig 2017-12-01 15:04:13.397003907 +0000
+++ ./doc/Makefile.am 2017-12-01 15:04:42.681920389 +0000
@@ -8,7 +8,7 @@ EXTRA_DIST += $(man_man1_DATA)
man_man8dir = $(mandir)/man8
man_man8_DATA = rpm.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8
man_man8_DATA = rpm.8 rpm-misc.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8
-man_man8_DATA += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8
+man_man8_DATA += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8 rpmqpack.8
man_man8_DATA += rpm-plugin-systemd-inhibit.8
EXTRA_DIST += $(man_man8_DATA)
man_fr_man8dir = $(mandir)/fr/man8
--- ./doc/rpmqpack.8.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./doc/rpmqpack.8 2011-05-11 15:15:27.000000000 +0000
--- ./doc/rpmqpack.8.orig 2017-12-01 15:04:13.397003907 +0000
+++ ./doc/rpmqpack.8 2017-12-01 15:04:13.397003907 +0000
@@ -0,0 +1,25 @@
+.TH RPMQPACK 8 "Mar 2002"
+.SH NAME
@ -53,8 +50,8 @@ check if some package is installed. This is a hack.
+
+.SH AUTHOR
+Michael Schroeder <mls@suse.de>
--- ./rpmqpack.c.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./rpmqpack.c 2011-05-11 15:15:27.000000000 +0000
--- ./rpmqpack.c.orig 2017-12-01 15:04:13.398003904 +0000
+++ ./rpmqpack.c 2017-12-01 15:04:13.398003904 +0000
@@ -0,0 +1,59 @@
+#include <sys/types.h>
+#include <limits.h>

View File

@ -1,5 +1,5 @@
--- ./rpmrc.in.orig 2016-10-21 09:44:00.345962071 +0000
+++ ./rpmrc.in 2017-01-19 12:52:53.018348891 +0000
--- ./rpmrc.in.orig 2017-10-05 10:04:57.571602038 +0000
+++ ./rpmrc.in 2017-12-01 15:03:23.956144776 +0000
@@ -12,16 +12,16 @@
# "fat" binary with both archs, for Darwin
optflags: fat -O2 -g -arch i386 -arch ppc
@ -54,7 +54,7 @@
optflags: hppa1.0 -O2 -g -mpa-risc-1-0
optflags: hppa1.1 -O2 -g -mpa-risc-1-0
optflags: hppa1.2 -O2 -g -mpa-risc-1-0
@@ -74,10 +75,10 @@ optflags: armv4tl -O2 -g -march=armv4t
@@ -75,10 +76,10 @@ optflags: armv5tl -O2 -g -march=armv5t
optflags: armv5tel -O2 -g -march=armv5te
optflags: armv5tejl -O2 -g -march=armv5te
optflags: armv6l -O2 -g -march=armv6
@ -67,7 +67,7 @@
optflags: armv7hnl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=neon
optflags: m68k -O2 -g -fomit-frame-pointer
@@ -90,8 +91,8 @@ optflags: atariclone -O2 -g -fomit-frame
@@ -91,8 +92,8 @@ optflags: atariclone -O2 -g -fomit-frame
optflags: milan -O2 -g -fomit-frame-pointer
optflags: hades -O2 -g -fomit-frame-pointer
@ -78,7 +78,7 @@
optflags: sh3 -O2 -g
optflags: sh4 -O2 -g -mieee
@@ -286,17 +287,17 @@ os_canon: MacOSX: macosx 21
@@ -288,17 +289,17 @@ os_canon: MacOSX: macosx 21
#############################################################
# For a given uname().machine, the default build arch
@ -104,7 +104,7 @@
buildarchtranslate: i486: i386
buildarchtranslate: i386: i386
@@ -318,6 +319,7 @@ buildarchtranslate: sparc64v: sparc64
@@ -320,6 +321,7 @@ buildarchtranslate: sparc64v: sparc64
buildarchtranslate: osfmach3_ppc: ppc
buildarchtranslate: powerpc: ppc
buildarchtranslate: powerppc: ppc
@ -112,7 +112,7 @@
buildarchtranslate: ppc8260: ppc
buildarchtranslate: ppc8560: ppc
buildarchtranslate: ppc32dy4: ppc
@@ -378,6 +380,15 @@ buildarchtranslate: aarch64: aarch64
@@ -381,6 +383,15 @@ buildarchtranslate: aarch64: aarch64
buildarchtranslate: riscv: riscv64
buildarchtranslate: riscv64: riscv64
@ -128,7 +128,7 @@
#############################################################
# Architecture compatibility
@@ -442,14 +453,20 @@ arch_compat: mips64r6el: mipsr6el
@@ -445,15 +456,21 @@ arch_compat: mips64r6el: mipsr6el
arch_compat: hppa2.0: hppa1.2
arch_compat: hppa1.2: hppa1.1
arch_compat: hppa1.1: hppa1.0
@ -142,16 +142,17 @@
arch_compat: armv4b: noarch
+arch_compat: armv7hl: armv7l
arch_compat: armv7l: armv6l
arch_compat: armv6l: armv5tejl
+arch_compat: armv6hl: armv6l
arch_compat: armv6l: armv5tejl
arch_compat: armv5tejl: armv5tel
-arch_compat: armv5tel: armv4tl
+arch_compat: armv5tel: armv5l
arch_compat: armv5tel: armv5tl
-arch_compat: armv5tl: armv4tl
+arch_compat: armv5tl: armv5l
+arch_compat: armv5l: armv4tl
arch_compat: armv4tl: armv4l
arch_compat: armv4l: armv3l
arch_compat: armv3l: noarch
@@ -471,7 +488,7 @@ arch_compat: i370: noarch
@@ -475,7 +492,7 @@ arch_compat: i370: noarch
arch_compat: s390: noarch
arch_compat: s390x: s390 noarch
@ -160,7 +161,7 @@
arch_compat: x86_64: amd64 em64t athlon noarch
arch_compat: amd64: x86_64 em64t athlon noarch
@@ -574,7 +591,9 @@ buildarch_compat: mips64r6: noarch
@@ -578,7 +595,9 @@ buildarch_compat: mips64r6: noarch
buildarch_compat: mips64r6el: noarch
buildarch_compat: armv4b: noarch
@ -168,9 +169,9 @@
buildarch_compat: armv7l: armv6l
+buildarch_compat: armv6hl: armv6l
buildarch_compat: armv6l: armv5tejl
buildarch_compat: armv5tejl: armv5tel
buildarch_compat: armv5tel: armv4tl
@@ -589,7 +608,8 @@ buildarch_compat: armv6hl: noarch
buildarch_compat: armv5tejl: armv5tel armv5tl
buildarch_compat: armv5tel: armv4tl armv5tl
@@ -594,7 +613,8 @@ buildarch_compat: armv6hl: noarch
buildarch_compat: hppa2.0: hppa1.2
buildarch_compat: hppa1.2: hppa1.1
buildarch_compat: hppa1.1: hppa1.0

View File

@ -1,32 +0,0 @@
Patch machine detection code: detect transmeta, rename parisc to hppa. [#52713]
--- ./lib/rpmrc.c.orig 2017-01-19 10:38:55.294687058 +0000
+++ ./lib/rpmrc.c 2017-01-19 10:39:13.697626840 +0000
@@ -817,6 +817,14 @@ static inline int RPMClass(void)
cpu = (tfms>>8)&15;
+ if (cpu == 5
+ && cpuid_ecx(0) == '68xM'
+ && cpuid_edx(0) == 'Teni'
+ && (cpuid_edx(1) & ((1<<8)|(1<<15))) == ((1<<8)|(1<<15))) {
+ sigaction(SIGILL, &oldsa, NULL);
+ return 6; /* has CX8 and CMOV */
+ }
+
sigaction(SIGILL, &oldsa, NULL);
#define USER686 ((1<<4) | (1<<8) | (1<<15))
@@ -1101,6 +1109,12 @@ static void defaultMachine(rpmrcCtx ctx,
# endif
# endif
+#if defined(__linux__)
+ /* in linux, lets rename parisc to hppa */
+ if (rstreq(un.machine, "parisc"))
+ strcpy(un.machine, "hppa");
+#endif
+
# if defined(__hpux) && defined(_SC_CPU_VERSION)
{
# if !defined(CPU_PA_RISC1_2)

View File

@ -2,9 +2,9 @@ Suspend exclusive database lock when scriptlets get called, allowing
read access in scriptlets. Only needed for DB_PRIVATE (aka global)
locking.
--- ./lib/backend/db3.c.orig 2017-01-19 15:31:32.166569447 +0000
+++ ./lib/backend/db3.c 2017-01-19 15:32:29.239335811 +0000
@@ -541,6 +541,46 @@ static void db3_dbSetFSync(rpmdb rdb, in
--- ./lib/backend/db3.c.orig 2017-12-01 14:27:03.193486711 +0000
+++ ./lib/backend/db3.c 2017-12-01 14:27:23.747426200 +0000
@@ -552,6 +552,46 @@ static void db3_dbSetFSync(rpmdb rdb, in
static int db3_Ctrl(rpmdb rdb, dbCtrlOp ctrl)
{
@ -51,8 +51,8 @@ locking.
return 0;
}
--- ./lib/backend/dbi.h.orig 2017-01-19 15:31:32.166569447 +0000
+++ ./lib/backend/dbi.h 2017-01-19 15:31:34.816559478 +0000
--- ./lib/backend/dbi.h.orig 2017-12-01 14:27:03.193486711 +0000
+++ ./lib/backend/dbi.h 2017-12-01 14:27:23.747426200 +0000
@@ -17,7 +17,9 @@ typedef enum dbCtrlOp_e {
DB_CTRL_UNLOCK_RO = 2,
DB_CTRL_LOCK_RW = 3,
@ -64,9 +64,9 @@ locking.
} dbCtrlOp;
typedef struct dbiIndex_s * dbiIndex;
--- ./lib/rpmdb.c.orig 2017-01-19 15:31:32.162569461 +0000
+++ ./lib/rpmdb.c 2017-01-19 15:31:34.817559474 +0000
@@ -2706,6 +2706,12 @@ int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl
--- ./lib/rpmdb.c.orig 2017-12-01 14:27:03.190486720 +0000
+++ ./lib/rpmdb.c 2017-12-01 14:27:23.748426197 +0000
@@ -2639,6 +2639,12 @@ int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl
case RPMDB_CTRL_INDEXSYNC:
dbctrl = DB_CTRL_INDEXSYNC;
break;
@ -79,8 +79,8 @@ locking.
}
return dbctrl ? dbCtrl(db, dbctrl) : 1;
}
--- ./lib/rpmdb.h.orig 2016-10-03 08:08:36.582686286 +0000
+++ ./lib/rpmdb.h 2017-01-19 15:31:34.818559471 +0000
--- ./lib/rpmdb.h.orig 2017-10-05 10:04:57.035602138 +0000
+++ ./lib/rpmdb.h 2017-12-01 14:27:23.748426197 +0000
@@ -35,7 +35,9 @@ typedef enum rpmdbCtrlOp_e {
RPMDB_CTRL_UNLOCK_RO = 2,
RPMDB_CTRL_LOCK_RW = 3,
@ -92,15 +92,17 @@ locking.
} rpmdbCtrlOp;
/** \ingroup rpmdb
--- ./lib/transaction.c.orig 2016-10-21 09:44:00.309962086 +0000
+++ ./lib/transaction.c 2017-01-19 15:31:34.818559471 +0000
@@ -1425,15 +1425,18 @@ rpmRC runScript(rpmts ts, rpmte te, ARGV
--- ./lib/transaction.c.orig 2017-12-01 14:27:23.750426192 +0000
+++ ./lib/transaction.c 2017-12-01 14:28:43.232192224 +0000
@@ -1457,6 +1457,7 @@ rpmRC runScript(rpmts ts, rpmte te, Head
stag != RPMTAG_PREUN &&
stag != RPMTAG_PRETRANS &&
stag != RPMTAG_VERIFYSCRIPT);
+ rpmdb rdb = rpmtsGetRdb(ts);
sfd = rpmtsNotify(ts, te, RPMCALLBACK_SCRIPT_START, stag, 0);
/* Fake up a transaction element for triggers from rpmdb */
if (te == NULL) {
@@ -1468,10 +1469,12 @@ rpmRC runScript(rpmts ts, rpmte te, Head
if (sfd == NULL)
sfd = rpmtsScriptFd(ts);

View File

@ -0,0 +1,21 @@
Fix not all %transfiletriggerpostun triggers executing (RhBug:1514085)
upstream commit db1b99db2543b2c2526a2e116daeffa0498d5de4
--- ./lib/rpmtriggers.c.orig 2017-10-05 10:04:57.121602122 +0000
+++ ./lib/rpmtriggers.c 2017-12-05 12:04:35.448096904 +0000
@@ -106,7 +106,6 @@ void rpmtriggersPrepPostUnTransFileTrigs
rpmfiles files;
rpmds rpmdsTriggers;
rpmds rpmdsTrigger;
- int tix = 0;
ii = rpmdbIndexIteratorInit(rpmtsGetRdb(ts), RPMDBI_TRANSFILETRIGGERNAME);
mi = rpmdbNewIterator(rpmtsGetRdb(ts), RPMDBI_PACKAGES);
@@ -131,6 +130,7 @@ void rpmtriggersPrepPostUnTransFileTrigs
if (rpmdbGetIteratorCount(mi)) {
/* Filter triggers and save only trans postun triggers into ts */
while ((trigH = rpmdbNextIterator(mi)) != NULL) {
+ int tix = 0;
rpmdsTriggers = rpmdsNew(trigH, RPMTAG_TRANSFILETRIGGERNAME, 0);
while ((rpmdsTrigger = rpmdsFilterTi(rpmdsTriggers, tix))) {
if ((rpmdsNext(rpmdsTrigger) >= 0) &&