- update to rpm-4.15.0
OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=507
This commit is contained in:
parent
557a983daa
commit
dc6592c036
@ -1,275 +0,0 @@
|
||||
From 5bc138a7663e471edad24cc662366bc743d3d3e0 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Fri, 10 May 2019 13:10:00 +0300
|
||||
Subject: [PATCH 1/2] Stop papering over the security disaster known as prelink
|
||||
|
||||
Back in the turn of the century somebody thought it was a neat idea
|
||||
to completely compromise system security to improve program start-up
|
||||
start-up times a wee bit. Since then, people have thankfully started
|
||||
coming to their senses and removed prelink from distros entirely.
|
||||
|
||||
Lets stop papering over the security disaster: we obviously cannot
|
||||
stop people from using prelink, but instead of trying to undo the
|
||||
damage for verification purposes, we'll now report such a system as
|
||||
compromised. Which is how it should be, IMNSHO.
|
||||
|
||||
This eliminates a whole lot of extra junk from each and every file
|
||||
digest calculation that we do, so it might even show up on somebodys
|
||||
performance charts. It also gets rid of libelf dependency outside
|
||||
librpmbuild, which is a nice little bonus.
|
||||
|
||||
Inspired by a patch to eliminate a rendundant double open of regular
|
||||
files in rpmDoDigest() from Denys Vlasenko, taken a little further...
|
||||
---
|
||||
macros.in | 10 ---
|
||||
rpmio/Makefile.am | 1 -
|
||||
rpmio/rpmfileutil.c | 176 +++-----------------------------------------
|
||||
3 files changed, 9 insertions(+), 178 deletions(-)
|
||||
|
||||
diff --git a/macros.in b/macros.in
|
||||
index a6069ee4d..32c453479 100644
|
||||
--- a/macros.in
|
||||
+++ b/macros.in
|
||||
@@ -685,16 +685,6 @@ package or when debugging this package.\
|
||||
# gpg --batch --no-verbose --verify --no-secmem-warning \
|
||||
# %{__signature_filename} %{__plaintext_filename}
|
||||
#
|
||||
-# XXX rpm-4.1 verifies prelinked libraries using a prelink undo helper.
|
||||
-# Normally this macro is defined in /etc/rpm/macros.prelink, installed
|
||||
-# with the prelink package. If the macro is undefined, then prelinked
|
||||
-# shared libraries contents are MD5 digest verified (as usual), rather
|
||||
-# than MD5 verifying the output of the prelink undo helper.
|
||||
-#
|
||||
-# Note: The 2nd token is used as argv[0] and "library" is a
|
||||
-# placeholder that will be deleted and replaced with the appropriate
|
||||
-# library file path.
|
||||
-#%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
|
||||
|
||||
# Horowitz Key Protocol server configuration
|
||||
#
|
||||
diff --git a/rpmio/Makefile.am b/rpmio/Makefile.am
|
||||
index 6024ae4e2..cedd784de 100644
|
||||
--- a/rpmio/Makefile.am
|
||||
+++ b/rpmio/Makefile.am
|
||||
@@ -42,7 +42,6 @@ librpmio_la_LIBADD = \
|
||||
@WITH_OPENSSL_LIB@ \
|
||||
@WITH_BZ2_LIB@ \
|
||||
@WITH_ZLIB_LIB@ \
|
||||
- @WITH_LIBELF_LIB@ \
|
||||
@WITH_POPT_LIB@ \
|
||||
@WITH_LZMA_LIB@ \
|
||||
$(ZSTD_LIBS) \
|
||||
diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c
|
||||
index 98f19e8a6..4349c64a7 100644
|
||||
--- a/rpmio/rpmfileutil.c
|
||||
+++ b/rpmio/rpmfileutil.c
|
||||
@@ -1,18 +1,5 @@
|
||||
#include "system.h"
|
||||
|
||||
-#if HAVE_GELF_H
|
||||
-
|
||||
-#include <gelf.h>
|
||||
-
|
||||
-#if !defined(DT_GNU_PRELINKED)
|
||||
-#define DT_GNU_PRELINKED 0x6ffffdf5
|
||||
-#endif
|
||||
-#if !defined(DT_GNU_LIBLIST)
|
||||
-#define DT_GNU_LIBLIST 0x6ffffef9
|
||||
-#endif
|
||||
-
|
||||
-#endif
|
||||
-
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
@@ -34,178 +21,33 @@
|
||||
static const char *rpm_config_dir = NULL;
|
||||
static pthread_once_t configDirSet = PTHREAD_ONCE_INIT;
|
||||
|
||||
-static int is_prelinked(int fdno)
|
||||
-{
|
||||
- int prelinked = 0;
|
||||
-#if HAVE_GELF_H && HAVE_LIBELF
|
||||
- Elf *elf = NULL;
|
||||
- Elf_Scn *scn = NULL;
|
||||
- Elf_Data *data = NULL;
|
||||
- GElf_Ehdr ehdr;
|
||||
- GElf_Shdr shdr;
|
||||
- GElf_Dyn dyn;
|
||||
-
|
||||
- (void) elf_version(EV_CURRENT);
|
||||
-
|
||||
- if ((elf = elf_begin (fdno, ELF_C_READ, NULL)) == NULL ||
|
||||
- elf_kind(elf) != ELF_K_ELF || gelf_getehdr(elf, &ehdr) == NULL ||
|
||||
- !(ehdr.e_type == ET_DYN || ehdr.e_type == ET_EXEC))
|
||||
- goto exit;
|
||||
-
|
||||
- while (!prelinked && (scn = elf_nextscn(elf, scn)) != NULL) {
|
||||
- (void) gelf_getshdr(scn, &shdr);
|
||||
- if (shdr.sh_type != SHT_DYNAMIC || shdr.sh_entsize == 0)
|
||||
- continue;
|
||||
- while (!prelinked && (data = elf_getdata (scn, data)) != NULL) {
|
||||
- int maxndx = data->d_size / shdr.sh_entsize;
|
||||
-
|
||||
- for (int ndx = 0; ndx < maxndx; ++ndx) {
|
||||
- (void) gelf_getdyn (data, ndx, &dyn);
|
||||
- if (!(dyn.d_tag == DT_GNU_PRELINKED || dyn.d_tag == DT_GNU_LIBLIST))
|
||||
- continue;
|
||||
- prelinked = 1;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
-exit:
|
||||
- if (elf) (void) elf_end(elf);
|
||||
-#endif
|
||||
- return prelinked;
|
||||
-}
|
||||
-
|
||||
-static int open_dso(const char * path, pid_t * pidp, rpm_loff_t *fsizep)
|
||||
-{
|
||||
- static const char * cmd = NULL;
|
||||
- static int initted = 0;
|
||||
- int fdno;
|
||||
-
|
||||
- if (!initted) {
|
||||
- cmd = rpmExpand("%{?__prelink_undo_cmd}", NULL);
|
||||
- initted++;
|
||||
- }
|
||||
-
|
||||
- if (pidp) *pidp = 0;
|
||||
-
|
||||
- if (fsizep) {
|
||||
- struct stat sb, * st = &sb;
|
||||
- if (stat(path, st) < 0)
|
||||
- return -1;
|
||||
- *fsizep = st->st_size;
|
||||
- }
|
||||
-
|
||||
- fdno = open(path, O_RDONLY);
|
||||
- if (fdno < 0)
|
||||
- return fdno;
|
||||
-
|
||||
- if (!(cmd && *cmd))
|
||||
- return fdno;
|
||||
-
|
||||
- if (pidp != NULL && is_prelinked(fdno)) {
|
||||
- int pipes[2];
|
||||
- pid_t pid;
|
||||
-
|
||||
- close(fdno);
|
||||
- pipes[0] = pipes[1] = -1;
|
||||
- if (pipe(pipes) < 0)
|
||||
- return -1;
|
||||
-
|
||||
- pid = fork();
|
||||
- if (pid < 0) {
|
||||
- close(pipes[0]);
|
||||
- close(pipes[1]);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- if (pid == 0) {
|
||||
- ARGV_t av, lib;
|
||||
- int dfd;
|
||||
- argvSplit(&av, cmd, " ");
|
||||
-
|
||||
- close(pipes[0]);
|
||||
- dfd = dup2(pipes[1], STDOUT_FILENO);
|
||||
- close(pipes[1]);
|
||||
- if (dfd >= 0 && (lib = argvSearch(av, "library", NULL)) != NULL) {
|
||||
- *lib = (char *) path;
|
||||
- unsetenv("MALLOC_CHECK_");
|
||||
- execve(av[0], av+1, environ);
|
||||
- }
|
||||
- _exit(127); /* not normally reached */
|
||||
- } else {
|
||||
- *pidp = pid;
|
||||
- fdno = pipes[0];
|
||||
- close(pipes[1]);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return fdno;
|
||||
-}
|
||||
-
|
||||
int rpmDoDigest(int algo, const char * fn,int asAscii,
|
||||
unsigned char * digest, rpm_loff_t * fsizep)
|
||||
{
|
||||
- const char * path;
|
||||
- urltype ut = urlPath(fn, &path);
|
||||
unsigned char * dig = NULL;
|
||||
size_t diglen, buflen = 32 * BUFSIZ;
|
||||
unsigned char *buf = xmalloc(buflen);
|
||||
- FD_t fd;
|
||||
rpm_loff_t fsize = 0;
|
||||
- pid_t pid = 0;
|
||||
int rc = 0;
|
||||
- int fdno;
|
||||
|
||||
- fdno = open_dso(path, &pid, &fsize);
|
||||
- if (fdno < 0) {
|
||||
- rc = 1;
|
||||
- goto exit;
|
||||
- }
|
||||
+ FD_t fd = Fopen(fn, "r.ufdio");
|
||||
|
||||
- switch (ut) {
|
||||
- case URL_IS_PATH:
|
||||
- case URL_IS_UNKNOWN:
|
||||
- case URL_IS_HTTPS:
|
||||
- case URL_IS_HTTP:
|
||||
- case URL_IS_FTP:
|
||||
- case URL_IS_HKP:
|
||||
- case URL_IS_DASH:
|
||||
- default:
|
||||
- /* Either use the pipe to prelink -y or open the URL. */
|
||||
- fd = (pid != 0) ? fdDup(fdno) : Fopen(fn, "r.ufdio");
|
||||
- (void) close(fdno);
|
||||
- if (fd == NULL || Ferror(fd)) {
|
||||
- rc = 1;
|
||||
- if (fd != NULL)
|
||||
- (void) Fclose(fd);
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
+ if (fd) {
|
||||
fdInitDigest(fd, algo, 0);
|
||||
- fsize = 0;
|
||||
while ((rc = Fread(buf, sizeof(*buf), buflen, fd)) > 0)
|
||||
fsize += rc;
|
||||
fdFiniDigest(fd, algo, (void **)&dig, &diglen, asAscii);
|
||||
- if (dig == NULL || Ferror(fd))
|
||||
- rc = 1;
|
||||
-
|
||||
- (void) Fclose(fd);
|
||||
- break;
|
||||
+ Fclose(fd);
|
||||
}
|
||||
|
||||
- /* Reap the prelink -y helper. */
|
||||
- if (pid) {
|
||||
- int status;
|
||||
- (void) waitpid(pid, &status, 0);
|
||||
- if (!WIFEXITED(status) || WEXITSTATUS(status))
|
||||
- rc = 1;
|
||||
+ if (dig == NULL || Ferror(fd)) {
|
||||
+ rc = 1;
|
||||
+ } else {
|
||||
+ memcpy(digest, dig, diglen);
|
||||
+ if (fsizep)
|
||||
+ *fsizep = fsize;
|
||||
}
|
||||
|
||||
-exit:
|
||||
- if (fsizep)
|
||||
- *fsizep = fsize;
|
||||
- if (!rc)
|
||||
- memcpy(digest, dig, diglen);
|
||||
dig = _free(dig);
|
||||
free(buf);
|
||||
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,39 +0,0 @@
|
||||
From a35fbd503d944fa1d2a0e893d2ca97f244299b35 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Tue, 14 May 2019 13:55:52 +0300
|
||||
Subject: [PATCH 2/2] Fix use-after-free introduced in
|
||||
0f21bdd0d7b2c45564ddb5a24bbebd530867bd54
|
||||
|
||||
Unlike typical fooFree() functions in rpm, Fclose() doesn't set the
|
||||
pointer to NULL so there's a use-after-free in checking for Ferror()
|
||||
that segfaults and stuff. Delay Fclose() until the end so we actually
|
||||
catch io errors too, that was another thing that went missing in
|
||||
commit 0f21bdd0d7b2c45564ddb5a24bbebd530867bd54 (although it would've
|
||||
probably caused an error via null digest instead)
|
||||
---
|
||||
rpmio/rpmfileutil.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c
|
||||
index 4349c64a7..16a954a10 100644
|
||||
--- a/rpmio/rpmfileutil.c
|
||||
+++ b/rpmio/rpmfileutil.c
|
||||
@@ -37,7 +37,6 @@ int rpmDoDigest(int algo, const char * fn,int asAscii,
|
||||
while ((rc = Fread(buf, sizeof(*buf), buflen, fd)) > 0)
|
||||
fsize += rc;
|
||||
fdFiniDigest(fd, algo, (void **)&dig, &diglen, asAscii);
|
||||
- Fclose(fd);
|
||||
}
|
||||
|
||||
if (dig == NULL || Ferror(fd)) {
|
||||
@@ -50,6 +49,7 @@ int rpmDoDigest(int algo, const char * fn,int asAscii,
|
||||
|
||||
dig = _free(dig);
|
||||
free(buf);
|
||||
+ Fclose(fd);
|
||||
|
||||
return rc;
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,63 +0,0 @@
|
||||
From 9a50846ceeef2add2344dd463c5562bd69496a23 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Mon, 6 May 2019 14:44:30 +0300
|
||||
Subject: [PATCH] Adopt language-specific %build_fooflags macros from Fedora
|
||||
|
||||
%{optflags} has been the catchall for all compiler options but this
|
||||
is quite limiting as there's no way to add for example C++ specific
|
||||
options distro-wide. This adds separate %build_cflags, %build_cxxflags,
|
||||
%build_fflags for the gcc-supported languages, and additionally
|
||||
%build_ldflags for distro-wide LDFLAGS setting.
|
||||
|
||||
Based on Florian Weimer's work in Fedoras redhat-rpm-config macros.
|
||||
---
|
||||
macros.in | 26 +++++++++++++++++++++++---
|
||||
1 file changed, 23 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/macros.in b/macros.in
|
||||
index 2ab108776..b6cb52951 100644
|
||||
--- a/macros.in
|
||||
+++ b/macros.in
|
||||
@@ -999,6 +999,24 @@ package or when debugging this package.\
|
||||
%_target_vendor %{_host_vendor}
|
||||
%_target_os %{_host_os}
|
||||
|
||||
+#==============================================================================
|
||||
+# ---- compiler flags.
|
||||
+
|
||||
+# C compiler flags. This is traditionally called CFLAGS in makefiles.
|
||||
+# Historically also available as %%{optflags}, and %%build sets the
|
||||
+# environment variable RPM_OPT_FLAGS to this value.
|
||||
+%build_cflags %{optflags}
|
||||
+
|
||||
+# C++ compiler flags. This is traditionally called CXXFLAGS in makefiles.
|
||||
+%build_cxxflags %{optflags}
|
||||
+
|
||||
+# Fortran compiler flags. Makefiles use both FFLAGS and FCFLAGS as
|
||||
+# the corresponding variable names.
|
||||
+%build_fflags %{optflags} %{?_fmoddir:-I%{_fmoddir}}
|
||||
+
|
||||
+# Link editor flags. This is usually called LDFLAGS in makefiles.
|
||||
+#%build_ldflags -Wl,-z,relro %{?_lto_cflags}
|
||||
+
|
||||
#==============================================================================
|
||||
# ---- specfile macros.
|
||||
# Macro(s) here can be used reliably for reproducible builds.
|
||||
@@ -1010,9 +1028,11 @@ package or when debugging this package.\
|
||||
#
|
||||
%_configure ./configure
|
||||
%configure \
|
||||
- CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
|
||||
- CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
|
||||
- FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
|
||||
+ CFLAGS="${CFLAGS:-%{?build_cflags}}" ; export CFLAGS ; \
|
||||
+ CXXFLAGS="${CXXFLAGS:-%{?build_cxxflags}}" ; export CXXFLAGS ; \
|
||||
+ FFLAGS="${FFLAGS:-%{?build_fflags}}" ; export FFLAGS ; \
|
||||
+ FCFLAGS="${FCFLAGS:-%{?build_fflags}}" ; export FCFLAGS ; \
|
||||
+ LDFLAGS="${LDFLAGS:-%{?build_ldflags}}" ; export LDFLAGS ; \
|
||||
%{_configure} --host=%{_host} --build=%{_build} \\\
|
||||
--program-prefix=%{?_program_prefix} \\\
|
||||
--disable-dependency-tracking \\\
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,28 +1,28 @@
|
||||
Index: build/parseBuildInstallClean.c
|
||||
===================================================================
|
||||
--- build/parseBuildInstallClean.c.orig
|
||||
+++ build/parseBuildInstallClean.c
|
||||
@@ -46,7 +46,22 @@ int parseBuildInstallClean(rpmSpec spec,
|
||||
} else if (rc < 0) {
|
||||
goto exit;
|
||||
}
|
||||
-
|
||||
+
|
||||
+ if (parsePart == PART_BUILD) {
|
||||
+ char* buf = strdup(
|
||||
+ "ref=/usr/lib/rpm\n"
|
||||
+ "for s in guess sub; do\n"
|
||||
+ " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n"
|
||||
+ " grep -q config-patches@ $c || continue\n"
|
||||
+ " grep -q aarch64 $c || install -m 755 $ref/config.$s $c\n"
|
||||
+ " grep -q ppc64le $c || install -m 755 $ref/config.$s $c\n"
|
||||
+ " done\n"
|
||||
+ "done\n"
|
||||
+ );
|
||||
+ appendLineStringBuf(*sbp, buf);
|
||||
+ free(buf);
|
||||
+ }
|
||||
+
|
||||
while (! (nextPart = isPart(spec->line))) {
|
||||
appendStringBuf(*sbp, spec->line);
|
||||
if ((rc = readLine(spec, STRIP_NOTHING)) > 0) {
|
||||
--- ./build/parseSpec.c.orig 2019-10-02 12:38:51.836127743 +0000
|
||||
+++ ./build/parseSpec.c 2019-10-02 12:52:33.818447657 +0000
|
||||
@@ -926,7 +926,24 @@ static rpmSpec parseSpec(const char *spe
|
||||
&(spec->buildrequires));
|
||||
break;
|
||||
case PART_BUILD:
|
||||
- parsePart = parseSimpleScript(spec, "%build", &(spec->build));
|
||||
+ if (spec->build) {
|
||||
+ rpmlog(RPMLOG_ERR, _("line %d: second %s\n"), spec->lineNum, "%build");
|
||||
+ parsePart = PART_ERROR;
|
||||
+ break;
|
||||
+ }
|
||||
+ spec->build = newStringBuf();
|
||||
+ appendLineStringBuf(spec->build,
|
||||
+ "ref=/usr/lib/rpm\n"
|
||||
+ "for s in guess sub; do\n"
|
||||
+ " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n"
|
||||
+ " grep -q config-patches@ $c || continue\n"
|
||||
+ " grep -q aarch64 $c || install -m 755 $ref/config.$s $c\n"
|
||||
+ " grep -q ppc64le $c || install -m 755 $ref/config.$s $c\n"
|
||||
+ " grep -q 'riscv64[-:]' $c || install -m 755 $ref/config.$s $c\n"
|
||||
+ " done\n"
|
||||
+ "done\n"
|
||||
+ );
|
||||
+ parsePart = parseLines(spec, STRIP_NOTHING, NULL, &(spec->build));
|
||||
break;
|
||||
case PART_INSTALL:
|
||||
parsePart = parseSimpleScript(spec, "%install", &(spec->install));
|
||||
|
@ -1,10 +0,0 @@
|
||||
--- ./build/parseBuildInstallClean.c.orig 2018-02-22 10:11:50.088160024 +0000
|
||||
+++ ./build/parseBuildInstallClean.c 2018-02-22 10:11:37.592198130 +0000
|
||||
@@ -55,6 +55,7 @@ int parseBuildInstallClean(rpmSpec spec,
|
||||
" grep -q config-patches@ $c || continue\n"
|
||||
" grep -q aarch64 $c || install -m 755 $ref/config.$s $c\n"
|
||||
" grep -q ppc64le $c || install -m 755 $ref/config.$s $c\n"
|
||||
+ " grep -q 'riscv64[-:]' $c || install -m 755 $ref/config.$s $c\n"
|
||||
" done\n"
|
||||
"done\n"
|
||||
);
|
@ -1,10 +1,10 @@
|
||||
--- scripts/brp-compress 2013-09-02 19:00:09.000000000 +0200
|
||||
+++ scripts/brp-compress 2013-09-02 19:03:12.000000000 +0200
|
||||
@@ -47,6 +47,7 @@ do
|
||||
--- ./scripts/brp-compress.orig 2019-10-02 12:09:46.263708258 +0000
|
||||
+++ ./scripts/brp-compress 2019-10-02 12:09:52.055696056 +0000
|
||||
@@ -50,6 +50,7 @@ do
|
||||
find $d -type f ! -name dir | while read f
|
||||
do
|
||||
[ -f "$f" ] || continue
|
||||
+ case $(file "$f") in *"image data"*) continue;; esac
|
||||
|
||||
case "$f" in
|
||||
*.gz|*.Z) gunzip "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
|
||||
*.gz|*.Z) gunzip -f "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
|
||||
|
@ -1,16 +1,16 @@
|
||||
--- ./scripts/brp-compress.orig 2018-01-31 13:07:37.130104408 +0000
|
||||
+++ ./scripts/brp-compress 2018-01-31 13:07:16.234159981 +0000
|
||||
@@ -5,51 +5,78 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD
|
||||
--- ./scripts/brp-compress.orig 2019-10-02 09:59:40.403995534 +0000
|
||||
+++ ./scripts/brp-compress 2019-10-02 10:03:27.075537047 +0000
|
||||
@@ -5,6 +5,9 @@ if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_B
|
||||
exit 0
|
||||
fi
|
||||
|
||||
+LC_ALL=
|
||||
+LANG=
|
||||
+LC_TIME=POSIX
|
||||
+
|
||||
cd "$RPM_BUILD_ROOT"
|
||||
PREFIX=${1:-/usr}
|
||||
|
||||
# Compress man pages
|
||||
cd "$RPM_BUILD_ROOT"
|
||||
@@ -13,6 +16,29 @@ cd "$RPM_BUILD_ROOT"
|
||||
COMPRESS=${COMPRESS:-gzip -9 -n}
|
||||
COMPRESS_EXT=${COMPRESS_EXT:-.gz}
|
||||
|
||||
@ -37,10 +37,11 @@
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
|
||||
./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
|
||||
./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \
|
||||
./usr/share/doc/*/man/man* ./usr/lib/*/man/man* ./usr/share/fish/man/man*
|
||||
for d in .${PREFIX}/man/man* .${PREFIX}/man/*/man* .${PREFIX}/info \
|
||||
.${PREFIX}/share/man/man* .${PREFIX}/share/man/*/man* \
|
||||
.${PREFIX}/share/info .${PREFIX}/kerberos/man \
|
||||
@@ -21,39 +47,39 @@ for d in .${PREFIX}/man/man* .${PREFIX}/
|
||||
.${PREFIX}/share/fish/man/man*
|
||||
do
|
||||
[ -d $d ] || continue
|
||||
- for f in `find $d -type f ! -name dir`
|
||||
@ -52,11 +53,10 @@
|
||||
- *.gz|*.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
|
||||
- *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
|
||||
- *.xz|*.lzma) unxz -f $f; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
|
||||
- *) b=$f;;
|
||||
+ *.gz|*.Z) gunzip "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
|
||||
+ *.bz2) bunzip2 "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.bz2$//'`;;
|
||||
+ *.xz|*.lzma) unxz "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
|
||||
+ *) b="$f";;
|
||||
+ *.gz|*.Z) gunzip -f "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
|
||||
+ *.bz2) bunzip2 -f "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.bz2$//'`;;
|
||||
+ *.xz|*.lzma) unxz -f "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
|
||||
*) b=$f;;
|
||||
esac
|
||||
|
||||
- $COMPRESS $b </dev/null 2>/dev/null || {
|
||||
|
@ -1,5 +1,5 @@
|
||||
--- ./build/parseReqs.c.orig 2017-10-05 10:04:56.887602165 +0000
|
||||
+++ ./build/parseReqs.c 2017-12-01 16:00:06.956343096 +0000
|
||||
--- ./build/parseReqs.c.orig 2019-06-26 14:17:31.396985719 +0000
|
||||
+++ ./build/parseReqs.c 2019-10-02 12:10:51.879570016 +0000
|
||||
@@ -42,7 +42,7 @@ static rpmRC checkEpoch(const char *s, c
|
||||
return RPMRC_OK;
|
||||
}
|
||||
@ -54,11 +54,11 @@
|
||||
+ if (checkDep(spec, tagflags, N, EVR, &emsg))
|
||||
goto exit;
|
||||
|
||||
if (nametag == RPMTAG_FILETRIGGERNAME ||
|
||||
--- ./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
|
||||
if (nametag == RPMTAG_OBSOLETENAME) {
|
||||
--- ./macros.in.orig 2019-10-02 12:10:45.431583601 +0000
|
||||
+++ ./macros.in 2019-10-02 12:10:51.879570016 +0000
|
||||
@@ -452,7 +452,7 @@ package or when debugging this package.\
|
||||
%_invalid_encoding_terminates_build 1
|
||||
|
||||
# Should invalid version format in requires, provides, ... terminate a build?
|
||||
-%_wrong_version_format_terminate_build 1
|
||||
|
@ -1,94 +0,0 @@
|
||||
--- ./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)
|
@ -1,8 +1,8 @@
|
||||
Make debugedit build without dwarf.h
|
||||
|
||||
--- ./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
|
||||
--- ./Makefile.am.orig 2019-06-26 14:17:31.394985722 +0000
|
||||
+++ ./Makefile.am 2019-10-02 09:48:35.949316743 +0000
|
||||
@@ -167,7 +167,6 @@ rpm2archive_LDADD += @WITH_POPT_LIB@ @WI
|
||||
|
||||
|
||||
if LIBELF
|
||||
@ -10,7 +10,7 @@ Make debugedit build without dwarf.h
|
||||
if LIBDW
|
||||
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
|
||||
|
||||
@@ -168,7 +167,6 @@ else
|
||||
@@ -181,7 +180,6 @@ else
|
||||
debugedit_LDADD += @WITH_LIBDW_LIB@ -lebl
|
||||
endif # HAVE_LIBDW_STRTAB
|
||||
endif # LIBDW
|
||||
@ -18,9 +18,9 @@ Make debugedit build without dwarf.h
|
||||
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 @@
|
||||
--- ./tools/debugedit.c.orig 2019-06-26 14:17:31.462985619 +0000
|
||||
+++ ./tools/debugedit.c 2019-10-02 09:48:35.953316735 +0000
|
||||
@@ -39,7 +39,45 @@
|
||||
#include <popt.h>
|
||||
|
||||
#include <gelf.h>
|
||||
@ -56,6 +56,14 @@ Make debugedit build without dwarf.h
|
||||
+#define DW_FORM_ref8 0x14
|
||||
+#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
|
||||
|
@ -1,21 +0,0 @@
|
||||
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
|
||||
index 73275a11c..3dc438ce5 100755
|
||||
--- scripts/find-debuginfo.sh
|
||||
+++ scripts/find-debuginfo.sh
|
||||
@@ -486,6 +486,7 @@ if $run_dwz \
|
||||
&& [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
|
||||
readarray dwz_files < <(cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug | LC_ALL=C sort)
|
||||
if [ ${#dwz_files[@]} -gt 0 ]; then
|
||||
+ size_before=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
|
||||
dwz_multifile_name="${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE}.${RPM_ARCH}"
|
||||
dwz_multifile_suffix=
|
||||
dwz_multifile_idx=0
|
||||
@@ -508,6 +509,8 @@ if $run_dwz \
|
||||
echo >&2 "*** ERROR: DWARF compression requested, but no dwz installed"
|
||||
exit 2
|
||||
fi
|
||||
+ size_after=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
|
||||
+ echo "original debug info size: ${size_before}kB, size after compression: ${size_after}kB"
|
||||
# Remove .dwz directory if empty
|
||||
rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null
|
||||
if [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" ]; then
|
@ -1,21 +1,29 @@
|
||||
--- ./lib/transaction.c.orig 2018-07-02 14:51:41.328051671 +0000
|
||||
+++ ./lib/transaction.c 2018-07-02 14:51:46.264038824 +0000
|
||||
@@ -1462,7 +1462,9 @@ rpmRC runScript(rpmts ts, rpmte te, Head
|
||||
int warn_only = (stag != RPMTAG_PREIN &&
|
||||
stag != RPMTAG_PREUN &&
|
||||
stag != RPMTAG_PRETRANS &&
|
||||
- stag != RPMTAG_VERIFYSCRIPT);
|
||||
+ stag != RPMTAG_VERIFYSCRIPT &&
|
||||
+ !(stag == RPMTAG_POSTIN &&
|
||||
+ rpmExpandNumeric("%{_fail_on_postinstall_errors}")));
|
||||
rpmdb rdb = rpmtsGetRdb(ts);
|
||||
--- ./lib/rpmscript.c.orig 2019-10-02 12:19:15.694519983 +0000
|
||||
+++ ./lib/rpmscript.c 2019-10-02 12:22:32.838112185 +0000
|
||||
@@ -411,7 +411,7 @@ rpmRC rpmScriptRun(rpmScript script, int
|
||||
if (script == NULL) return RPMRC_OK;
|
||||
|
||||
/* Fake up a transaction element for triggers from rpmdb */
|
||||
--- ./macros.in.orig 2018-07-02 14:51:41.340051640 +0000
|
||||
+++ ./macros.in 2018-07-02 14:51:46.264038824 +0000
|
||||
@@ -1290,5 +1290,10 @@ end}
|
||||
%{expand:%__scm_setup_%{__scm} %{!-v:-q}}\
|
||||
%{!-N:%autopatch %{-v} %{-p:-p%{-p*}}}
|
||||
ARGV_t args = NULL;
|
||||
- rpmlogLvl lvl = (script->flags & RPMSCRIPT_FLAG_CRITICAL) ?
|
||||
+ rpmlogLvl lvl = (rpmScriptFlags(script) & RPMSCRIPT_FLAG_CRITICAL) ?
|
||||
RPMLOG_ERR : RPMLOG_WARNING;
|
||||
rpmRC rc;
|
||||
int script_type = RPMSCRIPTLET_FORK | RPMSCRIPTLET_EXEC;
|
||||
@@ -654,5 +654,8 @@ rpmscriptTypes rpmScriptType(rpmScript s
|
||||
|
||||
rpmscriptFlags rpmScriptFlags(rpmScript script)
|
||||
{
|
||||
- return (script != NULL) ? script->flags : 0;
|
||||
+ rpmscriptFlags flags = (script != NULL) ? script->flags : 0;
|
||||
+ if (script && script->tag == RPMTAG_POSTIN && rpmExpandNumeric("%{_fail_on_postinstall_errors}"))
|
||||
+ flags |= RPMSCRIPT_FLAG_CRITICAL;
|
||||
+ return flags;
|
||||
}
|
||||
--- ./macros.in.orig 2019-10-02 12:12:13.027399050 +0000
|
||||
+++ ./macros.in 2019-10-02 12:12:19.799384783 +0000
|
||||
@@ -1318,5 +1318,10 @@ end}
|
||||
%requires_eq() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
||||
%requires_ge() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} >= %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
||||
|
||||
+# Should errors in %post scriptlet be propagated as errors?
|
||||
+#
|
||||
|
@ -1,15 +1,15 @@
|
||||
--- ./fileattrs/Makefile.am.orig 2017-12-01 15:46:21.021741182 +0000
|
||||
+++ ./fileattrs/Makefile.am 2017-12-01 15:48:54.108298271 +0000
|
||||
--- ./fileattrs/Makefile.am.orig 2019-10-02 11:39:56.095525981 +0000
|
||||
+++ ./fileattrs/Makefile.am 2019-10-02 11:40:20.695473538 +0000
|
||||
@@ -8,6 +8,6 @@ fattrsdir = $(rpmconfigdir)/fileattrs
|
||||
fattrs_DATA = \
|
||||
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 elflib.attr
|
||||
perl.attr perllib.attr pkgconfig.attr python.attr pythondist.attr ocaml.attr \
|
||||
- script.attr
|
||||
+ script.attr elflib.attr
|
||||
|
||||
EXTRA_DIST = $(fattrs_DATA)
|
||||
--- ./fileattrs/elf.attr.orig 2017-12-01 15:46:28.171720501 +0000
|
||||
+++ ./fileattrs/elf.attr 2017-12-01 15:47:49.339485678 +0000
|
||||
--- ./fileattrs/elf.attr.orig 2019-06-26 14:17:31.404985707 +0000
|
||||
+++ ./fileattrs/elf.attr 2019-10-02 11:39:56.095525981 +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}
|
||||
@ -17,23 +17,23 @@
|
||||
+%__elf_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*executable
|
||||
%__elf_flags exeonly
|
||||
+%__elf_exclude_path ^/usr/lib/debug/
|
||||
--- ./fileattrs/elflib.attr.orig 2017-12-01 15:46:28.171720501 +0000
|
||||
+++ ./fileattrs/elflib.attr 2017-12-01 15:46:28.171720501 +0000
|
||||
--- ./fileattrs/elflib.attr.orig 2019-10-02 11:39:56.095525981 +0000
|
||||
+++ ./fileattrs/elflib.attr 2019-10-02 11:39:56.095525981 +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/
|
||||
--- ./fileattrs/perl.attr.orig 2017-08-10 08:08:07.113108701 +0000
|
||||
+++ ./fileattrs/perl.attr 2017-12-01 15:46:28.172720497 +0000
|
||||
--- ./fileattrs/perl.attr.orig 2019-06-26 14:17:31.404985707 +0000
|
||||
+++ ./fileattrs/perl.attr 2019-10-02 11:39:56.095525981 +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 2017-08-10 08:08:07.113108701 +0000
|
||||
+++ ./fileattrs/perllib.attr 2017-12-01 15:46:28.172720497 +0000
|
||||
--- ./fileattrs/perllib.attr.orig 2019-06-26 14:17:31.404985707 +0000
|
||||
+++ ./fileattrs/perllib.attr 2019-10-02 11:39:56.095525981 +0000
|
||||
@@ -1,5 +1,6 @@
|
||||
%__perllib_provides %{_rpmconfigdir}/perl.prov
|
||||
-%__perllib_requires %{_rpmconfigdir}/perl.req
|
||||
|
@ -1,15 +1,15 @@
|
||||
--- ./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
|
||||
--- ./scripts/find-debuginfo.sh.orig 2019-09-09 07:56:53.377788842 +0000
|
||||
+++ ./scripts/find-debuginfo.sh 2019-10-02 11:11:56.878979662 +0000
|
||||
@@ -348,12 +348,18 @@ trap 'rm -rf "$temp"' EXIT
|
||||
|
||||
# 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 |
|
||||
- -print | LC_ALL=C sort |
|
||||
-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" \) ! -name "*.a" -print0 | sort -z |
|
||||
+find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | LC_ALL=C 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
|
||||
@ -24,7 +24,7 @@
|
||||
if [ $nlinks -gt 1 ]; then
|
||||
var=seen_$inum
|
||||
if test -n "${!var}"; then
|
||||
@@ -364,6 +370,8 @@ do_file()
|
||||
@@ -386,6 +392,8 @@ do_file()
|
||||
if [ "$no_recompute_build_id" = "true" ]; then
|
||||
no_recompute="-n"
|
||||
fi
|
||||
@ -33,7 +33,7 @@
|
||||
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()
|
||||
@@ -413,17 +421,30 @@ do_file()
|
||||
# just has its file names collected and adjusted.
|
||||
case "$dn" in
|
||||
/usr/lib/debug/*)
|
||||
@ -71,16 +71,7 @@
|
||||
|
||||
# strip -g implies we have full symtab, don't add mini symtab in that case.
|
||||
# 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'`"
|
||||
fi
|
||||
|
||||
# dwz invalidates .gnu_debuglink CRC32 in the main files.
|
||||
@@ -551,12 +572,14 @@ if [ -s "$SOURCEFILE" ]; then
|
||||
@@ -581,12 +602,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
|
||||
@ -88,7 +79,7 @@
|
||||
+ xargs --no-run-if-empty -0 chmod a+r
|
||||
fi
|
||||
|
||||
if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -d "${RPM_BUILD_ROOT}/usr/src" ]; then
|
||||
if [ -d "${RPM_BUILD_ROOT}/usr/lib" ] || [ -d "${RPM_BUILD_ROOT}/usr/src" ]; then
|
||||
((nout > 0)) ||
|
||||
test ! -d "${RPM_BUILD_ROOT}/usr/lib" ||
|
||||
- (cd "${RPM_BUILD_ROOT}/usr/lib"; find debug -type d) |
|
||||
|
@ -1,5 +1,5 @@
|
||||
--- ./scripts/find-lang.sh.orig 2018-01-16 09:02:23.879253043 +0000
|
||||
+++ ./scripts/find-lang.sh 2018-01-31 13:20:30.938048419 +0000
|
||||
--- ./scripts/find-lang.sh.orig 2019-09-09 07:56:53.377788842 +0000
|
||||
+++ ./scripts/find-lang.sh 2019-10-02 11:12:53.774861485 +0000
|
||||
@@ -22,11 +22,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
|
||||
@ -137,7 +137,7 @@
|
||||
+/^$/d' >> $MO_NAME_NEW
|
||||
|
||||
KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null`
|
||||
if [ x"$KDE3_HTML" != x -a -d "$TOP_DIR$KDE3_HTML" ]; then
|
||||
if [ x"$KDE3_HTML" != x ] && [ -d "$TOP_DIR$KDE3_HTML" ]; then
|
||||
@@ -193,7 +203,7 @@ s:'"$TOP_DIR"'::
|
||||
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
|
||||
s:^\([^%].*\)::
|
||||
|
@ -1,25 +1,25 @@
|
||||
--- ./scripts/Makefile.am.orig 2018-07-02 14:43:19.345357110 +0000
|
||||
+++ ./scripts/Makefile.am 2018-07-02 14:43:47.245284542 +0000
|
||||
@@ -17,7 +17,7 @@ EXTRA_DIST = \
|
||||
python-macro-helper \
|
||||
--- ./scripts/Makefile.am.orig 2019-06-26 14:17:31.452985634 +0000
|
||||
+++ ./scripts/Makefile.am 2019-10-02 12:27:55.885450155 +0000
|
||||
@@ -16,7 +16,7 @@ EXTRA_DIST = \
|
||||
perl.prov perl.req pythondeps.sh pythondistdeps.py \
|
||||
rpmdb_loadcvt rpm.daily rpm.log rpm.supp rpm2cpio.sh \
|
||||
tgpg vpkg-provides.sh \
|
||||
- find-requires find-provides \
|
||||
+ find-requires find-provides find-supplements \
|
||||
find-requires.php find-provides.php \
|
||||
mono-find-requires mono-find-provides \
|
||||
ocaml-find-requires.sh ocaml-find-provides.sh \
|
||||
@@ -32,7 +32,7 @@ rpmconfig_SCRIPTS = \
|
||||
pkgconfigdeps.sh libtooldeps.sh metainfo.prov \
|
||||
@@ -29,7 +29,7 @@ rpmconfig_SCRIPTS = \
|
||||
check-files check-prereqs \
|
||||
check-buildroot check-rpaths check-rpaths-worker \
|
||||
debuginfo.prov \
|
||||
- find-lang.sh find-requires find-provides \
|
||||
+ find-lang.sh find-requires find-provides find-supplements \
|
||||
perl.prov perl.req pythondeps.sh pythondistdeps.py \
|
||||
python-macro-helper \
|
||||
metainfo.prov \
|
||||
--- ./scripts/find-supplements.orig 2018-07-02 14:43:12.877373928 +0000
|
||||
+++ ./scripts/find-supplements 2018-07-02 14:43:59.325253127 +0000
|
||||
pkgconfigdeps.sh libtooldeps.sh \
|
||||
--- ./scripts/find-supplements.orig 2019-10-02 12:27:55.885450155 +0000
|
||||
+++ ./scripts/find-supplements 2019-10-02 12:27:55.885450155 +0000
|
||||
@@ -0,0 +1,3 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
|
12
fix_lua_cflags.diff
Normal file
12
fix_lua_cflags.diff
Normal file
@ -0,0 +1,12 @@
|
||||
--- ./build/Makefile.am.orig 2019-10-02 13:12:00.031823903 +0000
|
||||
+++ ./build/Makefile.am 2019-10-02 13:13:09.743668564 +0000
|
||||
@@ -10,6 +10,9 @@ AM_CPPFLAGS += @WITH_NSS_INCLUDE@
|
||||
AM_CPPFLAGS += @WITH_MAGIC_INCLUDE@
|
||||
AM_CPPFLAGS += @WITH_POPT_INCLUDE@
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/misc
|
||||
+if WITH_LUA
|
||||
+AM_CPPFLAGS += @LUA_CFLAGS@
|
||||
+endif
|
||||
|
||||
usrlibdir = $(libdir)
|
||||
usrlib_LTLIBRARIES = librpmbuild.la
|
109
getncpus.diff
109
getncpus.diff
@ -1,109 +0,0 @@
|
||||
--- ./configure.ac.orig 2019-02-07 14:26:10.800566817 +0000
|
||||
+++ ./configure.ac 2019-02-07 14:26:30.944514306 +0000
|
||||
@@ -770,6 +770,7 @@ AC_CHECK_FUNCS(lutimes)
|
||||
AC_CHECK_FUNCS(mergesort)
|
||||
AC_CHECK_FUNCS(getauxval)
|
||||
AC_CHECK_FUNCS(setprogname, [], [], [#include <stdlib.h>])
|
||||
+AC_CHECK_FUNCS(sched_getaffinity, [], [], [#include <sched.h>])
|
||||
|
||||
AC_MSG_CHECKING([whether __progname is defined])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([extern const char *__progname;],
|
||||
--- ./macros.in.orig 2019-02-07 14:20:03.257524913 +0000
|
||||
+++ ./macros.in 2019-02-07 14:22:46.105100409 +0000
|
||||
@@ -1056,7 +1056,7 @@ package or when debugging this package.\
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# The "make" analogue, hiding the _smp_mflags magic from specs
|
||||
-%make_build %{__make} %{_make_output_sync} %{?_smp_mflags}
|
||||
+%make_build %{__make} %{_make_output_sync} %{?_smp_mflags} V=1 VERBOSE=1
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# The make install analogue of %configure for modern autotools:
|
||||
--- ./platform.in.orig 2019-02-07 14:23:06.641046876 +0000
|
||||
+++ ./platform.in 2019-02-07 14:41:12.462256547 +0000
|
||||
@@ -50,11 +50,17 @@
|
||||
|
||||
# Maximum number of CPU's to use when building, 0 for unlimited.
|
||||
#%_smp_ncpus_max 0
|
||||
-%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
|
||||
- && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
|
||||
+
|
||||
+%_smp_build_ncpus %([ -z "$RPM_BUILD_NCPUS" ] \\\
|
||||
+ && RPM_BUILD_NCPUS="%{getncpus}"; \\\
|
||||
ncpus_max=%{?_smp_ncpus_max}; \\\
|
||||
if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\
|
||||
- if [ "$RPM_BUILD_NCPUS" -gt 1 ]; then echo "-j$RPM_BUILD_NCPUS"; fi)
|
||||
+ echo "$RPM_BUILD_NCPUS";)
|
||||
+
|
||||
+%_smp_mflags -j%{_smp_build_ncpus}
|
||||
+
|
||||
+# Enable LTO optimization with a maximal parallelism
|
||||
+%_lto_cflags -flto=%{_smp_build_ncpus}
|
||||
|
||||
#==============================================================================
|
||||
# ---- Build policy macros.
|
||||
--- ./rpmio/macro.c.orig 2019-02-07 14:26:48.768468081 +0000
|
||||
+++ ./rpmio/macro.c 2019-02-07 14:38:59.286597550 +0000
|
||||
@@ -12,6 +12,9 @@
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
#endif
|
||||
+#if HAVE_SCHED_GETAFFINITY
|
||||
+#include <sched.h>
|
||||
+#endif
|
||||
|
||||
#if !defined(isblank)
|
||||
#define isblank(_c) ((_c) == ' ' || (_c) == '\t')
|
||||
@@ -445,6 +448,23 @@ exit:
|
||||
_free(buf);
|
||||
}
|
||||
|
||||
+static unsigned int getncpus(void)
|
||||
+{
|
||||
+ unsigned int ncpus = 0;
|
||||
+#if HAVE_SCHED_GETAFFINITY
|
||||
+ cpu_set_t set;
|
||||
+ if (sched_getaffinity (0, sizeof(set), &set) == 0)
|
||||
+ ncpus = CPU_COUNT(&set);
|
||||
+#endif
|
||||
+ /* Fallback to sysconf() if the above isn't supported or didn't work */
|
||||
+ if (ncpus < 1)
|
||||
+ ncpus = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
+ /* If all else fails, there's always the one we're running on... */
|
||||
+ if (ncpus < 1)
|
||||
+ ncpus = 1;
|
||||
+ return ncpus;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* Parse (and execute) new macro definition.
|
||||
* @param mb macro expansion state
|
||||
@@ -975,6 +995,9 @@ doFoo(MacroBuf mb, int negate, const cha
|
||||
} else if (STREQ("getconfdir", f, fn)) {
|
||||
sprintf(buf, "%s", rpmConfigDir());
|
||||
b = buf;
|
||||
+ } else if (STREQ("getncpus", f, fn)) {
|
||||
+ sprintf(buf, "%u", getncpus());
|
||||
+ b = buf;
|
||||
} else if (STREQ("S", f, fn)) {
|
||||
for (b = buf; (c = *b) && risdigit(c);)
|
||||
b++;
|
||||
@@ -1271,6 +1294,7 @@ expandMacro(MacroBuf mb, const char *src
|
||||
STREQ("u2p", f, fn) ||
|
||||
STREQ("getenv", f, fn) ||
|
||||
STREQ("getconfdir", f, fn) ||
|
||||
+ STREQ("getncpus", f, fn) ||
|
||||
STREQ("S", f, fn) ||
|
||||
STREQ("P", f, fn) ||
|
||||
STREQ("F", f, fn))
|
||||
--- ./rpmio/rpmio.c.orig 2019-02-07 14:39:20.886542242 +0000
|
||||
+++ ./rpmio/rpmio.c 2019-02-07 14:39:41.670489024 +0000
|
||||
@@ -796,7 +796,7 @@ static LZFILE *lzopen_internal(const cha
|
||||
#ifdef HAVE_LZMA_MT
|
||||
} else {
|
||||
if (threads == -1)
|
||||
- threads = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
+ threads = rpmExpandNumeric("%{getncpus}");
|
||||
lzma_mt mt_options = {
|
||||
.flags = 0,
|
||||
.threads = threads,
|
@ -1,6 +1,6 @@
|
||||
--- ./lib/rpmrc.c.orig 2014-07-03 15:11:48.572096075 +0000
|
||||
+++ ./lib/rpmrc.c 2014-09-17 12:04:27.330717791 +0000
|
||||
@@ -79,10 +79,12 @@ struct rpmOption {
|
||||
--- ./lib/rpmrc.c.orig 2019-06-26 14:17:31.416985688 +0000
|
||||
+++ ./lib/rpmrc.c 2019-10-02 09:52:05.076903733 +0000
|
||||
@@ -79,11 +79,13 @@ struct rpmOption {
|
||||
int localize;
|
||||
};
|
||||
|
||||
@ -8,21 +8,22 @@
|
||||
static struct rpmat_s {
|
||||
const char *platform;
|
||||
uint64_t hwcap;
|
||||
uint64_t hwcap2;
|
||||
} rpmat;
|
||||
+#endif
|
||||
|
||||
typedef struct defaultEntry_s {
|
||||
char * name;
|
||||
@@ -936,7 +938,7 @@ static int is_geode(void)
|
||||
@@ -950,7 +952,7 @@ static int is_geode(void)
|
||||
#endif
|
||||
|
||||
|
||||
-#if defined(__linux__)
|
||||
+#if defined(__linux__) && (defined(__powerpc__) || defined(__sparc__) || (defined(__arm__) && defined(__ARM_PCS_VFP)))
|
||||
/**
|
||||
* Populate rpmat structure with auxv values
|
||||
*/
|
||||
@@ -993,7 +995,7 @@ static void defaultMachine(rpmrcCtx ctx,
|
||||
#ifndef AT_HWCAP2 /* glibc < 2.18 */
|
||||
#define AT_HWCAP2 26
|
||||
#endif
|
||||
@@ -1013,7 +1015,7 @@ static void defaultMachine(rpmrcCtx ctx,
|
||||
canonEntry canon;
|
||||
int rc;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- ./macros.in.orig 2018-07-02 14:46:14.912900534 +0000
|
||||
+++ ./macros.in 2018-07-02 14:50:35.356223235 +0000
|
||||
@@ -184,7 +184,7 @@
|
||||
--- ./macros.in.orig 2019-10-02 11:13:35.966773848 +0000
|
||||
+++ ./macros.in 2019-10-02 11:17:37.210282271 +0000
|
||||
@@ -177,7 +177,7 @@
|
||||
%{?_unique_build_ids:--build-id-seed "%{VERSION}-%{RELEASE}"} \\\
|
||||
%{?_unique_debug_names:--unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
|
||||
%{?_unique_debug_srcs:--unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}"} \\\
|
||||
@ -9,7 +9,7 @@
|
||||
%{?_find_debuginfo_opts} \\\
|
||||
%{?_debugsource_packages:-S debugsourcefiles.list} \\\
|
||||
"%{_builddir}/%{?buildsubdir}"\
|
||||
@@ -224,7 +224,8 @@ package or when debugging this package.\
|
||||
@@ -217,7 +217,8 @@ package or when debugging this package.\
|
||||
%endif\
|
||||
%{nil}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
%_defaultlicensedir %{_datadir}/licenses
|
||||
|
||||
# Following macros for filtering auto deps must not be used in spec files.
|
||||
@@ -278,7 +279,8 @@ package or when debugging this package.\
|
||||
@@ -276,7 +277,8 @@ package or when debugging this package.\
|
||||
%_tmppath %{_var}/tmp
|
||||
|
||||
# Path to top of build area.
|
||||
@ -29,8 +29,8 @@
|
||||
|
||||
# The path to the unzip executable (legacy, use %{__unzip} instead).
|
||||
%_unzipbin %{__unzip}
|
||||
@@ -382,7 +384,7 @@ package or when debugging this package.\
|
||||
# "w6.lzdio" lzma-alone level 6, lzma's default
|
||||
@@ -388,7 +390,7 @@ package or when debugging this package.\
|
||||
# "w.ufdio" uncompressed
|
||||
#
|
||||
#%_source_payload w9.gzdio
|
||||
-#%_binary_payload w9.gzdio
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
# Algorithm to use for generating file checksum digests on build.
|
||||
# If not specified or 0, MD5 is used.
|
||||
@@ -489,6 +491,19 @@ package or when debugging this package.\
|
||||
@@ -495,6 +497,19 @@ package or when debugging this package.\
|
||||
#
|
||||
#%_include_minidebuginfo 1
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
#
|
||||
# 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.\
|
||||
@@ -527,7 +542,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
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
# 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.\
|
||||
@@ -556,10 +571,10 @@ package or when debugging this package.\
|
||||
%_unique_debug_srcs 1
|
||||
|
||||
# Whether rpm should put debug source files into its own subpackage
|
||||
@ -80,7 +80,7 @@
|
||||
|
||||
#
|
||||
# Use internal dependency generator rather than external helpers?
|
||||
@@ -566,6 +581,10 @@ package or when debugging this package.\
|
||||
@@ -572,6 +587,10 @@ 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
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
#
|
||||
# Path to scripts to autogenerate package dependencies,
|
||||
#
|
||||
@@ -576,6 +595,7 @@ package or when debugging this package.\
|
||||
@@ -582,6 +601,7 @@ package or when debugging this package.\
|
||||
%__find_requires %{_rpmconfigdir}/find-requires
|
||||
#%__find_conflicts ???
|
||||
#%__find_obsoletes ???
|
||||
@ -99,7 +99,7 @@
|
||||
|
||||
#
|
||||
# Path to file attribute classifications for automatic dependency
|
||||
@@ -654,10 +674,10 @@ package or when debugging this package.\
|
||||
@@ -660,10 +680,10 @@ package or when debugging this package.\
|
||||
# Misc BDB tuning options
|
||||
%__dbi_other mp_mmapsize=128Mb mp_size=1Mb
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
|
||||
#==============================================================================
|
||||
# ---- GPG/PGP/PGP5 signature macros.
|
||||
@@ -969,7 +989,7 @@ package or when debugging this package.\
|
||||
@@ -1000,7 +1020,7 @@ package or when debugging this package.\
|
||||
%_build_vendor %{_host_vendor}
|
||||
%_build_os %{_host_os}
|
||||
%_host @host@
|
||||
@ -121,13 +121,13 @@
|
||||
%_host_cpu @host_cpu@
|
||||
%_host_vendor @host_vendor@
|
||||
%_host_os @host_os@
|
||||
@@ -1095,7 +1115,9 @@ package or when debugging this package.\
|
||||
@@ -1119,7 +1139,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
|
||||
-%arm armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl armv8l armv8hl armv8hnl armv8hcnl
|
||||
+%arm armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl armv8l armv8hl armv8hnl armv8hcnl
|
||||
+%arml armv3l armv4l armv5l armv5tel armv6l armv6hl armv7l armv7hl armv7hnl armv8l armv8hl armv8hnl armv8hcnl
|
||||
+%armb armv4b armv5b armv5teb
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -1,17 +0,0 @@
|
||||
--- scripts/mono-find-requires
|
||||
+++ scripts/mono-find-requires
|
||||
@@ -42,8 +42,12 @@
|
||||
(START==1) && /^\tName=/ {
|
||||
sub(/Name=/, "", $1);
|
||||
LIBNAME=$1
|
||||
-
|
||||
- print "mono(" LIBNAME ") = " VERSION
|
||||
+ # Allow rpm deps to be resolved for 1.0 profile version
|
||||
+ if (VERSION=="1.0.3300.0")
|
||||
+ OP=">="
|
||||
+ else
|
||||
+ OP="="
|
||||
+ print "mono(" LIBNAME ") " OP " " VERSION
|
||||
START=0
|
||||
}
|
||||
') 2> /dev/null
|
@ -1,39 +0,0 @@
|
||||
Also compare the name/arch and not only the version when checking if
|
||||
two packages are the same. rh#104066
|
||||
|
||||
--- ./lib/depends.c.orig 2014-06-26 06:51:54.163820067 +0000
|
||||
+++ ./lib/depends.c 2014-08-04 12:22:24.030575105 +0000
|
||||
@@ -158,6 +158,24 @@ static int skipColor(rpm_color_t tscolor
|
||||
return tscolor && color && ocolor && !(color & ocolor);
|
||||
}
|
||||
|
||||
+static int rpmNameVersionCompare(Header first, Header second)
|
||||
+{
|
||||
+ const char * one, * two;
|
||||
+ int rc;
|
||||
+
|
||||
+ one = headerGetString(first, RPMTAG_NAME);
|
||||
+ two = headerGetString(second, RPMTAG_NAME);
|
||||
+ rc = strcmp(one, two);
|
||||
+ if (rc)
|
||||
+ return rc;
|
||||
+ one = headerGetString(first, RPMTAG_ARCH);
|
||||
+ two = headerGetString(second, RPMTAG_ARCH);
|
||||
+ rc = strcmp(one, two);
|
||||
+ if (rc)
|
||||
+ return rc;
|
||||
+ return rpmVersionCompare(first, second);
|
||||
+}
|
||||
+
|
||||
/* Add erase elements for older packages of same color (if any). */
|
||||
static int addSelfErasures(rpmts ts, rpm_color_t tscolor, int op,
|
||||
rpmte p, rpm_color_t hcolor, Header h)
|
||||
@@ -172,7 +190,7 @@ static int addSelfErasures(rpmts ts, rpm
|
||||
if (skipColor(tscolor, hcolor, headerGetNumber(oh, RPMTAG_HEADERCOLOR)))
|
||||
continue;
|
||||
|
||||
- cmp = rpmVersionCompare(h, oh);
|
||||
+ cmp = rpmNameVersionCompare(h, oh);
|
||||
|
||||
/* On upgrade, skip packages that contain identical NEVR. */
|
||||
if ((op == RPMTE_UPGRADE) && (cmp == 0))
|
@ -1,13 +1,13 @@
|
||||
Don't let rpm complain about a missing /etc/magic.mgc file
|
||||
|
||||
--- build/rpmfc.c.orig 2013-07-12 12:16:40.000000000 +0000
|
||||
+++ build/rpmfc.c 2013-07-12 12:17:15.000000000 +0000
|
||||
@@ -901,7 +901,7 @@ static int initAttrs(rpmfc fc)
|
||||
--- ./build/rpmfc.c.orig 2019-10-02 11:41:15.063357579 +0000
|
||||
+++ ./build/rpmfc.c 2019-10-02 11:41:42.583298884 +0000
|
||||
@@ -1065,7 +1065,7 @@ static int initAttrs(rpmfc fc)
|
||||
|
||||
rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
|
||||
{
|
||||
- int msflags = MAGIC_CHECK | MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS;
|
||||
+ int msflags = MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS;
|
||||
magic_t ms = NULL;
|
||||
int nerrors = 0;
|
||||
rpmRC rc = RPMRC_FAIL;
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
--- ./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_CONFLICTNAME, 0, 0, LEN_AND_STR("conflicts")},
|
||||
{RPMTAG_OBSOLETENAME, 0, 0, LEN_AND_STR("obsoletes")},
|
||||
{RPMTAG_PREFIXES, 0, 0, LEN_AND_STR("prefixes")},
|
||||
@@ -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")},
|
||||
- {RPMTAG_BUILDPREREQ, 0, 1, LEN_AND_STR("buildprereq")},
|
||||
+ {RPMTAG_BUILDPREREQ, 0, 0, LEN_AND_STR("buildprereq")},
|
||||
{RPMTAG_BUILDREQUIRES, 0, 0, LEN_AND_STR("buildrequires")},
|
||||
{RPMTAG_AUTOREQPROV, 0, 0, LEN_AND_STR("autoreqprov")},
|
||||
{RPMTAG_AUTOREQ, 0, 0, LEN_AND_STR("autoreq")},
|
||||
--- ./build/parsePreamble.c.orig 2019-10-02 11:38:15.807736662 +0000
|
||||
+++ ./build/parsePreamble.c 2019-10-02 11:39:12.495617575 +0000
|
||||
@@ -1032,7 +1032,7 @@ static struct PreambleRec_s const preamb
|
||||
{RPMTAG_SUGGESTNAME, 0, 0, 0, LEN_AND_STR("suggests")},
|
||||
{RPMTAG_SUPPLEMENTNAME, 0, 0, 0, LEN_AND_STR("supplements")},
|
||||
{RPMTAG_ENHANCENAME, 0, 0, 0, LEN_AND_STR("enhances")},
|
||||
- {RPMTAG_PREREQ, 2, 1, 0, LEN_AND_STR("prereq")},
|
||||
+ {RPMTAG_PREREQ, 2, 0, 0, LEN_AND_STR("prereq")},
|
||||
{RPMTAG_CONFLICTNAME, 0, 0, 0, LEN_AND_STR("conflicts")},
|
||||
{RPMTAG_OBSOLETENAME, 0, 0, 0, LEN_AND_STR("obsoletes")},
|
||||
{RPMTAG_PREFIXES, 0, 0, 1, LEN_AND_STR("prefixes")},
|
||||
@@ -1041,7 +1041,7 @@ static struct PreambleRec_s const preamb
|
||||
{RPMTAG_BUILDARCHS, 0, 0, 0, LEN_AND_STR("buildarchitectures")},
|
||||
{RPMTAG_BUILDARCHS, 0, 0, 0, LEN_AND_STR("buildarch")},
|
||||
{RPMTAG_BUILDCONFLICTS, 0, 0, 0, LEN_AND_STR("buildconflicts")},
|
||||
- {RPMTAG_BUILDPREREQ, 0, 1, 0, LEN_AND_STR("buildprereq")},
|
||||
+ {RPMTAG_BUILDPREREQ, 0, 0, 0, LEN_AND_STR("buildprereq")},
|
||||
{RPMTAG_BUILDREQUIRES, 0, 0, 0, LEN_AND_STR("buildrequires")},
|
||||
{RPMTAG_AUTOREQPROV, 0, 0, 0, LEN_AND_STR("autoreqprov")},
|
||||
{RPMTAG_AUTOREQ, 0, 0, 0, LEN_AND_STR("autoreq")},
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 2 14:53:19 CEST 2019 - mls@suse.de
|
||||
|
||||
- update to rpm-4.15.0
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 22 09:50:36 UTC 2018 - asmorodskyi@suse.com
|
||||
|
||||
|
@ -1,14 +1,9 @@
|
||||
Also test architecture in "refresh" test when not colored. This allows
|
||||
updates to different architectures.
|
||||
|
||||
--- ./lib/psm.c.orig 2012-03-20 08:07:25.000000000 +0000
|
||||
+++ ./lib/psm.c 2012-06-01 10:22:24.000000000 +0000
|
||||
@@ -680,13 +680,14 @@ void rpmpsmNotify(rpmpsm psm, int what,
|
||||
*/
|
||||
static void markReplacedInstance(rpmts ts, rpmte te)
|
||||
{
|
||||
+ /* this must match rpmNameVersionCompare in depends.c */
|
||||
rpmdbMatchIterator mi = rpmtsInitIterator(ts, RPMDBI_NAME, rpmteN(te), 0);
|
||||
--- ./lib/psm.c.orig 2019-10-02 09:54:56.180565818 +0000
|
||||
+++ ./lib/psm.c 2019-10-02 09:55:02.700552941 +0000
|
||||
@@ -518,9 +518,9 @@ static void markReplacedInstance(rpmts t
|
||||
rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP, rpmteE(te));
|
||||
rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_STRCMP, rpmteV(te));
|
||||
rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP, rpmteR(te));
|
||||
|
@ -1,12 +1,12 @@
|
||||
--- ./macros.in.orig 2011-05-11 15:36:05.000000000 +0000
|
||||
+++ ./macros.in 2011-05-11 15:38:44.000000000 +0000
|
||||
@@ -1027,7 +1027,8 @@ done \
|
||||
# %{perl_sitearch}/Image
|
||||
# %dir %{perl_sitearch}/auto/Image
|
||||
#
|
||||
-%requires_eq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
||||
+%requires_eq() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
||||
+%requires_ge() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} >= %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
||||
%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
|
||||
%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
|
||||
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
|
||||
--- ./macros.in.orig 2019-10-02 11:33:19.956358174 +0000
|
||||
+++ ./macros.in 2019-10-02 11:35:01.496144862 +0000
|
||||
@@ -1312,5 +1312,9 @@ end}
|
||||
%{expand:%__scm_setup_%{__scm} %{!-v:-q}}\
|
||||
%{!-N:%autopatch %{-v} %{-p:-p%{-p*}}}
|
||||
|
||||
+# XXX: to be moved to rpm-config-SUSE
|
||||
+%requires_eq() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
||||
+%requires_ge() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} >= %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
|
||||
+
|
||||
# \endverbatim
|
||||
#*/
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1139c24b7372f89c0a697096bf9809be70ba55e006c23ff47305c1849d98acda
|
||||
size 4156574
|
3
rpm-4.15.0.tar.bz2
Normal file
3
rpm-4.15.0.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1e06723b13591e57c99ebe2006fb8daddc4cf72efb366a64a34673ba5f61c201
|
||||
size 4205632
|
@ -1,7 +1,7 @@
|
||||
--- ./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;
|
||||
--- ./build/pack.c.orig 2019-06-26 14:17:31.395985720 +0000
|
||||
+++ ./build/pack.c 2019-10-02 11:31:05.908639084 +0000
|
||||
@@ -743,11 +743,78 @@ static rpmRC packageBinary(rpmSpec spec,
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static void trimChangelog(Header h)
|
||||
@ -71,18 +71,17 @@
|
||||
+
|
||||
rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
|
||||
{
|
||||
rpmRC rc;
|
||||
@@ -648,6 +713,7 @@ rpmRC packageBinaries(rpmSpec spec, cons
|
||||
rpmRC rc = RPMRC_OK;
|
||||
Package pkg;
|
||||
char *pkglist = NULL;
|
||||
|
||||
+ trimChangelog(spec->packages->header);
|
||||
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
|
||||
char *fn;
|
||||
|
||||
--- ./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
|
||||
+
|
||||
/* Run binary creation in parallel */
|
||||
#pragma omp parallel
|
||||
#pragma omp single
|
||||
--- ./build/parseChangelog.c.orig 2019-06-26 14:17:31.395985720 +0000
|
||||
+++ ./build/parseChangelog.c 2019-10-02 11:29:26.684840735 +0000
|
||||
@@ -253,6 +253,11 @@ static rpmRC addChangelog(Header h, ARGV
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
24
rpm.changes
24
rpm.changes
@ -1,3 +1,27 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 2 14:53:19 CEST 2019 - mls@suse.de
|
||||
|
||||
- update to rpm-4.15.0
|
||||
* dynamic build dependencies
|
||||
* support for %elif, %elifos and %elifarch statements in spec
|
||||
* caret version operator (the opposite of tilde)
|
||||
* new %patchlist and %sourcelist spec sections
|
||||
* new %{expr:#} built-in macro for evaluating expressions
|
||||
* new %dnl macro primitive for comments
|
||||
- dropped patches:
|
||||
* 0001-Stop-papering-over-the-security-disaster-known-as-pr.patch
|
||||
* 0002-Fix-use-after-free-introduced-in-0f21bdd0d7b2c45564d.patch
|
||||
* adopt-language-specific-build_fooflags-macros-from-F.patch
|
||||
* auto-config-update-riscv64.diff
|
||||
* debugedit-macro.diff
|
||||
* dwz-compression.patch
|
||||
* getncpus.diff
|
||||
* nameversioncompare.diff
|
||||
* mono-find-requires.diff
|
||||
* rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch
|
||||
* set-flto=auto-by-default.patch
|
||||
* source_date_epoch_buildtime.diff
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 28 11:17:12 UTC 2019 - Fabian Vogt <fvogt@suse.com>
|
||||
|
||||
|
46
rpm.spec
46
rpm.spec
@ -19,7 +19,7 @@
|
||||
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
||||
%{?!_fillupdir:%define _fillupdir /var/adm/fillup-templates}
|
||||
|
||||
%global librpmsover 8
|
||||
%global librpmsover 9
|
||||
|
||||
Name: rpm
|
||||
BuildRequires: binutils
|
||||
@ -57,7 +57,7 @@ Requires: /usr/bin/awk
|
||||
Summary: The RPM Package Manager
|
||||
License: GPL-2.0-or-later
|
||||
Group: System/Packages
|
||||
Version: 4.14.2.1
|
||||
Version: 4.15.0
|
||||
Release: 0
|
||||
URL: https://rpm.org/
|
||||
#Git-Clone: https://github.com/rpm-software-management/rpm
|
||||
@ -79,7 +79,6 @@ Patch5: usr-lib-sysimage-rpm.patch
|
||||
Patch11: debugedit.diff
|
||||
Patch13: ignore-auxv.diff
|
||||
Patch12: localetag.diff
|
||||
Patch14: nameversioncompare.diff
|
||||
Patch15: dbfsync.diff
|
||||
Patch16: dbrointerruptable.diff
|
||||
Patch18: refreshtestarch.diff
|
||||
@ -116,7 +115,6 @@ Patch69: nobuildcolor.diff
|
||||
Patch70: fileattrs.diff
|
||||
Patch71: nomagiccheck.diff
|
||||
Patch73: assumeexec.diff
|
||||
Patch74: mono-find-requires.diff
|
||||
Patch75: rpm-deptracking.patch
|
||||
Patch77: langnoc.diff
|
||||
Patch78: headerchk2.diff
|
||||
@ -127,19 +125,10 @@ Patch99: enable-postin-scripts-error.diff
|
||||
Patch100: rpm-findlang-inject-metainfo.patch
|
||||
Patch102: emptymanifest.diff
|
||||
Patch103: find-lang-qt-qm.patch
|
||||
Patch108: debugedit-macro.diff
|
||||
Patch109: pythondistdeps.diff
|
||||
Patch114: source_date_epoch_buildtime.diff
|
||||
Patch117: findsupplements.diff
|
||||
Patch118: dwz-compression.patch
|
||||
Patch119: getncpus.diff
|
||||
Patch120: rpmfc-push-name-epoch-version-release-macro-before-invoking-depgens.patch
|
||||
Patch121: adopt-language-specific-build_fooflags-macros-from-F.patch
|
||||
Patch122: 0001-Stop-papering-over-the-security-disaster-known-as-pr.patch
|
||||
Patch123: 0002-Fix-use-after-free-introduced-in-0f21bdd0d7b2c45564d.patch
|
||||
Patch124: set-flto=auto-by-default.patch
|
||||
Patch118: fix_lua_cflags.diff
|
||||
Patch6464: auto-config-update-aarch64-ppc64le.diff
|
||||
Patch6465: auto-config-update-riscv64.diff
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
#
|
||||
# avoid bootstrapping problem
|
||||
@ -234,29 +223,22 @@ 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 18
|
||||
%patch -P 11 -P 12 -P 13 -P 15 -P 16 -P 18
|
||||
%patch -P 20 -P 21 -P 24 -P 25 -P 26 -P 27 -P 29
|
||||
%patch -P 30 -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 51 -P 55 -P 56 -P 57 -P 58
|
||||
%patch -P 60 -P 61 -P 66 -P 67 -P 68 -P 69
|
||||
%patch -P 70 -P 71 -P 73 -P 74 -P 75 -P 77 -P 78
|
||||
%patch -P 70 -P 71 -P 73 -P 75 -P 77 -P 78
|
||||
%patch -P 85
|
||||
%patch -P 93 -P 94 -P 99
|
||||
%patch -P 100 -P 102 -P 103 -P 108
|
||||
%patch -P 109 -P 114 -P 117 -P 118
|
||||
%patch -P 119 -P 120
|
||||
%patch121 -p1
|
||||
%patch122 -p1
|
||||
%patch123 -p1
|
||||
%patch124 -p1
|
||||
%patch -P 100 -P 102 -P 103
|
||||
%patch -P 109 -P 117
|
||||
%patch -P 118
|
||||
|
||||
%ifarch aarch64 ppc64le riscv64
|
||||
%patch6464
|
||||
%endif
|
||||
%ifarch riscv64
|
||||
%patch6465
|
||||
%endif
|
||||
|
||||
cp config.guess config.sub db/dist/
|
||||
cp config.guess config.sub beecrypt/
|
||||
@ -286,13 +268,17 @@ popd
|
||||
|
||||
autoreconf -fi
|
||||
./configure --disable-dependency-tracking --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
|
||||
--libdir=%{_libdir} --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --with-lua \
|
||||
--without-external-db \
|
||||
--libdir=%{_libdir} --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib \
|
||||
--with-lua \
|
||||
--with-vendor=suse \
|
||||
--with-rundir=/run \
|
||||
--without-archive \
|
||||
--with-selinux --with-internal-beecrypt \
|
||||
--with-acl --with-cap --enable-shared %{?with_python: --enable-python} $BUILDTARGET
|
||||
--with-selinux \
|
||||
--with-internal-beecrypt \
|
||||
--with-acl \
|
||||
--with-cap \
|
||||
--enable-zstd \
|
||||
--enable-shared %{?with_python: --enable-python} $BUILDTARGET
|
||||
|
||||
rm po/de.gmo
|
||||
make %{?_smp_mflags}
|
||||
|
@ -1,58 +0,0 @@
|
||||
From 0d2176c9a3ae44fd0a67c9983b1a5ba0a00388fd Mon Sep 17 00:00:00 2001
|
||||
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
Date: Mon, 15 Oct 2018 19:49:57 +0200
|
||||
Subject: [PATCH] rpmfc: push name/epoch/version/release macro before invoking
|
||||
depgens
|
||||
|
||||
Fixes: https://github.com/rpm-software-management/rpm/issues/502
|
||||
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||
---
|
||||
build/rpmfc.c | 25 +++++++++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
diff --git build/rpmfc.c build/rpmfc.c
|
||||
index 2fbfc69ab..eccd6582a 100644
|
||||
--- build/rpmfc.c
|
||||
+++ build/rpmfc.c
|
||||
@@ -1334,9 +1334,31 @@ static rpmRC rpmfcApplyExternal(rpmfc fc)
|
||||
return rc;
|
||||
}
|
||||
|
||||
+typedef const struct macroExport_s {
|
||||
+ const char * name;
|
||||
+ rpmTagVal tag;
|
||||
+} * macroExport;
|
||||
+
|
||||
+static struct macroExport_s const macroExportList[] = {
|
||||
+ { "name", RPMTAG_NAME },
|
||||
+ { "epoch", RPMTAG_EPOCH },
|
||||
+ { "version", RPMTAG_VERSION },
|
||||
+ { "release", RPMTAG_RELEASE },
|
||||
+ { NULL, 0 }
|
||||
+};
|
||||
+
|
||||
rpmRC rpmfcApply(rpmfc fc)
|
||||
{
|
||||
rpmRC rc;
|
||||
+ Package pkg = fc->pkg;
|
||||
+ macroExport me;
|
||||
+ for (me = macroExportList; me->name; me++) {
|
||||
+ char *val = headerGetAsString(pkg->header, me->tag);
|
||||
+ if (val) {
|
||||
+ rpmPushMacro(NULL, me->name, NULL, val, RMIL_SPEC);
|
||||
+ free(val);
|
||||
+ }
|
||||
+ }
|
||||
/* If new-fangled dependency generation is disabled ... */
|
||||
if (!rpmExpandNumeric("%{?_use_internal_dependency_generator}")) {
|
||||
/* ... then generate dependencies using %{__find_requires} et al. */
|
||||
@@ -1347,6 +1369,9 @@ rpmRC rpmfcApply(rpmfc fc)
|
||||
/* ... otherwise generate per-file dependencies */
|
||||
rc = rpmfcApplyInternal(fc);
|
||||
}
|
||||
+ for (me = macroExportList; me->name; me++)
|
||||
+ if (headerIsEntry(pkg->header, me->tag))
|
||||
+ rpmPopMacro(NULL, me->name);
|
||||
return rc;
|
||||
}
|
||||
|
35
rpmrc.diff
35
rpmrc.diff
@ -1,5 +1,5 @@
|
||||
--- ./rpmrc.in.orig 2017-10-05 10:04:57.571602038 +0000
|
||||
+++ ./rpmrc.in 2017-12-01 15:03:23.956144776 +0000
|
||||
--- ./rpmrc.in.orig 2019-06-26 14:17:31.451985635 +0000
|
||||
+++ ./rpmrc.in 2019-10-02 11:24:49.601403844 +0000
|
||||
@@ -12,16 +12,16 @@
|
||||
# "fat" binary with both archs, for Darwin
|
||||
optflags: fat -O2 -g -arch i386 -arch ppc
|
||||
@ -65,9 +65,9 @@
|
||||
-optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16
|
||||
+optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mthumb -mabi=aapcs-linux
|
||||
optflags: armv7hnl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=neon
|
||||
|
||||
optflags: m68k -O2 -g -fomit-frame-pointer
|
||||
@@ -91,8 +92,8 @@ optflags: atariclone -O2 -g -fomit-frame
|
||||
optflags: armv8l -O2 -g -march=armv8-a
|
||||
optflags: armv8hl -O2 -g -march=armv8-a -mfloat-abi=hard -mfpu=vfpv4
|
||||
@@ -95,8 +96,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
|
||||
@@ -288,17 +289,17 @@ os_canon: MacOSX: macosx 21
|
||||
@@ -300,17 +301,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
|
||||
|
||||
@@ -320,6 +321,7 @@ buildarchtranslate: sparc64v: sparc64
|
||||
@@ -332,6 +333,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
|
||||
@@ -381,6 +383,15 @@ buildarchtranslate: aarch64: aarch64
|
||||
@@ -398,6 +400,15 @@ buildarchtranslate: arm64: aarch64
|
||||
buildarchtranslate: riscv: riscv64
|
||||
buildarchtranslate: riscv64: riscv64
|
||||
|
||||
@ -128,7 +128,7 @@
|
||||
#############################################################
|
||||
# Architecture compatibility
|
||||
|
||||
@@ -445,15 +456,21 @@ arch_compat: mips64r6el: mipsr6el
|
||||
@@ -462,16 +473,20 @@ arch_compat: mips64r6el: mipsr6el
|
||||
arch_compat: hppa2.0: hppa1.2
|
||||
arch_compat: hppa1.2: hppa1.1
|
||||
arch_compat: hppa1.1: hppa1.0
|
||||
@ -140,9 +140,8 @@
|
||||
+arch_compat: armv5teb: armv5b
|
||||
+arch_compat: armv5b: armv4b
|
||||
arch_compat: armv4b: noarch
|
||||
+arch_compat: armv7hl: armv7l
|
||||
arch_compat: armv8l: armv7l
|
||||
arch_compat: armv7l: armv6l
|
||||
+arch_compat: armv6hl: armv6l
|
||||
arch_compat: armv6l: armv5tejl
|
||||
arch_compat: armv5tejl: armv5tel
|
||||
arch_compat: armv5tel: armv5tl
|
||||
@ -152,7 +151,7 @@
|
||||
arch_compat: armv4tl: armv4l
|
||||
arch_compat: armv4l: armv3l
|
||||
arch_compat: armv3l: noarch
|
||||
@@ -475,7 +492,7 @@ arch_compat: i370: noarch
|
||||
@@ -497,7 +512,7 @@ arch_compat: i370: noarch
|
||||
arch_compat: s390: noarch
|
||||
arch_compat: s390x: s390 noarch
|
||||
|
||||
@ -161,17 +160,7 @@
|
||||
|
||||
arch_compat: x86_64: amd64 em64t athlon noarch
|
||||
arch_compat: amd64: x86_64 em64t athlon noarch
|
||||
@@ -578,7 +595,9 @@ buildarch_compat: mips64r6: noarch
|
||||
buildarch_compat: mips64r6el: noarch
|
||||
|
||||
buildarch_compat: armv4b: noarch
|
||||
+buildarch_compat: armv7hl: armv7l
|
||||
buildarch_compat: armv7l: armv6l
|
||||
+buildarch_compat: armv6hl: armv6l
|
||||
buildarch_compat: armv6l: armv5tejl
|
||||
buildarch_compat: armv5tejl: armv5tel armv5tl
|
||||
buildarch_compat: armv5tel: armv4tl armv5tl
|
||||
@@ -594,7 +613,8 @@ buildarch_compat: armv6hl: noarch
|
||||
@@ -623,7 +638,8 @@ buildarch_compat: armv6hl: noarch
|
||||
buildarch_compat: hppa2.0: hppa1.2
|
||||
buildarch_compat: hppa1.2: hppa1.1
|
||||
buildarch_compat: hppa1.1: hppa1.0
|
||||
|
425
safeugid.diff
425
safeugid.diff
@ -1,211 +1,214 @@
|
||||
--- ./lib/rpmchroot.c.orig 2012-11-07 12:55:24.000000000 +0000
|
||||
+++ ./lib/rpmchroot.c 2014-02-20 12:50:05.360815211 +0000
|
||||
@@ -66,6 +66,7 @@ int rpmChrootIn(void)
|
||||
} else if (rootState.chrootDone == 0) {
|
||||
if (chdir("/") == 0 && chroot(rootState.rootDir) == 0) {
|
||||
rootState.chrootDone = 1;
|
||||
+ rpmugChroot(1);
|
||||
} else {
|
||||
rpmlog(RPMLOG_ERR, _("Unable to change root directory: %m\n"));
|
||||
rc = -1;
|
||||
@@ -91,6 +92,7 @@ int rpmChrootOut(void)
|
||||
} else if (rootState.chrootDone == 1) {
|
||||
if (chroot(".") == 0 && fchdir(rootState.cwd) == 0) {
|
||||
rootState.chrootDone = 0;
|
||||
+ rpmugChroot(0);
|
||||
} else {
|
||||
rpmlog(RPMLOG_ERR, _("Unable to restore root directory: %m\n"));
|
||||
rc = -1;
|
||||
--- ./lib/rpmug.c.orig 2014-02-05 13:04:37.000000000 +0000
|
||||
+++ ./lib/rpmug.c 2014-02-20 12:50:05.361815211 +0000
|
||||
@@ -10,6 +10,47 @@
|
||||
#include "lib/rpmug.h"
|
||||
#include "debug.h"
|
||||
|
||||
+#if defined(__GLIBC__)
|
||||
+
|
||||
+static int inchroot;
|
||||
+
|
||||
+/*
|
||||
+ * Unfortunatelly glibc caches nss/nscd data and there is no
|
||||
+ * good way to flush those caches when we did a chroot(). Thus
|
||||
+ * we need to parse /etc/passwd and /etc/group ourselfs.
|
||||
+ */
|
||||
+static int safe_lookup(const char * file, const char * name)
|
||||
+{
|
||||
+ FILE *fp;
|
||||
+ int l;
|
||||
+ char buf[4096], *p;
|
||||
+
|
||||
+ if (!name || !*name)
|
||||
+ return -1;
|
||||
+ l = strlen(name);
|
||||
+ if ((fp = fopen(file, "r")) == 0)
|
||||
+ return -1;
|
||||
+ while ((p = fgets(buf, sizeof(buf), fp)) != 0) {
|
||||
+ if (*p == '#')
|
||||
+ continue;
|
||||
+ while (*p && (*p == ' ' || *p == '\t'))
|
||||
+ p++;
|
||||
+ if (strncmp(p, name, l) != 0 || p[l] != ':')
|
||||
+ continue;
|
||||
+ p = strchr(p + l + 1, ':');
|
||||
+ if (!p)
|
||||
+ continue;
|
||||
+ fclose(fp);
|
||||
+ p++;
|
||||
+ while (*p && (*p == ' ' || *p == '\t'))
|
||||
+ p++;
|
||||
+ return atoi(p);
|
||||
+ }
|
||||
+ fclose(fp);
|
||||
+ return -1;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* These really ought to use hash tables. I just made the
|
||||
* guess that most files would be owned by root or the same person/group
|
||||
@@ -43,17 +84,28 @@ int rpmugUid(const char * thisUname, uid
|
||||
lastUnameAlloced = thisUnameLen + 10;
|
||||
lastUname = xrealloc(lastUname, lastUnameAlloced); /* XXX memory leak */
|
||||
}
|
||||
- strcpy(lastUname, thisUname);
|
||||
|
||||
- pwent = getpwnam(thisUname);
|
||||
- if (pwent == NULL) {
|
||||
- /* FIX: shrug */
|
||||
- endpwent();
|
||||
+#if defined(__GLIBC__)
|
||||
+ if (inchroot) {
|
||||
+ int uid = safe_lookup("/etc/passwd", thisUname);
|
||||
+ if (uid < 0)
|
||||
+ return -1;
|
||||
+ lastUid = uid;
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
pwent = getpwnam(thisUname);
|
||||
- if (pwent == NULL) return -1;
|
||||
+ if (pwent == NULL) {
|
||||
+ /* FIX: shrug */
|
||||
+ endpwent();
|
||||
+ pwent = getpwnam(thisUname);
|
||||
+ if (pwent == NULL) return -1;
|
||||
+ }
|
||||
+ lastUid = pwent->pw_uid;
|
||||
}
|
||||
|
||||
- lastUid = pwent->pw_uid;
|
||||
+ strcpy(lastUname, thisUname);
|
||||
+ lastUnameLen = thisUnameLen;
|
||||
}
|
||||
|
||||
*uid = lastUid;
|
||||
@@ -86,18 +138,29 @@ int rpmugGid(const char * thisGname, gid
|
||||
lastGnameAlloced = thisGnameLen + 10;
|
||||
lastGname = xrealloc(lastGname, lastGnameAlloced); /* XXX memory leak */
|
||||
}
|
||||
- strcpy(lastGname, thisGname);
|
||||
|
||||
- grent = getgrnam(thisGname);
|
||||
- if (grent == NULL) {
|
||||
- /* FIX: shrug */
|
||||
- endgrent();
|
||||
+#if defined(__GLIBC__)
|
||||
+ if (inchroot) {
|
||||
+ int gid = safe_lookup("/etc/group", thisGname);
|
||||
+ if (gid < 0)
|
||||
+ return -1;
|
||||
+ lastGid = gid;
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
grent = getgrnam(thisGname);
|
||||
if (grent == NULL) {
|
||||
- return -1;
|
||||
+ /* FIX: shrug */
|
||||
+ endgrent();
|
||||
+ grent = getgrnam(thisGname);
|
||||
+ if (grent == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
+ lastGid = grent->gr_gid;
|
||||
}
|
||||
- lastGid = grent->gr_gid;
|
||||
+ strcpy(lastGname, thisGname);
|
||||
+ lastGnameLen = thisGnameLen;
|
||||
}
|
||||
|
||||
*gid = lastGid;
|
||||
@@ -109,7 +172,7 @@ const char * rpmugUname(uid_t uid)
|
||||
{
|
||||
static uid_t lastUid = (uid_t) -1;
|
||||
static char * lastUname = NULL;
|
||||
- static size_t lastUnameLen = 0;
|
||||
+ static size_t lastUnameAlloced = 0;
|
||||
|
||||
if (uid == (uid_t) -1) {
|
||||
lastUid = (uid_t) -1;
|
||||
@@ -126,9 +189,9 @@ const char * rpmugUname(uid_t uid)
|
||||
|
||||
lastUid = uid;
|
||||
len = strlen(pwent->pw_name);
|
||||
- if (lastUnameLen < len + 1) {
|
||||
- lastUnameLen = len + 20;
|
||||
- lastUname = xrealloc(lastUname, lastUnameLen);
|
||||
+ if (lastUnameAlloced < len + 1) {
|
||||
+ lastUnameAlloced = len + 20;
|
||||
+ lastUname = xrealloc(lastUname, lastUnameAlloced);
|
||||
}
|
||||
strcpy(lastUname, pwent->pw_name);
|
||||
|
||||
@@ -140,7 +203,7 @@ const char * rpmugGname(gid_t gid)
|
||||
{
|
||||
static gid_t lastGid = (gid_t) -1;
|
||||
static char * lastGname = NULL;
|
||||
- static size_t lastGnameLen = 0;
|
||||
+ static size_t lastGnameAlloced = 0;
|
||||
|
||||
if (gid == (gid_t) -1) {
|
||||
lastGid = (gid_t) -1;
|
||||
@@ -157,9 +220,9 @@ const char * rpmugGname(gid_t gid)
|
||||
|
||||
lastGid = gid;
|
||||
len = strlen(grent->gr_name);
|
||||
- if (lastGnameLen < len + 1) {
|
||||
- lastGnameLen = len + 20;
|
||||
- lastGname = xrealloc(lastGname, lastGnameLen);
|
||||
+ if (lastGnameAlloced < len + 1) {
|
||||
+ lastGnameAlloced = len + 20;
|
||||
+ lastGname = xrealloc(lastGname, lastGnameAlloced);
|
||||
}
|
||||
strcpy(lastGname, grent->gr_name);
|
||||
|
||||
@@ -189,3 +252,16 @@ void rpmugFree(void)
|
||||
rpmugUname(-1);
|
||||
rpmugGname(-1);
|
||||
}
|
||||
+
|
||||
+void rpmugChroot(int in)
|
||||
+{
|
||||
+ /* tell libc to drop caches / file descriptors */
|
||||
+ endpwent();
|
||||
+ endgrent();
|
||||
+ /* drop our own caches */
|
||||
+ rpmugUid(NULL, NULL);
|
||||
+ rpmugGid(NULL, NULL);
|
||||
+#if defined(__GLIBC__)
|
||||
+ inchroot = in;
|
||||
+#endif
|
||||
+}
|
||||
--- ./lib/rpmug.h.orig 2014-02-05 13:04:02.000000000 +0000
|
||||
+++ ./lib/rpmug.h 2014-02-20 12:50:05.362815211 +0000
|
||||
@@ -15,4 +15,6 @@ int rpmugInit(void);
|
||||
|
||||
void rpmugFree(void);
|
||||
|
||||
+void rpmugChroot(int in);
|
||||
+
|
||||
#endif /* _RPMUG_H */
|
||||
--- ../safeugid.diff 2019-10-02 13:37:13.191868203 +0200
|
||||
+++ P 2019-10-02 13:36:09.036002978 +0200
|
||||
@@ -0,0 +1,211 @@
|
||||
+--- ./lib/rpmchroot.c.orig 2019-06-26 14:17:31.411985696 +0000
|
||||
++++ ./lib/rpmchroot.c 2019-10-02 11:35:58.788024507 +0000
|
||||
+@@ -126,6 +126,7 @@ int rpmChrootIn(void)
|
||||
+
|
||||
+ if (chdir("/") == 0 && chroot(rootState.rootDir) == 0) {
|
||||
+ rootState.chrootDone = 1;
|
||||
++ rpmugChroot(1);
|
||||
+ } else {
|
||||
+ rpmlog(RPMLOG_ERR, _("Unable to change root directory: %m\n"));
|
||||
+ rc = -1;
|
||||
+@@ -151,6 +152,7 @@ int rpmChrootOut(void)
|
||||
+ } else if (rootState.chrootDone == 1) {
|
||||
+ if (chroot(".") == 0 && fchdir(rootState.cwd) == 0) {
|
||||
+ rootState.chrootDone = 0;
|
||||
++ rpmugChroot(0);
|
||||
+ } else {
|
||||
+ rpmlog(RPMLOG_ERR, _("Unable to restore root directory: %m\n"));
|
||||
+ rc = -1;
|
||||
+--- ./lib/rpmug.c.orig 2019-06-26 14:17:31.418985685 +0000
|
||||
++++ ./lib/rpmug.c 2019-10-02 11:35:58.788024507 +0000
|
||||
+@@ -11,6 +11,47 @@
|
||||
+ #include "lib/rpmug.h"
|
||||
+ #include "debug.h"
|
||||
+
|
||||
++#if defined(__GLIBC__)
|
||||
++
|
||||
++static int inchroot;
|
||||
++
|
||||
++/*
|
||||
++ * Unfortunatelly glibc caches nss/nscd data and there is no
|
||||
++ * good way to flush those caches when we did a chroot(). Thus
|
||||
++ * we need to parse /etc/passwd and /etc/group ourselfs.
|
||||
++ */
|
||||
++static int safe_lookup(const char * file, const char * name)
|
||||
++{
|
||||
++ FILE *fp;
|
||||
++ int l;
|
||||
++ char buf[4096], *p;
|
||||
++
|
||||
++ if (!name || !*name)
|
||||
++ return -1;
|
||||
++ l = strlen(name);
|
||||
++ if ((fp = fopen(file, "r")) == 0)
|
||||
++ return -1;
|
||||
++ while ((p = fgets(buf, sizeof(buf), fp)) != 0) {
|
||||
++ if (*p == '#')
|
||||
++ continue;
|
||||
++ while (*p && (*p == ' ' || *p == '\t'))
|
||||
++ p++;
|
||||
++ if (strncmp(p, name, l) != 0 || p[l] != ':')
|
||||
++ continue;
|
||||
++ p = strchr(p + l + 1, ':');
|
||||
++ if (!p)
|
||||
++ continue;
|
||||
++ fclose(fp);
|
||||
++ p++;
|
||||
++ while (*p && (*p == ' ' || *p == '\t'))
|
||||
++ p++;
|
||||
++ return atoi(p);
|
||||
++ }
|
||||
++ fclose(fp);
|
||||
++ return -1;
|
||||
++}
|
||||
++#endif
|
||||
++
|
||||
+ /*
|
||||
+ * These really ought to use hash tables. I just made the
|
||||
+ * guess that most files would be owned by root or the same person/group
|
||||
+@@ -44,17 +85,28 @@ int rpmugUid(const char * thisUname, uid
|
||||
+ lastUnameAlloced = thisUnameLen + 10;
|
||||
+ lastUname = xrealloc(lastUname, lastUnameAlloced); /* XXX memory leak */
|
||||
+ }
|
||||
+- strcpy(lastUname, thisUname);
|
||||
+
|
||||
+- pwent = getpwnam(thisUname);
|
||||
+- if (pwent == NULL) {
|
||||
+- /* FIX: shrug */
|
||||
+- endpwent();
|
||||
++#if defined(__GLIBC__)
|
||||
++ if (inchroot) {
|
||||
++ int uid = safe_lookup("/etc/passwd", thisUname);
|
||||
++ if (uid < 0)
|
||||
++ return -1;
|
||||
++ lastUid = uid;
|
||||
++ } else
|
||||
++#endif
|
||||
++ {
|
||||
+ pwent = getpwnam(thisUname);
|
||||
+- if (pwent == NULL) return -1;
|
||||
++ if (pwent == NULL) {
|
||||
++ /* FIX: shrug */
|
||||
++ endpwent();
|
||||
++ pwent = getpwnam(thisUname);
|
||||
++ if (pwent == NULL) return -1;
|
||||
++ }
|
||||
++ lastUid = pwent->pw_uid;
|
||||
+ }
|
||||
+
|
||||
+- lastUid = pwent->pw_uid;
|
||||
++ strcpy(lastUname, thisUname);
|
||||
++ lastUnameLen = thisUnameLen;
|
||||
+ }
|
||||
+
|
||||
+ *uid = lastUid;
|
||||
+@@ -87,18 +139,29 @@ int rpmugGid(const char * thisGname, gid
|
||||
+ lastGnameAlloced = thisGnameLen + 10;
|
||||
+ lastGname = xrealloc(lastGname, lastGnameAlloced); /* XXX memory leak */
|
||||
+ }
|
||||
+- strcpy(lastGname, thisGname);
|
||||
+
|
||||
+- grent = getgrnam(thisGname);
|
||||
+- if (grent == NULL) {
|
||||
+- /* FIX: shrug */
|
||||
+- endgrent();
|
||||
++#if defined(__GLIBC__)
|
||||
++ if (inchroot) {
|
||||
++ int gid = safe_lookup("/etc/group", thisGname);
|
||||
++ if (gid < 0)
|
||||
++ return -1;
|
||||
++ lastGid = gid;
|
||||
++ } else
|
||||
++#endif
|
||||
++ {
|
||||
+ grent = getgrnam(thisGname);
|
||||
+ if (grent == NULL) {
|
||||
+- return -1;
|
||||
++ /* FIX: shrug */
|
||||
++ endgrent();
|
||||
++ grent = getgrnam(thisGname);
|
||||
++ if (grent == NULL) {
|
||||
++ return -1;
|
||||
++ }
|
||||
+ }
|
||||
++ lastGid = grent->gr_gid;
|
||||
+ }
|
||||
+- lastGid = grent->gr_gid;
|
||||
++ strcpy(lastGname, thisGname);
|
||||
++ lastGnameLen = thisGnameLen;
|
||||
+ }
|
||||
+
|
||||
+ *gid = lastGid;
|
||||
+@@ -110,7 +173,7 @@ const char * rpmugUname(uid_t uid)
|
||||
+ {
|
||||
+ static uid_t lastUid = (uid_t) -1;
|
||||
+ static char * lastUname = NULL;
|
||||
+- static size_t lastUnameLen = 0;
|
||||
++ static size_t lastUnameAlloced = 0;
|
||||
+
|
||||
+ if (uid == (uid_t) -1) {
|
||||
+ lastUid = (uid_t) -1;
|
||||
+@@ -127,9 +190,9 @@ const char * rpmugUname(uid_t uid)
|
||||
+
|
||||
+ lastUid = uid;
|
||||
+ len = strlen(pwent->pw_name);
|
||||
+- if (lastUnameLen < len + 1) {
|
||||
+- lastUnameLen = len + 20;
|
||||
+- lastUname = xrealloc(lastUname, lastUnameLen);
|
||||
++ if (lastUnameAlloced < len + 1) {
|
||||
++ lastUnameAlloced = len + 20;
|
||||
++ lastUname = xrealloc(lastUname, lastUnameAlloced);
|
||||
+ }
|
||||
+ strcpy(lastUname, pwent->pw_name);
|
||||
+
|
||||
+@@ -141,7 +204,7 @@ const char * rpmugGname(gid_t gid)
|
||||
+ {
|
||||
+ static gid_t lastGid = (gid_t) -1;
|
||||
+ static char * lastGname = NULL;
|
||||
+- static size_t lastGnameLen = 0;
|
||||
++ static size_t lastGnameAlloced = 0;
|
||||
+
|
||||
+ if (gid == (gid_t) -1) {
|
||||
+ lastGid = (gid_t) -1;
|
||||
+@@ -158,9 +221,9 @@ const char * rpmugGname(gid_t gid)
|
||||
+
|
||||
+ lastGid = gid;
|
||||
+ len = strlen(grent->gr_name);
|
||||
+- if (lastGnameLen < len + 1) {
|
||||
+- lastGnameLen = len + 20;
|
||||
+- lastGname = xrealloc(lastGname, lastGnameLen);
|
||||
++ if (lastGnameAlloced < len + 1) {
|
||||
++ lastGnameAlloced = len + 20;
|
||||
++ lastGname = xrealloc(lastGname, lastGnameAlloced);
|
||||
+ }
|
||||
+ strcpy(lastGname, grent->gr_name);
|
||||
+
|
||||
+@@ -192,3 +255,16 @@ void rpmugFree(void)
|
||||
+ rpmugUname(-1);
|
||||
+ rpmugGname(-1);
|
||||
+ }
|
||||
++
|
||||
++void rpmugChroot(int in)
|
||||
++{
|
||||
++ /* tell libc to drop caches / file descriptors */
|
||||
++ endpwent();
|
||||
++ endgrent();
|
||||
++ /* drop our own caches */
|
||||
++ rpmugUid(NULL, NULL);
|
||||
++ rpmugGid(NULL, NULL);
|
||||
++#if defined(__GLIBC__)
|
||||
++ inchroot = in;
|
||||
++#endif
|
||||
++}
|
||||
+--- ./lib/rpmug.h.orig 2019-06-26 14:17:31.418985685 +0000
|
||||
++++ ./lib/rpmug.h 2019-10-02 11:35:58.788024507 +0000
|
||||
+@@ -15,4 +15,6 @@ int rpmugInit(void);
|
||||
+
|
||||
+ void rpmugFree(void);
|
||||
+
|
||||
++void rpmugChroot(int in);
|
||||
++
|
||||
+ #endif /* _RPMUG_H */
|
||||
|
@ -1,13 +0,0 @@
|
||||
diff --git a/platform.in b/platform.in
|
||||
index fa3921f..cff01e1 100644
|
||||
--- a/platform.in
|
||||
+++ b/platform.in
|
||||
@@ -60,7 +60,7 @@
|
||||
%_smp_mflags -j%{_smp_build_ncpus}
|
||||
|
||||
# Enable LTO optimization with a maximal parallelism
|
||||
-%_lto_cflags -flto=%{_smp_build_ncpus}
|
||||
+%_lto_cflags -flto=auto
|
||||
|
||||
#==============================================================================
|
||||
# ---- Build policy macros.
|
@ -1,11 +0,0 @@
|
||||
--- ./build/pack.c.orig 2018-03-27 12:21:03.036841297 +0000
|
||||
+++ ./build/pack.c 2018-03-27 12:29:56.050400820 +0000
|
||||
@@ -161,7 +161,7 @@ static rpm_time_t * getBuildTime(void)
|
||||
|
||||
if (buildTime[0] == 0) {
|
||||
srcdate = getenv("SOURCE_DATE_EPOCH");
|
||||
- if (srcdate) {
|
||||
+ if (srcdate && rpmExpandNumeric("%{?use_source_date_epoch_as_buildtime}")) {
|
||||
errno = 0;
|
||||
epoch = strtol(srcdate, &endptr, 10);
|
||||
if (srcdate == endptr || *endptr || errno != 0)
|
@ -2,8 +2,8 @@ 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-12-01 14:27:03.193486711 +0000
|
||||
+++ ./lib/backend/db3.c 2017-12-01 14:27:23.747426200 +0000
|
||||
--- ./lib/backend/db3.c.orig 2019-10-02 09:56:46.416347458 +0000
|
||||
+++ ./lib/backend/db3.c 2019-10-02 09:56:52.084335992 +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-12-01 14:27:03.193486711 +0000
|
||||
+++ ./lib/backend/dbi.h 2017-12-01 14:27:23.747426200 +0000
|
||||
--- ./lib/backend/dbi.h.orig 2019-10-02 09:56:46.416347458 +0000
|
||||
+++ ./lib/backend/dbi.h 2019-10-02 09:56:52.084335992 +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-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
|
||||
--- ./lib/rpmdb.c.orig 2019-10-02 09:56:46.416347458 +0000
|
||||
+++ ./lib/rpmdb.c 2019-10-02 09:56:52.084335992 +0000
|
||||
@@ -2644,6 +2644,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 2017-10-05 10:04:57.035602138 +0000
|
||||
+++ ./lib/rpmdb.h 2017-12-01 14:27:23.748426197 +0000
|
||||
--- ./lib/rpmdb.h.orig 2019-06-26 14:17:31.412985694 +0000
|
||||
+++ ./lib/rpmdb.h 2019-10-02 09:56:52.088335984 +0000
|
||||
@@ -35,7 +35,9 @@ typedef enum rpmdbCtrlOp_e {
|
||||
RPMDB_CTRL_UNLOCK_RO = 2,
|
||||
RPMDB_CTRL_LOCK_RW = 3,
|
||||
@ -92,24 +92,24 @@ locking.
|
||||
} rpmdbCtrlOp;
|
||||
|
||||
/** \ingroup rpmdb
|
||||
--- ./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);
|
||||
--- ./lib/transaction.c.orig 2019-10-02 09:56:52.088335984 +0000
|
||||
+++ ./lib/transaction.c 2019-10-02 09:58:36.956123870 +0000
|
||||
@@ -1601,6 +1601,7 @@ rpmRC runScript(rpmts ts, rpmte te, Head
|
||||
rpmTagVal stag = rpmScriptTag(script);
|
||||
FD_t sfd = NULL;
|
||||
int warn_only = !(rpmScriptFlags(script) & RPMSCRIPT_FLAG_CRITICAL);
|
||||
+ rpmdb rdb = rpmtsGetRdb(ts);
|
||||
|
||||
/* Fake up a transaction element for triggers from rpmdb */
|
||||
/* Create a temporary transaction element for triggers from rpmdb */
|
||||
if (te == NULL) {
|
||||
@@ -1468,10 +1469,12 @@ rpmRC runScript(rpmts ts, rpmte te, Head
|
||||
@@ -1612,10 +1613,12 @@ rpmRC runScript(rpmts ts, rpmte te, Head
|
||||
if (sfd == NULL)
|
||||
sfd = rpmtsScriptFd(ts);
|
||||
|
||||
+ rpmdbCtrl(rdb, RPMDB_CTRL_SUSPEND_DBLOCK);
|
||||
rpmswEnter(rpmtsOp(ts, RPMTS_OP_SCRIPTLETS), 0);
|
||||
rc = rpmScriptRun(script, arg1, arg2, sfd,
|
||||
prefixes, warn_only, rpmtsPlugins(ts));
|
||||
prefixes, rpmtsPlugins(ts));
|
||||
rpmswExit(rpmtsOp(ts, RPMTS_OP_SCRIPTLETS), 0);
|
||||
+ rpmdbCtrl(rdb, RPMDB_CTRL_RESUME_DBLOCK);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user