Merged patches to new git https://abf.io/soft/rpm5, build directly from git

Old packaging has been saved in the branch "patch-history", it can be handy for e.g. git blame / git history of patches.
This commit is contained in:
Mikhail Novosyolov 2019-04-29 22:03:42 +03:00
parent e7c58a5354
commit 0ece870c36
163 changed files with 10 additions and 10667 deletions

View file

@ -1,4 +1,3 @@
sources: sources:
"cpu-os-macros.tar.gz": 99c5fa561dd0d897bfa8cd97f2aa60781bc578d4 "cpu-os-macros.tar.gz": 99c5fa561dd0d897bfa8cd97f2aa60781bc578d4
"rpm-5.4.10.tar.gz": 8b525f6762d0a4f3bd5af44971f1199c6805d7dd
RPMBDB-0.1.tar.xz: d56f37fff7f7f8b036b4ce3b06c1ab205687596b RPMBDB-0.1.tar.xz: d56f37fff7f7f8b036b4ce3b06c1ab205687596b

View file

@ -1,65 +0,0 @@
%_dependency_whiteout_mandriva \
coreutils>pam \
tcb>shadow-utils \
mkinitrd>plymouth \
plymouth-scripts>plymouth \
perl-base>perl-base \
libncurses.so.5>ncurses libncurses.so.5()(64bit)>ncurses \
libncurses5>ncurses lib64ncurses5>ncurses \
libopenssl1.0.0>libopenssl-engines1.0.0 lib64openssl1.0.0>lib64openssl-engines1.0.0 \
libgamin-1_0>gamin lib64gamin-1_0>gamin \
libglib-2.0.so.0>gamin libglib-2.0.so.0()(64bit)>gamin \
util-linux-ng>udev \
SysVinit>initscripts systemd>initscripts systemd>systemd-units \
rpm-mandriva-setup>rpm rpm-mandriva-setup>rpm-manbo-setup rpm-manbo-setup>rpm \
drakx-kbd-mouse-x11>drakxtools-backend drakx-kbd-mouse-x11>drakxtools-curses \
drakxtools-backend>drakxtools-curses \
hal-info>hal \
perl-base>perl \
drakxtools-backend>drakxtools-curses \
libck-connector.so.0>consolekit libck-connector.so.0()(64bit)>consolekit \
libconsolekit0>consolekit lib64consolekit0>consolekit \
manbo-files-gcc>gcc manbo-files>libstdc++-devel \
gcc-cpp>gcc gcc>libstdc++-devel \
libgvfs0>gvfs lib64gvfs0>gvfs \
nss>libnss3 nss>lib64nss3 \
libpolkit1_0-0.99>polkit lib64polkit1_0-0.99>polkit \
libpolkit2>policykit lib64polkit2>policykit \
libv4l0>v4l-utils lib64v4l0>v4l-utils \
libenchant1>enchant lib64enchant1>enchant \
libsopranoclient1>soprano lib64sopranoclient1>soprano \
soprano>soprano-plugin-virtuoso \
libsopranoindex1>soprano lib64sopranoindex1>soprano \
libsoprano4>libsopranoserver1 lib64soprano4>lib64sopranoserver1 \
soprano>libsopraoserver1 soprano>lib64sopranoserver1 \
libv4l1.so.0>libv4l-wrappers libv4l1.so.0()(64bit)>libv4l-wrappers \
libgnome-vfs2_0>gnome-vfs2 lib64gnome-vfs2_0>gnome-vfs2 \
libgphoto2.so.2>libgphoto-common libgphoto2.so.2()(64bit)>lib64gphoto-common \
libgphoto2>libgphoto-common lib64gphoto2>lib64gphoto-common \
libwnck-1_22>libwnck lib64wnck-1_22>libwnck \
libcanberra-gtk0>canberra-gtk lib64canberra-gtk0>canberra-gtk \
libgcr0>gnome-keyring lib64gcr0>gnome-keyring \
libpango1.0_0>libpango1.0_0-modules lib64pango1.0_0>lib64pango1.0_0-modules \
libgio2.0_0>glib2.0 lib64gio2.0_0>glib2.0 \
libglib2.0_0>glib2.0-common lib64glib2.0_0>glib2.0-common \
libGConf2_4-2.32.0>GConf2 lib64GConf2_4-2.32.0>GConf2 \
libORBit2_0>ORBit2 lib64ORBit2_0>ORBit2 \
libhal1>hal lib64hal1>hal \
libgdk_pixbuf2.0_0>gdk-pixbuf2.0 lib64gdk_pixbuf2.0_0>gdk-pixbuf2.0 \
libgstreamer-0.10.so.0>gstreamer0.10-tools libgstreamer-0.10.so.0()(64bit)>gstreamer0.10-tools \
libuser1>libuser lib64user1>lib64user \
libdbus-1_3>dbus lib64dbus-1_3>dbus\
libfontconfig1>fontconfig lib64fontconfig1>fontconfig \
libgtk+-x11-2.0_0>libgtk+2.0_0 lib64gtk+-x11-2.0_0>lib64gtk+2.0_0 \
libgtk+2.0_0>gtk+2.0 lib64gtk+2.0_0>gtk+2.0 \
libgtk+-x11-2.0_0>gtk+2.0 lib64gtk+-x11-2.0_0>gtk+2.0 \
libavahi-client3>avahi lib64avahi-client3>avahi \
rpm-helper>rpm
# enabling this by default is to be dropped ASAP
%_legacy_compat_non_pre_scripts_dont_fail 1
%_legacy_compat_all \
%global _legacy_compat_no_doc_conflicts 1 \
%global _legacy_compat_non_pre_scripts_dont_fail 1 \
%global _dependency_whiteout %_dependency_whiteout_mandriva

View file

@ -1,40 +0,0 @@
diff -Nur rpm-5.3.12/macros/macros rpm-5.3.12.new/macros/macros
--- rpm-5.3.12/macros/macros 2011-07-12 14:08:41.000000000 +0400
+++ rpm-5.3.12.new/macros/macros 2012-04-10 14:42:44.000000000 +0400
@@ -835,7 +835,7 @@
#
%_arch x86_64
%_build_arch x86_64
-%_vendor mandriva
+%_vendor rosa
%_os linux
%_gnu -gnu
diff -Nur rpm-5.3.12/macros/mandriva rpm-5.3.12.new/macros/mandriva
--- rpm-5.3.12/macros/mandriva 2011-07-12 14:08:41.000000000 +0400
+++ rpm-5.3.12.new/macros/mandriva 2012-04-10 14:44:02.000000000 +0400
@@ -1,7 +1,7 @@
%distribution Mandriva Linux
%vendor Mandriva
-%bugurl http://qa.mandriva.com
-%disturl http://mandriva.org
+%bugurl http://bugs.rosalinux.ru/
+%disturl http://www.rosalab.ru/
# This macro will disable the transaction lock on /var/lib/rpm/__db.*.
# This lock is of no use to us and will also result in errors when trying to
diff -Nur rpm-5.3.12/macros/mandriva.in rpm-5.3.12.new/macros/mandriva.in
--- rpm-5.3.12/macros/mandriva.in 2011-05-04 16:20:06.000000000 +0400
+++ rpm-5.3.12.new/macros/mandriva.in 2012-04-10 14:46:12.000000000 +0400
@@ -1,7 +1,7 @@
-%distribution Mandriva Linux
-%vendor Mandriva
-%bugurl http://qa.mandriva.com
-%disturl http://mandriva.org
+%distribution ROSA Linux
+%vendor ROSA
+%bugurl http://bugs.rosalinux.ru/
+%disturl http://www.rosalab.ru/
# This macro will disable the transaction lock on /var/lib/rpm/__db.*.
# This lock is of no use to us and will also result in errors when trying to

View file

@ -1,27 +0,0 @@
--- rpm-5.3.8/lib/psm.c.trigger_once~ 2011-02-21 22:35:22.081663000 +0100
+++ rpm-5.3.8/lib/psm.c 2011-02-21 22:35:25.023663001 +0100
@@ -1482,11 +1482,23 @@ static rpmRC runTriggersLoop(rpmpsm psm,
/*@innercontinue@*/ continue;
rc |= handleOneTrigger(psm, fi->h, triggeredH, arg2);
prev = instance;
+
+ /* FIXME: 'instances' is never really used for anything later,
+ * and seems to have some bug making it eat it all memory
xx = argiAdd(&instances, -1, instance);
- xx = argiSort(instances, NULL);
+ xx = argiSort(instances, NULL);*/
+ /* As no filenames or anything is passed to the trigger script,
+ * there doesn't seem to be any reason to fire the same trigger
+ * over and over..
+ */
+ if(tagno == RPMTAG_BASENAMES || RPMTAG_DIRNAMES)
+ break;
}
mi = rpmmiFree(mi);
+ /* again don't fire same trigger over and over.. */
+ if(tagno == RPMTAG_BASENAMES || RPMTAG_DIRNAMES)
+ break;
}
instances = argiFree(instances);

View file

@ -1,108 +0,0 @@
From 885436e995aa39249a7089bf1f850431ed318b7f Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Tue, 25 Dec 2018 01:04:37 +0300
Subject: [PATCH] Multithreaded XZ
Ported commits 7740d1098642cd42f725fb9a2a3819ceaf51a80b and bec7592a36a2243aa4656afecf3247598baac5ff
from RPM4 rpm-4.14.0-rc1 to RPM5 5.4.10 (ROSA)
https://github.com/rpm-software-management/rpm/commit/7740d1098642cd42f725fb9a2a3819ceaf51a80b
https://github.com/rpm-software-management/rpm/commit/bec7592a36a2243aa4656afecf3247598baac5ff
---
rpmio/xzdio.c | 46 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
diff --git a/rpmio/xzdio.c b/rpmio/xzdio.c
index f7a078f..e33f3a4 100644
--- a/rpmio/xzdio.c
+++ b/rpmio/xzdio.c
@@ -7,6 +7,7 @@
#include "rpmio_internal.h"
#include <rpmmacro.h>
#include <rpmcb.h>
+#include <ctype.h>
#if defined(WITH_XZ)
@@ -33,6 +34,10 @@
#endif
#include "lzma.h"
+/* Multithreading support in stable API since xz 5.2.0 */
+#if LZMA_VERSION >= 50020002
+#define HAVE_LZMA_MT
+#endif
#ifndef LZMA_PRESET_DEFAULT
#define LZMA_PRESET_DEFAULT UINT32_C(6)
@@ -68,7 +73,9 @@ static XZFILE *xzopen_internal(const char *path, const char *mode, int fdno, int
XZFILE *xzfile;
lzma_stream tmp;
lzma_ret ret;
-
+#ifdef HAVE_LZMA_MT
+ int threads = 0;
+#endif
for (; *mode != '\0'; mode++) {
if (*mode == 'w')
encoding = 1;
@@ -76,6 +83,21 @@ static XZFILE *xzopen_internal(const char *path, const char *mode, int fdno, int
encoding = 0;
else if (*mode >= '0' && *mode <= '9')
level = (int)(*mode - '0');
+ else if (*mode == 'T') {
+ if (isdigit(*(mode+1))) {
+#ifdef HAVE_LZMA_MT
+ threads = atoi(++mode);
+#endif
+ /* skip past rest of digits in string that atoi()
+ * should've processed
+ * */
+ while(isdigit(*++mode));
+ }
+#ifdef HAVE_LZMA_MT
+ else
+ threads = -1;
+#endif
+ }
}
if (fdno != -1)
fp = fdopen(fdno, encoding ? "w" : "r");
@@ -95,7 +117,26 @@ static XZFILE *xzopen_internal(const char *path, const char *mode, int fdno, int
xzfile->strm = tmp;
if (encoding) {
if (xz) {
- ret = lzma_easy_encoder(&xzfile->strm, level, LZMA_CHECK_CRC32);
+#ifdef HAVE_LZMA_MT
+ if (!threads) {
+#endif
+ ret = lzma_easy_encoder(&xzfile->strm, level, LZMA_CHECK_CRC32);
+#ifdef HAVE_LZMA_MT
+ } else {
+ if (threads == -1)
+ threads = sysconf(_SC_NPROCESSORS_ONLN);
+ lzma_mt mt_options = {
+ .flags = 0,
+ .threads = threads,
+ .block_size = 0,
+ .timeout = 0,
+ .preset = level,
+ .filters = NULL,
+ .check = LZMA_CHECK_SHA256 };
+
+ ret = lzma_stream_encoder_mt(&xzfile->strm, &mt_options);
+ }
+#endif
} else {
lzma_options_lzma options;
(void) lzma_lzma_preset(&options, level);
@@ -167,7 +208,6 @@ static int xzclose(/*@only@*/ XZFILE *xzfile)
lzma_ret ret;
size_t n;
int rc;
-
if (!xzfile)
return -1;
if (xzfile->encoding) {
--
2.17.1

View file

@ -1,48 +0,0 @@
From d4b68e164dc86589019a6fbb51e5ef27c670f4a2 Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Sun, 7 Apr 2019 17:34:16 +0300
Subject: [PATCH] Parse private dependencies from pkgconfig files
- The support for --print-requires|provides was only upstreamed in
pkg-config 0.24, prior to that it relied on distros patching their
pkg-config. Rpm relying on non-upstream stuff is not good...
Now that it's upstream we can make a clean break and simply not
even try to generate the dependencies with anything older.
- The upstreamed version behaves slightly differently from what distros
were patching with, for rpm's purposes we also want
--print-requires-private now.
This is a port of https://github.com/rpm-software-management/rpm/commit/0cc5e818a
from RPM4 to RPM5.
---
scripts/pkgconfigdeps.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scripts/pkgconfigdeps.sh b/scripts/pkgconfigdeps.sh
index 31db20d..cf59d3e 100755
--- a/scripts/pkgconfigdeps.sh
+++ b/scripts/pkgconfigdeps.sh
@@ -11,6 +11,11 @@ test -x $pkgconfig || {
exit 0
}
+$pkgconfig --atleast-pkgconfig-version="0.24" || {
+ cat > /dev/null
+ exit 0
+}
+
case $1 in
-P|--provides)
while read filename ; do
@@ -47,7 +52,7 @@ case $1 in
DIR=`dirname ${filename}`
PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
export PKG_CONFIG_PATH
- $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
+ $pkgconfig --print-requires --print-requires-private "$filename" 2> /dev/null | while read n r v ; do
[ -n "$n" ] || continue
if [ -n "$r" ] && [ -n "$v" ]; then
echo "pkgconfig($n) $r $v"
--
2.21.0

View file

@ -1,37 +0,0 @@
From 327206c531d3b37719cd48b35bf3c58686484073 Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Tue, 25 Dec 2018 01:50:51 +0300
Subject: [PATCH] Use multithreaded XZ by default for both binary and source
packages.
Note: according to https://github.com/rpm-software-management/rpm/commit/b7b2ab2177af8359663fcfb83cb2af3da578012e#commitcomment-14634266 ,
multithreaded XZ will break deltarpm, but ROSA does not have deltarpm.
Example of this config was taken from https://github.com/rpm-software-management/rpm/commit/c004d7647e2c16d6672d8f902d2cab00d89b9778
---
macros/mandriva.in | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/macros/mandriva.in b/macros/mandriva.in
index 3f742ad..958a869 100644
--- a/macros/mandriva.in
+++ b/macros/mandriva.in
@@ -127,8 +127,13 @@
# TODO: fix check script and implement support for using
#%_multiarch_required_terminate_build 1
-# use XZ to compress binary packages:
-%_binary_payload w5.xzdio
+# use multithreaded XZ to compress binary and source packages
+# note: only liblzma >= 5.2 supports multithreaded xz
+# w6 is xz level 6 (default), T - threads
+# note: w6T0.xzdio will result into 1 thread, w6T.xzdio will result into multiple threads!
+%_binary_payload w6T.xzdio
+# xz -2 is the most optimal for .src.rpm where compressed tarballs are recompressed
+%_source_payload w2T.xzdio
%_duplicate_files_terminate_build 1
%_unpackaged_subdirs_terminate_build 0
--
2.17.1

View file

@ -1,12 +0,0 @@
--- rpm-5.4.10/rpmio/rpmiotypes.h.cb2~ 2013-03-18 04:37:50.985920598 +0100
+++ rpm-5.4.10/rpmio/rpmiotypes.h 2013-03-18 04:37:05.729281072 +0100
@@ -140,7 +140,8 @@ typedef enum rpmCallbackType_e {
RPMCALLBACK_CPIO_ERROR = (1 << 14),
RPMCALLBACK_SCRIPT_ERROR = (1 << 15),
RPMCALLBACK_SCRIPT_START = (1 << 16),
- RPMCALLBACK_SCRIPT_STOP = (1 << 17)
+ RPMCALLBACK_SCRIPT_STOP = (1 << 17),
+ RPMCALLBACK_INST_STOP = (1 << 18)
} rpmCallbackType;
/**

View file

@ -1,14 +0,0 @@
Index: rpm/lib/psm.c
RCS File: /v/rpm/cvs/rpm/lib/psm.c,v
rcsdiff -q -kk '-r2.399.2.5' '-r2.399.2.6' -u '/v/rpm/cvs/rpm/lib/psm.c,v' 2>/dev/null
--- rpm/lib/psm.c 2012/04/19 17:26:06 2.399.2.5
+++ rpm/lib/psm.c 2012/12/03 19:48:55 2.399.2.6
@@ -2755,7 +2755,7 @@
psm->scriptTag = RPMTAG_POSTIN;
psm->progTag = RPMTAG_POSTINPROG;
psm->sense = RPMSENSE_TRIGGERIN;
- psm->countCorrection = 0;
+ psm->countCorrection = 1;
if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPOST)) {
rc = (rpmRC) rpmpsmNext(psm, PSM_SCRIPT);

View file

@ -1,22 +0,0 @@
diff -urN rpm-5.4.10/macros/mandriva rpm-5.4.10-patched/macros/mandriva
--- rpm-5.4.10/macros/mandriva 2016-10-12 19:02:22.174240451 +1000
+++ rpm-5.4.10-patched/macros/mandriva 2016-10-12 19:03:44.337238294 +1000
@@ -92,6 +92,7 @@
%_localstatedir %{_var}
%_logdir %{_var}/log
%_libexecdir %{_libdir}
+%_appdatadir %{_datadir}/metainfo
# mdvbz#62741
# standard systemd directories
diff -urN rpm-5.4.10/macros/mandriva.in rpm-5.4.10-patched/macros/mandriva.in
--- rpm-5.4.10/macros/mandriva.in 2016-10-12 19:02:22.186240451 +1000
+++ rpm-5.4.10-patched/macros/mandriva.in 2016-10-12 19:04:50.634236554 +1000
@@ -92,6 +92,7 @@
%_localstatedir %{_var}
%_logdir %{_var}/log
%_libexecdir %{_libdir}
+%_appdatadir %{_datadir}/metainfo
# mdvbz#62741
# standard systemd directories

View file

@ -1,14 +0,0 @@
diff -urN rpm-5.4.10/lib/depends.c rpm-5.4.10-patched/lib/depends.c
--- rpm-5.4.10/lib/depends.c 2012-04-16 08:20:56.000000000 +1100
+++ rpm-5.4.10-patched/lib/depends.c 2017-01-24 21:18:13.290480568 +1000
@@ -105,8 +105,9 @@
if (ts->numRemovedPackages == ts->allocedRemovedPackages) {
ts->allocedRemovedPackages += ts->delta;
+ /* XXX coverity #1035956 */
ts->removedPackages = (uint32_t *) xrealloc(ts->removedPackages,
- sizeof(ts->removedPackages) * ts->allocedRemovedPackages);
+ sizeof(*ts->removedPackages) * ts->allocedRemovedPackages);
}
assert(ts->removedPackages != NULL); /* XXX can't happen. */

View file

@ -1,36 +0,0 @@
diff -Naur cpu-os-macros.orig/i586-linux/macros cpu-os-macros/i586-linux/macros
--- cpu-os-macros.orig/i586-linux/macros 2014-05-22 13:49:34.309259552 +0400
+++ cpu-os-macros/i586-linux/macros 2014-05-22 14:41:56.000000000 +0400
@@ -6,7 +6,7 @@
%_arch i386
%_os linux
%_gnu -gnu
-%optflags %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer -mtune=generic}%{!?__common_cflags_with_ssp:-O2 -g -m32} -march=i586 -fasynchronous-unwind-tables
+%optflags %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fPIE -pie -fpie -Wformat-security -fomit-frame-pointer -mtune=generic}%{!?__common_cflags_with_ssp:-O2 -g -m32} -march=i586 -fasynchronous-unwind-tables
#==============================================================================
# ---- configure macros.
diff -Naur cpu-os-macros.orig/i686-linux/macros cpu-os-macros/i686-linux/macros
--- cpu-os-macros.orig/i686-linux/macros 2014-05-22 13:49:34.309259552 +0400
+++ cpu-os-macros/i686-linux/macros 2014-05-22 14:41:48.000000000 +0400
@@ -6,7 +6,7 @@
%_arch i386
%_os linux
%_gnu -gnu
-%optflags %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer}%{!?__common_cflags_with_ssp:-O2 -g -m32 -mtune=generic} -march=i686 -fasynchronous-unwind-tables
+%optflags %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer -fPIE -pie -fpie -Wformat-security}%{!?__common_cflags_with_ssp:-O2 -g -m32 -mtune=generic} -march=i686 -fasynchronous-unwind-tables
#==============================================================================
# ---- configure macros.
diff -Naur cpu-os-macros.orig/x86_64-linux/macros cpu-os-macros/x86_64-linux/macros
--- cpu-os-macros.orig/x86_64-linux/macros 2014-05-22 13:49:34.310259552 +0400
+++ cpu-os-macros/x86_64-linux/macros 2014-05-22 14:44:09.314521435 +0400
@@ -6,7 +6,7 @@
%_arch x86_64
%_os linux
%_gnu -gnu
-%optflags %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fPIC}%{!?__common_cflags_with_ssp:-O2 -g -m64 -mtune=generic}
+%optflags %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fPIE -pie -fpie -Wformat-security -fPIC}%{!?__common_cflags_with_ssp:-O2 -g -m64 -mtune=generic}
#==============================================================================
# ---- configure macros.

View file

@ -1,12 +0,0 @@
diff -Naur rpm-5.4.10.orig/scripts/dbconvert.sh rpm-5.4.10/scripts/dbconvert.sh
--- rpm-5.4.10.orig/scripts/dbconvert.sh 2013-04-25 15:06:25.934554231 +0400
+++ rpm-5.4.10/scripts/dbconvert.sh 2013-04-25 15:06:31.721744337 +0400
@@ -9,7 +9,7 @@
DBVERBOSE=${DBVERBOSE:-1}
DBREBUILD=${DBREBUILD:-0}
-DBVERSION=5.1
+DBVERSION=5.2
DBERROR=0
for db_tool in db_stat db_dump db_load db_recover; do
db_tool_versioned=$(echo $db_tool | sed -e 's/^db_/db'"${DBVERSION}"'/' -e 's/^db\([0-9]*\)\.\([0-9]*\)/db\1\2_/')

View file

@ -1,11 +0,0 @@
--- rpm-5.4.10/tools/debugedit.c.debugedit_errmsg~ 2013-01-03 09:24:01.764153125 +0100
+++ rpm-5.4.10/tools/debugedit.c 2013-01-03 09:31:33.485896571 +0100
@@ -696,7 +696,7 @@ edit_dwarf2_line (DSO *dso, rpmuint32_t
{
if (--shrank == 0)
error (EXIT_FAILURE, 0,
- "canonicalization unexpectedly shrank by one character");
+ "canonicalization unexpectedly shrank by one character ('%s' vs '%s')", base_dir, dest_dir);
else
{
memset (ptr, 'X', shrank);

View file

@ -1,12 +0,0 @@
diff -Naur rpm-5.4.10.orig/scripts/find-debuginfo.sh rpm-5.4.10/scripts/find-debuginfo.sh
--- rpm-5.4.10.orig/scripts/find-debuginfo.sh 2018-09-18 17:57:42.282867897 +0300
+++ rpm-5.4.10/scripts/find-debuginfo.sh 2018-09-18 17:59:49.826673106 +0300
@@ -193,7 +193,7 @@
find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \
\( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
-print | LANG=C sort |
-file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' |
+file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' | sed 's/, too many notes (.*)//' |
xargs --no-run-if-empty stat -c '%h %D_%i %n' |
while read nlinks inum f; do
[ -n "$EXCLUDE_REGEXP" ] && grep -E -q "$EXCLUDE_REGEXP" <<< "$f" && \

View file

@ -1,11 +0,0 @@
--- rpm-5.4.10/lib/rpmds.c.buildid_deps~ 2013-01-23 03:39:17.232845754 +0100
+++ rpm-5.4.10/lib/rpmds.c 2013-01-23 03:38:37.428673897 +0100
@@ -3297,7 +3297,7 @@ fprintf(stderr, "*** rpmdsELF(%s, %d, %p
continue;
/*@notreached@*/ /*@switchbreak@*/ break;
case SHT_NOTE:
-#if defined(HAVE_GELF_GETNOTE) /* XXX OpenIndiana & older elfutils haven't. */
+#if defined(HAVE_GELF_GETNOTE) && !defined(RPM_VENDOR_MANDRIVA) /* XXX OpenIndiana & older elfutils haven't. */
if (!(shdr->sh_flags & SHF_ALLOC))
continue;
data = NULL;

View file

@ -1,11 +0,0 @@
--- a/macros/mandriva.in 2014-10-25 15:11:42.195955354 +0400
+++ b/macros/mandriva.in 2014-10-25 15:09:09.000000000 +0400
@@ -44,7 +44,7 @@
%evr_tuple_select 1234
%evr_tuple_order EVRD
%disttag %{!?distsuffix:mdv}%{?distsuffix}
-%distepoch %(sed -e 's#.*release\\ \\(\\S*\\).*#\\1#' /etc/release)
+%distepoch %(sed -n -e 's/^VERSION_ID=//p' /etc/os-release)
# Dynamic EVRD tags macro for use with versioned provides/requires in place of
# '%{version}-%{release}', ie. to automatically add distepoch or epoch if present

View file

@ -1,924 +0,0 @@
--- rpm-5.4.10/build/parseScript.c.dlopen~ 2012-04-15 17:04:14.000000000 +0200
+++ rpm-5.4.10/build/parseScript.c 2012-07-10 20:20:02.578979876 +0200
@@ -305,6 +305,12 @@ int parseScript(Spec spec, int parsePart
iob = rpmiobRTrim(iob);
p = rpmiobStr(iob);
+#if __WORDSIZE == 64 /* XXX lame, whatever.. :p */
+#define SO_EXT "()(64bit)"
+#else
+#define SO_EXT ""
+#endif
+
#ifdef WITH_LUA
if (!strcmp(progArgv[0], "<lua>")) {
rpmlua lua = NULL; /* Global state. */
@@ -338,18 +344,21 @@ int parseScript(Spec spec, int parsePart
if (!strcmp(progArgv[0], "<perl>")) {
(void) rpmlibNeedsFeature(pkg->header,
"BuiltinPerlScripts", "5.2-1");
+ addReqProv(NULL, pkg->header, RPMTAG_REQUIRENAME, "rpmperl.so" SO_EXT, NULL, RPMSENSE_INTERP, 0);
} else
#endif
#ifdef WITH_PYTHONEMBED
if (!strcmp(progArgv[0], "<python>")) {
(void) rpmlibNeedsFeature(pkg->header,
"BuiltinPythonScripts", "5.2-1");
+ addReqProv(NULL, pkg->header, RPMTAG_REQUIRENAME, "rpmpython.so" SO_EXT, NULL, RPMSENSE_INTERP, 0);
} else
#endif
#ifdef WITH_RUBYEMBED
if (!strcmp(progArgv[0], "<ruby>")) {
(void) rpmlibNeedsFeature(pkg->header,
"BuiltinRubyScripts", "5.2-1");
+ addReqProv(NULL, pkg->header, RPMTAG_REQUIRENAME, "rpmruby.so" SO_EXT, NULL, RPMSENSE_INTERP, 0);
} else
#endif
#ifdef WITH_SEMANAGE
@@ -368,12 +377,14 @@ int parseScript(Spec spec, int parsePart
if (!strcmp(progArgv[0], "<squirrel>")) {
(void) rpmlibNeedsFeature(pkg->header,
"BuiltinSquirrelScripts", "5.2-1");
+ addReqProv(NULL, pkg->header, RPMTAG_REQUIRENAME, "rpmsquirrel.so" SO_EXT, NULL, RPMSENSE_INTERP, 0);
} else
#endif
#ifdef WITH_TCL
if (!strcmp(progArgv[0], "<tcl>")) {
(void) rpmlibNeedsFeature(pkg->header,
"BuiltinTclScripts", "5.2-1");
+ addReqProv(NULL, pkg->header, RPMTAG_REQUIRENAME, "rpmtcl.so" SO_EXT, NULL, RPMSENSE_INTERP, 0);
} else
#endif
if (progArgv[0][0] == '<') {
--- rpm-5.4.10/configure.ac.dlopen~ 2012-07-10 20:20:02.224984301 +0200
+++ rpm-5.4.10/configure.ac 2012-07-10 20:20:02.581979838 +0200
@@ -1720,44 +1720,95 @@ RPM_CHECK_LIB(
AC_SUBST(WITH_CUDF_CUDFTOOL)
dnl # Perl ExtUtils::Embed
+WITH_PERL_INCDIR="`perl -MExtUtils::Embed -e perl_inc| sed -e 's#^ -I##' -e 's# ##g'`"
+WITH_PERL_LIB="`perl -MConfig -e 'print \"$Config{archlibexp}/CORE/\"'`"
+WITH_PERL_CFLAGS="`perl -MExtUtils::Embed -e ccopts`"
+WITH_PERL_LDFLAGS="`perl -MExtUtils::Embed -e ldopts`"
+export LD_RUN_PATH=$WITH_PERL_LIB
+export LIBRARY_PATH=$LD_RUN_PATH
+export C_INCLUDE_PATH=$WITH_PERL_INCDIR
RPM_CHECK_LIB(
[Perl ExtUtils::Embed], [perlembed],
[perl], [perl_alloc], [EXTERN.h],
[no,external:none], [],
- [
- ], [])
+ [ AM_CONDITIONAL(
+ [WITH_PERLEMBED],
+ [true])
+ ],
+ [ AM_CONDITIONAL(
+ [WITH_PERLEMBED],
+ [false])
+ ])
+LIBS="`echo $LIBS|sed -e s/-lperl//g`"
+AC_SUBST(WITH_PERL_CFLAGS)
+AC_SUBST(WITH_PERL_LDFLAGS)
+unset LD_RUN_PATH
+unset LIBRARY_PATH
+unset C_INCLUDE_PATH
+export C_INCLUDE_PATH=$WITH_PYTHON_INCDIR
dnl # Python embedding
RPM_CHECK_LIB(
[Python embedding], [pythonembed],
- [python2.7 python2.6 python2.5 python2.4], [Py_Initialize], [Python.h],
+ [python2.7], [Py_Initialize], [Python.h],
[no,external:none], [],
- [
- ], [])
+ [ AM_CONDITIONAL(
+ [WITH_PYTHONEMBED],
+ [true])
+ ],
+ [ AM_CONDITIONAL(
+ [WITH_PYTHONEMBED],
+ [false])
+ ])
+unset C_INCLUDE_PATH
dnl # Ruby
WITH_RUBY_SUBDIR=""
-WITH_RUBY_CPPFLAGS=""
+WITH_RUBY_CPPFLAGS="`pkg-config --cflags ruby-1.9`"
+WITH_RUBY_LDFLAGS="`pkg-config --libs ruby-1.9`"
WITH_RUBY_VENDORARCHDIR=""
+export C_INCLUDE_PATH="`pkg-config --cflags-only-I ruby-1.9|sed -e 's#-I##g' -e 's# /#:/#g' -e 's# ##g'`"
RPM_CHECK_LIB(
[Ruby], [ruby],
[ruby], [ruby_init], [ruby.h],
[no,external:none], [],
[ AC_DEFINE(WITH_RUBYEMBED, 1, [Define to 1 if you want embedded Ruby])
WITH_RUBY_SUBDIR=ruby
- ], [])
+ AM_CONDITIONAL(
+ [WITH_RUBYEMBED],
+ [true])
+ ],
+ [ AM_CONDITIONAL(
+ [WITH_RUBYEMBED],
+ [false])
+ ])
+LIBS="`echo $LIBS|sed -e s/-lruby//g`"
AC_SUBST(WITH_RUBY_CPPFLAGS)
+AC_SUBST(WITH_RUBY_LDFLAGS)
AC_SUBST(WITH_RUBY_SUBDIR)
AC_SUBST(WITH_RUBY_VENDORARCHDIR)
+unset C_INCLUDE_PATH
dnl # Squirrel
+export C_INCLUDE_PATH="/usr/include/squirrel"
+SQUIRREL_CPPFLAGS="-I$C_INCLUDE_PATH"
+SQUIRREL_LIBS="-lsquirrel"
RPM_CHECK_LIB(
[Squirrel], [squirrel],
[squirrel], [sq_open], [squirrel.h],
[no,external:none], [],
- [
- ], [])
+ [ AM_CONDITIONAL(
+ [WITH_SQUIRREL],
+ [true])
+ ],
+ [ AM_CONDITIONAL(
+ [WITH_SQUIRREL],
+ [false])
+ ])
+AC_SUBST(SQUIRREL_CPPFLAGS)
+AC_SUBST(SQUIRREL_LIBS)
+unset C_INCLUDE_PATH
dnl # Tcl (should tcl8.4 be supported too?)
WITH_TCL_SUBDIR=""
@@ -1765,8 +1816,14 @@ RPM_CHECK_LIB(
[Tcl], [tcl],
[tcl8.6 tcl8.5 tcl], [Tcl_CreateInterp], [tcl.h],
[no,external:none], [],
- [
- ], [])
+ [ AM_CONDITIONAL(
+ [WITH_TCL],
+ [true])
+ ],
+ [ AM_CONDITIONAL(
+ [WITH_TCL],
+ [false])
+ ])
AC_SUBST(WITH_TCL_SUBDIR)
dnl # FICL
--- rpm-5.4.10/rpmio/Makefile.am.dlopen~ 2012-04-16 22:53:32.000000000 +0200
+++ rpm-5.4.10/rpmio/Makefile.am 2012-07-10 20:20:02.582979826 +0200
@@ -92,8 +92,8 @@ RPM_LDADD_COMMON = \
$(top_builddir)/rpmdb/librpmdb.la \
$(RPMIO_LDADD_COMMON)
-#pkglibdir = @USRLIBRPM@
-#pkglib_LTLIBRARIES = libsqlio.la
+zpkglibdir = @USRLIBRPM@/lib
+zpkglib_LTLIBRARIES = #libsqlio.la
pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX)
pkginc_HEADERS = argv.h mire.h rpmzlog.h yarn.h \
@@ -210,6 +210,52 @@ endif
#librpmio.la: $(librpmio_la_OBJECTS) $(librpmio_la_DEPENDENCIES)
# $(librpmio_la_LINK) -rpath $(usrlibdir) $(librpmio_la_OBJECTS) $(librpmio_la_LIBADD)
+if WITH_PERLEMBED
+librpmio_la_LDFLAGS += -Wl,-rpath=$(zpkglibdir)
+zpkglib_LTLIBRARIES += rpmperl.la
+rpmperl_la_SOURCES = rpmperl.c
+rpmperl_la_CPPFLAGS = -DMODULE_EMBED
+rpmperl_la_CFLAGS = $(WITH_PERL_CFLAGS)
+rpmperl_la_LDFLAGS = -module -avoid-version $(WITH_PERL_LDFLAGS)
+rpmperl_la_LIBADD = $(RPMIO_LDADD_COMMON)
+endif
+
+if WITH_PYTHONEMBED
+librpmio_la_LDFLAGS += -Wl,-rpath=$(zpkglibdir)
+zpkglib_LTLIBRARIES += rpmpython.la
+rpmpython_la_SOURCES = rpmpython.c
+rpmpython_la_CPPFLAGS = -I@WITH_PYTHON_INCDIR@ -DMODULE_EMBED
+rpmpython_la_LDFLAGS = -module -avoid-version
+rpmpython_la_LIBADD = $(RPMIO_LDADD_COMMON)
+endif
+
+if WITH_RUBYEMBED
+librpmio_la_LDFLAGS += -Wl,-rpath=$(zpkglibdir)
+zpkglib_LTLIBRARIES += rpmruby.la
+rpmruby_la_SOURCES = rpmruby.c
+rpmruby_la_CPPFLAGS = $(WITH_RUBY_CPPFLAGS) -DMODULE_EMBED
+rpmruby_la_LDFLAGS = -module -avoid-version $(WITH_RUBY_LDFLAGS)
+rpmruby_la_LIBADD = $(RPMIO_LDADD_COMMON)
+endif
+
+if WITH_SQUIRREL
+librpmio_la_LDFLAGS += -Wl,-rpath=$(zpkglibdir)
+zpkglib_LTLIBRARIES += rpmsquirrel.la
+rpmsquirrel_la_SOURCES = rpmsquirrel.c
+rpmsquirrel_la_CPPFLAGS = $(SQUIRREL_CPPFLAGS) -DMODULE_EMBED
+rpmsquirrel_la_LDFLAGS = -module -avoid-version
+rpmsquirrel_la_LIBADD = $(RPMIO_LDADD_COMMON) $(SQUIRREL_LIBS)
+endif
+
+if WITH_TCL
+librpmio_la_LDFLAGS += -Wl,-rpath=$(zpkglibdir)
+zpkglib_LTLIBRARIES += rpmtcl.la
+rpmtcl_la_SOURCES = rpmtcl.c
+rpmtcl_la_CPPFLAGS = -DMODULE_EMBED
+rpmtcl_la_LDFLAGS = -module -avoid-version
+rpmtcl_la_LIBADD = $(RPMIO_LDADD_COMMON) -ltcl
+endif
+
#libsqlio_la_SOURCES = libsqlio.c
#libsqlio_la_LIBADD = $(RPMIO_LDADD_COMMON)
--- rpm-5.4.10/rpmio/rpmperl.c.dlopen~ 2012-04-15 23:20:53.000000000 +0200
+++ rpm-5.4.10/rpmio/rpmperl.c 2012-07-10 20:20:02.582979826 +0200
@@ -7,9 +7,15 @@
#include "rpmperl.h"
#include <rpmmacro.h>
-#if defined(WITH_PERLEMBED)
+#if defined(MODULE_EMBED)
#include <EXTERN.h>
#include <perl.h>
+#undef WITH_PERLEMBED
+#endif
+
+#if defined(WITH_PERLEMBED)
+#include <dlfcn.h>
+#include <rpmlog.h>
#endif
#undef UNLIKELY /* XXX everyone gotta be different */
@@ -21,6 +27,12 @@ int _rpmperl_debug = 0;
/*@unchecked@*/ /*@relnull@*/
rpmperl _rpmperlI = NULL;
+#if defined(WITH_PERLEMBED)
+static int dlopened = 0;
+static rpmperl (*rpmperlNew_p) (char ** av, uint32_t flags);
+static rpmRC (*rpmperlRun_p) (rpmperl perl, const char * str, const char ** resultp);
+#endif
+
#define my_perl ((PerlInterpreter *)perl->I)
static void rpmperlFini(void * _perl)
@@ -29,7 +41,7 @@ static void rpmperlFini(void * _perl)
{
rpmperl perl = (rpmperl) _perl;
-#if defined(WITH_PERLEMBED)
+#if defined(MODULE_EMBED)
PERL_SET_CONTEXT(my_perl);
PL_perl_destruct_level = 1;
perl_destruct(my_perl);
@@ -57,7 +69,7 @@ static rpmperl rpmperlGetPool(/*@null@*/
return (rpmperl) rpmioGetPool(pool, sizeof(*perl));
}
-#if defined(WITH_PERLEMBED)
+#if defined(MODULE_EMBED)
EXTERN_C void xs_init (PerlInterpreter * _my_perl PERL_UNUSED_DECL);
EXTERN_C void boot_DynaLoader (PerlInterpreter* _my_perl, CV* cv);
@@ -90,14 +102,40 @@ static rpmperl rpmperlI(void)
return _rpmperlI;
}
+#if defined(WITH_PERLEMBED)
+static void loadModule(void) {
+ const char librpmperl[] = "rpmperl.so";
+ void *h;
+
+ h = dlopen (librpmperl, RTLD_NOW|RTLD_GLOBAL);
+ if (!h)
+ {
+ rpmlog(RPMLOG_WARNING, D_("Unable to open \"%s\" (%s), "
+ "embedded perl will not be available\n"),
+ librpmperl, dlerror());
+ }
+ else if(!((rpmperlNew_p = dlsym(h, "rpmperlNew"))
+ && (rpmperlRun_p = dlsym(h, "rpmperlRun")))) {
+ rpmlog(RPMLOG_WARNING, D_("Opened library \"%s\" is incompatible (%s), "
+ "embedded perl will not be available\n"),
+ librpmperl, dlerror());
+ if (dlclose (h))
+ rpmlog(RPMLOG_WARNING, "Error closing library \"%s\": %s", librpmperl,
+ dlerror());
+ } else
+ dlopened = 1;
+}
+#endif
+
rpmperl rpmperlNew(char ** av, uint32_t flags)
{
- rpmperl perl =
-#ifdef NOTYET
- (flags & 0x80000000) ? rpmperlI() :
-#endif
- rpmperlGetPool(_rpmperlPool);
#if defined(WITH_PERLEMBED)
+ if (!dlopened) loadModule();
+ if (dlopened) return rpmperlNew_p(av, flags);
+#endif
+ rpmperl perl = (flags & 0x80000000)
+ ? rpmperlI() : rpmperlGetPool(_rpmperlPool);
+#if defined(MODULE_EMBED)
static const char * _av[] = { "rpmperl", NULL };
static int initialized = 0;
ARGV_t argv = NULL;
@@ -143,6 +181,9 @@ rpmperl rpmperlNew(char ** av, uint32_t
rpmRC rpmperlRun(rpmperl perl, const char * str, const char ** resultp)
{
+#if defined(WITH_PERLEMBED)
+ if (dlopened) return rpmperlRun_p(perl, str, resultp);
+#endif
rpmRC rc = RPMRC_FAIL;
if (_rpmperl_debug)
@@ -151,7 +192,7 @@ fprintf(stderr, "==> %s(%p,%s)\n", __FUN
if (perl == NULL) perl = rpmperlI();
if (str != NULL) {
-#if defined(WITH_PERLEMBED)
+#if defined(MODULE_EMBED)
STRLEN n_a;
SV * retSV;
--- rpm-5.4.10/rpmio/rpmpython.c.dlopen~ 2012-07-06 17:39:19.000000000 +0200
+++ rpm-5.4.10/rpmio/rpmpython.c 2012-07-10 20:20:37.177547334 +0200
@@ -8,9 +8,15 @@
#define _RPMPYTHON_INTERNAL
#include "rpmpython.h"
-#if defined(WITH_PYTHONEMBED)
+#if defined(MODULE_EMBED)
#include <Python.h>
#include <cStringIO.h>
+#undef WITH_PYTHONEMBED
+#endif
+
+#if defined(WITH_PYTHONEMBED)
+#include <dlfcn.h>
+#include <rpmlog.h>
#endif
#include "debug.h"
@@ -21,13 +27,20 @@ int _rpmpython_debug = 0;
/*@unchecked@*/ /*@relnull@*/
rpmpython _rpmpythonI = NULL;
+#if defined(WITH_PYTHONEMBED)
+static int dlopened = 0;
+static rpmpython (*rpmpythonNew_p) (char ** av, uint32_t flags);
+static rpmRC (*rpmpythonRunFile_p) (rpmpython python, const char * fn, const char ** resultp);
+static rpmRC (*rpmpythonRun_p) (rpmpython python, const char * str, const char ** resultp);
+#endif
+
static void rpmpythonFini(void * _python)
/*@globals fileSystem @*/
/*@modifies *_python, fileSystem @*/
{
rpmpython python = (rpmpython) _python;
-#if defined(WITH_PYTHONEMBED)
+#if defined(MODULE_EMBED)
Py_Finalize();
#endif
python->I = NULL;
@@ -51,7 +64,7 @@ static rpmpython rpmpythonGetPool(/*@nul
}
/*@unchecked@*/
-#if defined(WITH_PYTHONEMBED)
+#if defined(MODULE_EMBED)
static const char * _rpmpythonI_init = "\
import sys\n\
from cStringIO import StringIO\n\
@@ -68,10 +81,40 @@ static rpmpython rpmpythonI(void)
return _rpmpythonI;
}
+#if defined(WITH_PYTHONEMBED)
+static void loadModule(void) {
+ const char librpmpython[] = "rpmpython.so";
+ void *h;
+
+ h = dlopen (librpmpython, RTLD_NOW|RTLD_GLOBAL);
+ if (!h)
+ {
+ rpmlog(RPMLOG_WARNING, D_("Unable to open \"%s\" (%s), "
+ "embedded python will not be available\n"),
+ librpmpython, dlerror());
+ }
+ else if(!((rpmpythonNew_p = dlsym(h, "rpmpythonNew"))
+ && (rpmpythonRunFile_p = dlsym(h, "rpmpythonRunFile"))
+ && (rpmpythonRun_p = dlsym(h, "rpmpythonRun")))) {
+ rpmlog(RPMLOG_WARNING, D_("Opened library \"%s\" is incompatible (%s), "
+ "embedded python will not be available\n"),
+ librpmpython, dlerror());
+ if (dlclose (h))
+ rpmlog(RPMLOG_WARNING, "Error closing library \"%s\": %s", librpmpython,
+ dlerror());
+ } else
+ dlopened = 1;
+}
+#endif
+
rpmpython rpmpythonNew(char ** av, uint32_t flags)
{
- static char * _av[] = { (char *) "rpmpython", NULL };
#if defined(WITH_PYTHONEMBED)
+ if (!dlopened) loadModule();
+ if (dlopened) return rpmpythonNew_p(av, flags);
+#endif
+ static char * _av[] = { "rpmpython", NULL };
+#if defined(MODULE_EMBED)
int initialize = (!(flags & 0x80000000) || _rpmpythonI == NULL);
#endif
rpmpython python = (flags & 0x80000000)
@@ -82,7 +125,7 @@ fprintf(stderr, "==> %s(%p, %d) python %
if (av == NULL) av = _av;
-#if defined(WITH_PYTHONEMBED)
+#if defined(MODULE_EMBED)
if (!Py_IsInitialized()) {
Py_SetProgramName((char *)_av[0]);
Py_Initialize();
@@ -107,6 +150,9 @@ fprintf(stderr, "==========\n%s\n=======
rpmRC rpmpythonRunFile(rpmpython python, const char * fn, const char ** resultp)
{
+#if defined(WITH_PYTHONEMBED)
+ if (dlopened) return rpmpythonRunFile_p(python, fn, resultp);
+#endif
rpmRC rc = RPMRC_FAIL;
if (_rpmpython_debug)
@@ -115,7 +161,7 @@ fprintf(stderr, "==> %s(%p,%s)\n", __FUN
if (python == NULL) python = rpmpythonI();
if (fn != NULL) {
-#if defined(WITH_PYTHONEMBED)
+#if defined(MODULE_EMBED)
const char * pyfn = ((fn == NULL || !strcmp(fn, "-")) ? "<stdin>" : fn);
FILE * pyfp = (!strcmp(pyfn, "<stdin>") ? stdin : fopen(fn, "rb"));
int closeit = (pyfp != stdin);
@@ -156,6 +202,9 @@ static const char * rpmpythonSlurp(const
rpmRC rpmpythonRun(rpmpython python, const char * str, const char ** resultp)
{
+#if defined(WITH_PYTHONEMBED)
+ if (dlopened) return rpmpythonRun_p(python, str, resultp);
+#endif
rpmRC rc = RPMRC_FAIL;
if (_rpmpython_debug)
@@ -165,7 +214,7 @@ fprintf(stderr, "==> %s(%p,%s,%p)\n", __
if (str != NULL) {
const char * val = rpmpythonSlurp(str);
-#if defined(WITH_PYTHONEMBED)
+#if defined(MODULE_EMBED)
PyCompilerFlags cf = { 0 };
PyObject * m = PyImport_AddModule("__main__");
PyObject * d = (m ? PyModule_GetDict(m) : NULL);
--- rpm-5.4.10/rpmio/rpmruby.c.dlopen~ 2012-04-15 23:20:53.000000000 +0200
+++ rpm-5.4.10/rpmio/rpmruby.c 2012-07-10 20:20:02.585979790 +0200
@@ -1,17 +1,26 @@
#include "system.h"
#include <argv.h>
-#if defined(WITH_RUBYEMBED)
+#if defined(MODULE_EMBED)
/* Make sure Ruby's fun stuff has its own xmalloc & Co functions available */
#undef xmalloc
#undef xcalloc
#undef xrealloc
+/* XXX avoid conflicting definitions in ruby.h */
+#define HAVE_SETPROCTITLE 1
+
#include <ruby.h>
+#undef WITH_RUBYEMBED
#endif
+#if defined(WITH_RUBYEMBED)
+#include <dlfcn.h>
+#include <rpmlog.h>
+#endif
+
#define _RPMRUBY_INTERNAL 1
#include "rpmruby.h"
@@ -32,7 +41,7 @@ static void rpmrubyFini(void *_ruby)
{
rpmruby ruby = (rpmruby) _ruby;
-#if defined(WITH_RUBYEMBED)
+# if defined(MODULE_EMBED)
ruby_cleanup(0);
#endif
ruby->I = NULL;
@@ -88,20 +97,51 @@ static rpmruby rpmrubyI()
return _rpmrubyI;
}
+#if defined(WITH_RUBYEMBED)
+static void loadModule(void) {
+ const char librpmruby[] = "rpmruby.so";
+ void *h;
+
+ h = dlopen (librpmruby, RTLD_NOW|RTLD_GLOBAL);
+ if (!h)
+ {
+ rpmlog(RPMLOG_WARNING, D_("Unable to open \"%s\" (%s), "
+ "embedded ruby will not be available\n"),
+ librpmruby, dlerror());
+ }
+ else if(!((rpmrubyNew_p = dlsym(h, "rpmrubyNew"))
+ && (rpmrubyRun_p = dlsym(h, "rpmrubyRun")))) {
+ rpmlog(RPMLOG_WARNING, D_("Opened library \"%s\" is incompatible (%s), "
+ "embedded ruby will not be available\n"),
+ librpmruby, dlerror());
+ if (dlclose (h))
+ rpmlog(RPMLOG_WARNING, "Error closing library \"%s\": %s", librpmruby,
+ dlerror());
+ } else
+ dlopened = 1;
+}
+#endif
+
rpmruby rpmrubyNew(char **av, uint32_t flags)
{
+#if defined(WITH_RUBYEMBED)
+ if (!dlopened) loadModule();
+ if (dlopened) return rpmrubyNew_p(av, flags);
+#endif
+
static const char *_av[] = { "rpmruby", NULL };
/* XXX FIXME: recurse like every other embedded interpreter. */
if (_rpmrubyI)
return _rpmrubyI;
- rpmruby ruby = rpmrubyGetPool(_rpmrubyPool);
+ rpmruby ruby = (flags & 0x80000000)
+ ? rpmrubyI() : rpmrubyGetPool(_rpmrubyPool);
if (av == NULL)
av = (char **) _av;
-#if defined(WITH_RUBYEMBED)
+# if defined(MODULE_EMBED)
RUBY_INIT_STACK;
ruby_init();
ruby_init_loadpath();
@@ -114,9 +154,18 @@ rpmruby rpmrubyNew(char **av, uint32_t f
return rpmrubyLink(ruby);
}
+#if defined(WITH_RUBYEMBED)
+static int dlopened = 0;
+static rpmruby (*rpmrubyNew_p) (char ** av, uint32_t flags);
+static rpmRC (*rpmrubyRun_p) (rpmruby ruby, const char * str, const char ** resultp);
+#endif
rpmRC rpmrubyRun(rpmruby ruby, const char *str, const char **resultp)
{
+#if defined(WITH_RUBYEMBED)
+ if (dlopened) return rpmrubyRun_p(ruby, str, resultp);
+#endif
+
rpmRC rc = RPMRC_FAIL;
if (_rpmruby_debug)
@@ -125,7 +174,7 @@ fprintf(stderr, "==> %s(%p,%s,%p)\n", __
if (ruby == NULL)
ruby = rpmrubyI();
-#if defined(WITH_RUBYEMBED)
+#if defined(MODULE_EMBED)
if (str) {
int state = -1;
ruby->state = rb_eval_string_protect(str, &state);
--- rpm-5.4.10/rpmio/rpmsquirrel.c.dlopen~ 2012-04-15 23:20:53.000000000 +0200
+++ rpm-5.4.10/rpmio/rpmsquirrel.c 2012-07-10 20:20:02.586979777 +0200
@@ -3,9 +3,16 @@
#include <argv.h>
-#ifdef WITH_SQUIRREL
+#if defined(MODULE_EMBED)
#include <squirrel.h>
+#undef WITH_SQUIRREL
#endif
+
+#if defined(WITH_SQUIRREL)
+#include <dlfcn.h>
+#include <rpmlog.h>
+#endif
+
#define _RPMSQUIRREL_INTERNAL
#include "rpmsquirrel.h"
@@ -17,13 +24,20 @@ int _rpmsquirrel_debug = 0;
/*@unchecked@*/ /*@relnull@*/
rpmsquirrel _rpmsquirrelI = NULL;
+#if defined(WITH_SQUIRREL)
+static int dlopened = 0;
+static rpmsquirrel (*rpmsquirrelNew_p) (char ** av, uint32_t flags);
+static rpmRC (*rpmsquirrelRunFile_p) (rpmsquirrel squirrel, const char * fn, const char ** resultp);
+static rpmRC (*rpmsquirrelRun_p) (rpmsquirrel squirrel, const char * str, const char ** resultp);
+#endif
+
static void rpmsquirrelFini(void * _squirrel)
/*@globals fileSystem @*/
/*@modifies *_squirrel, fileSystem @*/
{
rpmsquirrel squirrel = (rpmsquirrel) _squirrel;
-#if defined(WITH_SQUIRREL)
+#if defined(MODULE_EMBED)
sq_close((HSQUIRRELVM)squirrel->I);
#endif
squirrel->I = NULL;
@@ -48,7 +62,7 @@ static rpmsquirrel rpmsquirrelGetPool(/*
return (rpmsquirrel) rpmioGetPool(pool, sizeof(*squirrel));
}
-#if defined(WITH_SQUIRREL)
+#if defined(MODULE_EMBED)
static void rpmsquirrelPrint(HSQUIRRELVM v, const SQChar *s, ...)
{
rpmsquirrel squirrel = sq_getforeignptr(v);
@@ -84,15 +98,42 @@ static rpmsquirrel rpmsquirrelI(void)
return _rpmsquirrelI;
}
+#if defined(WITH_SQUIRREL)
+static void loadModule(void) {
+ const char librpmsquirrel[] = "rpmsquirrel.so";
+ void *h;
+
+ h = dlopen (librpmsquirrel, RTLD_NOW|RTLD_GLOBAL);
+ if (!h)
+ {
+ rpmlog(RPMLOG_WARNING, D_("Unable to open \"%s\" (%s), "
+ "embedded squirrel will not be available\n"),
+ librpmsquirrel, dlerror());
+ }
+ else if(!((rpmsquirrelNew_p = dlsym(h, "rpmsquirrelNew"))
+ && (rpmsquirrelRunFile_p = dlsym(h, "rpmsquirrelRunFile"))
+ && (rpmsquirrelRun_p = dlsym(h, "rpmsquirrelRun")))) {
+ rpmlog(RPMLOG_WARNING, D_("Opened library \"%s\" is incompatible (%s), "
+ "embedded squirrel will not be available\n"),
+ librpmsquirrel, dlerror());
+ if (dlclose (h))
+ rpmlog(RPMLOG_WARNING, "Error closing library \"%s\": %s", librpmsquirrel,
+ dlerror());
+ } else
+ dlopened = 1;
+}
+#endif
+
rpmsquirrel rpmsquirrelNew(char ** av, uint32_t flags)
{
- rpmsquirrel squirrel =
-#ifdef NOTYET
- (flags & 0x80000000) ? rpmsquirrelI() :
+#if defined(WITH_SQUIRREL)
+ if (!dlopened) loadModule();
+ if (dlopened) return rpmsquirrelNew_p(av, flags);
#endif
- rpmsquirrelGetPool(_rpmsquirrelPool);
+ rpmsquirrel squirrel = (flags & 0x80000000)
+ ? rpmsquirrelI() : rpmsquirrelGetPool(_rpmsquirrelPool);
-#if defined(WITH_SQUIRREL)
+#if defined(MODULE_EMBED)
static const char * _av[] = { "rpmsquirrel", NULL };
SQInteger stacksize = 1024;
HSQUIRRELVM v = sq_open(stacksize);
@@ -119,13 +160,18 @@ rpmsquirrel rpmsquirrelNew(char ** av, u
}
#endif
#endif
+#if !defined(WITH_SQUIRREL)
squirrel->iob = rpmiobNew(0);
+#endif
return rpmsquirrelLink(squirrel);
}
rpmRC rpmsquirrelRunFile(rpmsquirrel squirrel, const char * fn, const char ** resultp)
{
+#if defined(WITH_SQUIRREL)
+ if (dlopened) return rpmsquirrelRunFile_p(squirrel, fn, resultp);
+#endif
rpmRC rc = RPMRC_FAIL;
if (_rpmsquirrel_debug)
@@ -145,6 +191,10 @@ fprintf(stderr, "==> %s(%p,%s)\n", __FUN
rpmRC rpmsquirrelRun(rpmsquirrel squirrel, const char * str, const char ** resultp)
{
+#if defined(WITH_SQUIRREL)
+ if (dlopened) return rpmsquirrelRun_p(squirrel, str, resultp);
+#endif
+
rpmRC rc = RPMRC_FAIL;
if (_rpmsquirrel_debug)
@@ -152,7 +202,7 @@ fprintf(stderr, "==> %s(%p,%s)\n", __FUN
if (squirrel == NULL) squirrel = rpmsquirrelI();
-#if defined(WITH_SQUIRREL)
+#if defined(MODULE_EMBED)
if (str != NULL) {
size_t ns = strlen(str);
if (ns > 0) {
--- rpm-5.4.10/rpmio/rpmtcl.c.dlopen~ 2012-04-15 23:20:53.000000000 +0200
+++ rpm-5.4.10/rpmio/rpmtcl.c 2012-07-10 20:20:02.588979751 +0200
@@ -2,9 +2,16 @@
#include <argv.h>
-#ifdef WITH_TCL
+#if defined(MODULE_EMBED)
#include <tcl.h>
+#undef WITH_TCL
#endif
+
+#if defined(WITH_TCL)
+#include <dlfcn.h>
+#include <rpmlog.h>
+#endif
+
#define _RPMTCL_INTERNAL
#include "rpmtcl.h"
@@ -16,13 +23,20 @@ int _rpmtcl_debug = 0;
/*@unchecked@*/ /*@relnull@*/
rpmtcl _rpmtclI = NULL;
+#if defined(WITH_TCL)
+static int dlopened = 0;
+static rpmtcl (*rpmtclNew_p) (char ** av, uint32_t flags);
+static rpmRC (*rpmtclRunFile_p) (rpmtcl tcl, const char * fn, const char ** resultp);
+static rpmRC (*rpmtclRun_p) (rpmtcl tcl, const char * str, const char ** resultp);
+#endif
+
static void rpmtclFini(void * _tcl)
/*@globals fileSystem @*/
/*@modifies *_tcl, fileSystem @*/
{
rpmtcl tcl = (rpmtcl) _tcl;
-#if defined(WITH_TCL)
+#if defined(MODULE_EMBED)
Tcl_DeleteInterp((Tcl_Interp *)tcl->I);
#endif
tcl->I = NULL;
@@ -47,7 +61,7 @@ static rpmtcl rpmtclGetPool(/*@null@*/ r
return (rpmtcl) rpmioGetPool(pool, sizeof(*tcl));
}
-#if defined(WITH_TCL)
+#if defined(MODULE_EMBED)
static int rpmtclIOclose(ClientData CD, Tcl_Interp *I)
/*@*/
{
@@ -122,15 +136,42 @@ static rpmtcl rpmtclI(void)
return _rpmtclI;
}
+#if defined(WITH_TCL)
+static void loadModule(void) {
+ const char librpmtcl[] = "rpmtcl.so";
+ void *h;
+
+ h = dlopen (librpmtcl, RTLD_NOW|RTLD_GLOBAL);
+ if (!h)
+ {
+ rpmlog(RPMLOG_WARNING, D_("Unable to open \"%s\" (%s), "
+ "embedded tcl will not be available\n"),
+ librpmtcl, dlerror());
+ }
+ else if(!((rpmtclNew_p = dlsym(h, "rpmtclNew"))
+ && (rpmtclRunFile_p = dlsym(h, "rpmtclRunFile"))
+ && (rpmtclRun_p = dlsym(h, "rpmtclRun")))) {
+ rpmlog(RPMLOG_WARNING, D_("Opened library \"%s\" is incompatible (%s), "
+ "embedded tcl will not be available\n"),
+ librpmtcl, dlerror());
+ if (dlclose (h))
+ rpmlog(RPMLOG_WARNING, "Error closing library \"%s\": %s", librpmtcl,
+ dlerror());
+ } else
+ dlopened = 1;
+}
+#endif
+
rpmtcl rpmtclNew(char ** av, uint32_t flags)
{
- rpmtcl tcl =
-#ifdef NOTYET
- (flags & 0x80000000) ? rpmtclI() :
+#if defined(WITH_TCL)
+ if (!dlopened) loadModule();
+ if (dlopened) return rpmtclNew_p(av, flags);
#endif
- rpmtclGetPool(_rpmtclPool);
+ rpmtcl tcl = (flags & 0x80000000)
+ ? rpmtclI() : rpmtclGetPool(_rpmtclPool);
-#if defined(WITH_TCL)
+#if defined(MODULE_EMBED)
static char * _av[] = { "rpmtcl", NULL };
Tcl_Interp * tclI = Tcl_CreateInterp();
char b[32];
@@ -152,13 +193,18 @@ rpmtcl rpmtclNew(char ** av, uint32_t fl
tcl->tclout = (void *) tclout;
}
#endif
+#if !defined(WITH_TCL)
tcl->iob = rpmiobNew(0);
+#endif
return rpmtclLink(tcl);
}
rpmRC rpmtclRunFile(rpmtcl tcl, const char * fn, const char ** resultp)
{
+#if defined(WITH_TCL)
+ if (dlopened) return rpmtclRunFile_p(tcl, fn, resultp);
+#endif
rpmRC rc = RPMRC_FAIL;
if (_rpmtcl_debug)
@@ -166,7 +212,7 @@ fprintf(stderr, "==> %s(%p,%s)\n", __FUN
if (tcl == NULL) tcl = rpmtclI();
-#if defined(WITH_TCL)
+#if defined(MODULE_EMBED)
if (fn != NULL && Tcl_EvalFile((Tcl_Interp *)tcl->I, fn) == TCL_OK) {
rc = RPMRC_OK;
if (resultp)
@@ -178,6 +224,9 @@ fprintf(stderr, "==> %s(%p,%s)\n", __FUN
rpmRC rpmtclRun(rpmtcl tcl, const char * str, const char ** resultp)
{
+#if defined(WITH_TCL)
+ if (dlopened) return rpmtclRun_p(tcl, str, resultp);
+#endif
rpmRC rc = RPMRC_FAIL;
if (_rpmtcl_debug)
@@ -185,7 +234,7 @@ fprintf(stderr, "==> %s(%p,%s)\n", __FUN
if (tcl == NULL) tcl = rpmtclI();
-#if defined(WITH_TCL)
+#if defined(MODULE_EMBED)
if (str != NULL && Tcl_Eval((Tcl_Interp *)tcl->I, str) == TCL_OK) {
rc = RPMRC_OK;
if (resultp)
--- rpm-5.4.10/ruby/Makefile.am.dlopen~ 2011-09-13 03:12:53.000000000 +0200
+++ rpm-5.4.10/ruby/Makefile.am 2012-07-10 20:20:02.588979751 +0200
@@ -50,8 +50,8 @@ pkgbindir = @USRLIBRPM@/bin
pkgbin_PROGRAMS = trb
pkglib_LTLIBRARIES = rpm.la
-rpm_la_CFLAGS = -fno-strict-aliasing
-rpm_la_LDFLAGS = -module -avoid-version
+rpm_la_CFLAGS = -fno-strict-aliasing $(WITH_RUBY_CFLAGS)
+rpm_la_LDFLAGS = -module -avoid-version $(WITH_RUBY_LDFLAGS)
rpm_la_LIBADD = \
$(top_builddir)/build/librpmbuild.la \
$(top_builddir)/lib/librpm.la \
--- rpm-5.4.10/ruby/system.h.dlopen~ 2010-12-01 17:09:50.000000000 +0100
+++ rpm-5.4.10/ruby/system.h 2012-07-10 20:20:02.589979738 +0200
@@ -2,6 +2,7 @@
#define H_SYSTEM_RUBY
#include "../system.h"
+#define HAVE_SETPROCTITLE 1
/* XXX ruby-1.8.6 grrr, ruby.h includes its own config.h too. */
#undef PACKAGE_NAME

View file

@ -1,10 +0,0 @@
--- rpm-5.4.10/rpmio/rpmmalloc.c~ 2013-03-04 10:30:01.765906904 +0100
+++ rpm-5.4.10/rpmio/rpmmalloc.c 2013-03-04 10:30:03.707920379 +0100
@@ -28,6 +28,7 @@ GENfree(rpmioItem)
/*@only@*/ void *vmefail(size_t size)
{
fprintf(stderr, _("memory alloc (%u bytes) returned NULL.\n"), (unsigned)size);
+ assert(0);
exit(EXIT_FAILURE);
/*@notreached@*/
/*@-nullret@*/

View file

@ -1,19 +0,0 @@
Index: rpm/lib/transaction.c
RCS File: /v/rpm/cvs/rpm/lib/transaction.c,v
rcsdiff -q -kk '-r1.429.2.12' '-r1.429.2.13' -u '/v/rpm/cvs/rpm/lib/transaction.c,v' 2>/dev/null
--- rpm/lib/transaction.c 2012/06/04 15:10:11 1.429.2.12
+++ rpm/lib/transaction.c 2012/12/04 18:48:32 1.429.2.13
@@ -2244,9 +2244,11 @@
}
/* ===============================================
- * Save removed files before erasing.
+ * Save removed files before erasing (w/o --justdb).
*/
- if (TSF_ISSET(tsflags, DIRSTASH) || TSF_ISSET(tsflags, REPACKAGE)) {
+ if ((TSF_ISSET(tsflags, DIRSTASH) || TSF_ISSET(tsflags, REPACKAGE))
+ && !TSF_ISSET(tsflags, JUSTDB))
+ {
xx = rpmtsRepackage(ts, numRemoved);
}

View file

@ -1,51 +0,0 @@
--- rpm-5.4.10/lib/rpmfc.c.skip_doc~ 2012-07-28 17:19:43.136069278 +0200
+++ rpm-5.4.10/lib/rpmfc.c 2012-07-28 17:25:16.778898168 +0200
@@ -818,7 +818,17 @@ static int rpmfcSCRIPT(rpmfc fc)
int i;
int is_executable;
int xx;
- const char * defaultdocdir = NULL;
+
+ /* Don't generate dependencies from files shipped as documentation */
+ if (!rpmExpandNumeric("%{_generate_dependencies_from_docdir}")) {
+ const char * defaultdocdir = rpmExpand("%{?_defaultdocdir}", NULL);
+ if (defaultdocdir == NULL || *defaultdocdir == '\0')
+ defaultdocdir = strdup("/usr/share/doc");
+ xx = !strncmp(fn+fc->brlen, defaultdocdir, strlen(defaultdocdir));
+ defaultdocdir = _free(defaultdocdir) ;
+ if (xx)
+ return 0;
+ }
/* Extract dependencies only from files with executable bit set. */
{ struct stat sb, * st = &sb;
@@ -904,16 +914,10 @@ static int rpmfcSCRIPT(rpmfc fc)
(void) fclose(fp);
if (fc->fcolor->vals[fc->ix] & RPMFC_PERL) {
- defaultdocdir = rpmExpand("%{?_defaultdocdir}", NULL);
- if (defaultdocdir == NULL || *defaultdocdir == '\0')
- defaultdocdir = strdup("/usr/share/doc");
-
- if (strncmp(fn, defaultdocdir, strlen(defaultdocdir))) {
- if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)
- xx = rpmfcHelper(fc, 'P', "perl");
- if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
- xx = rpmfcHelper(fc, 'R', "perl");
- }
+ if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)
+ xx = rpmfcHelper(fc, 'P', "perl");
+ if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
+ xx = rpmfcHelper(fc, 'R', "perl");
} else
if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) {
xx = rpmfcHelper(fc, 'P', "python");
@@ -1009,8 +1013,6 @@ static int rpmfcSCRIPT(rpmfc fc)
#endif
}
-/*@-observertrans@*/
- defaultdocdir = _free(defaultdocdir) ;
/*@=observertrans@*/
return 0;
}

View file

@ -1,41 +0,0 @@
--- rpm-5.4.10/perl/Makefile.PL.in.droprpath~ 2012-03-23 00:45:15.000000000 +0100
+++ rpm-5.4.10/perl/Makefile.PL.in 2013-01-06 23:30:23.640064511 +0100
@@ -6,8 +6,6 @@ use ExtUtils::MakeMaker;
my @libdir = qw(. build lib popt rpmdb rpmio misc rpmconstant);
-# use $ORIGIN relative paths to avoid LD_LIBRARY_PATH nonsense in tree
-my @ldaddr = map { '-Wl,-rpath,\$$\ORIGIN/../../../../../' . $_ . '/.libs' } @libdir;
my @ldaddp = map { '-L@top_builddir@/' . $_ . '/.libs' } @libdir;
my @ldadd = map { '-l' . $_ } qw(rpmmisc rpmio rpmbuild rpm popt rpmdb rpmconstant);
@@ -62,17 +60,16 @@ sub xs_o {
}
WriteMakefile(
- 'NAME' => 'RPM',
- 'OBJECT' => join(' ', @objects),
- 'VERSION' => '@VERSION@',
- 'MAKEFILE'=> 'Makefile.perl',
- 'CCFLAGS' => join(' ', '@CFLAGS@', '-Wno-unused-variable', '-Wno-missing-prototypes', '-Wno-implicit', '-Wno-strict-prototypes'),
- 'dynamic_lib' => {
- OTHERLDFLAGS => join(' ', @ldaddp, @ldadd, @ldlibs, @ldaddr)
- },
- 'OPTIMIZE'=> '-g',
- 'INC' => join(' ', @cppflags, map { '-I@top_srcdir@/'. $_ } @libdir) . ' @CPPFLAGS@',
- 'INSTALLMAN1DIR' => '@mandir@/man1',
- 'INSTALLMAN3DIR' => '@mandir@/man3',
- @PERL_INSTALLDIRS@
+ 'NAME' => 'RPM',
+ 'OBJECT' => join(' ', @objects),
+ 'VERSION' => '@VERSION@',
+ 'MAKEFILE'=> 'Makefile.perl',
+ 'CCFLAGS' => join(' ', '@CFLAGS@', '-Wno-unused-variable', '-Wno-missing-prototypes', '-Wno-implicit', '-Wno-strict-prototypes'),
+ 'dynamic_lib' => { OTHERLDFLAGS => join(' ', @ldaddp, @ldadd, @ldlibs) },
+ 'OPTIMIZE'=> '-g',
+ 'INC' => join(' ', @cppflags, map { '-I@top_srcdir@/'. $_ } @libdir) . ' @CPPFLAGS@',
+ 'INSTALLMAN1DIR' => '@mandir@/man1',
+ 'INSTALLMAN3DIR' => '@mandir@/man3',
+ @PERL_INSTALLDIRS@
);
+

View file

@ -1,67 +0,0 @@
--- rpm-5.4.10/build/files.c.dups_terminate~ 2012-07-10 20:09:01.125249185 +0200
+++ rpm-5.4.10/build/files.c 2012-07-10 20:09:01.135249061 +0200
@@ -2917,7 +2917,8 @@ exit:
/* auxiliary function for checkDuplicateFiles() */
/* XXX need to pass Header because fi->h is NULL */
-static int fiIntersect(/*@null@*/ rpmfi fi1, /*@null@*/ rpmfi fi2, size_t buildrootL)
+static int fiIntersect(/*@null@*/ rpmfi fi1, /*@null@*/ rpmfi fi2,
+ size_t buildrootL, int _duplicate_files_terminate_build)
/*@globals internalState @*/
/*@modifies fi1, fi2, internalState @*/
{
@@ -2955,7 +2956,7 @@ static int fiIntersect(/*@null@*/ rpmfi
he->tag = RPMTAG_NVRA;
N2 = (headerGet(fi2->h, he, 0) ? he->p.str : NULL);
- rpmlog(RPMLOG_WARNING,
+ rpmlog(_duplicate_files_terminate_build ? RPMLOG_ERR : RPMLOG_WARNING,
_("File(s) packaged into both %s and %s:\n%s"),
N1, N2, rpmiobStr(dups));
@@ -2972,7 +2973,8 @@ static int fiIntersect(/*@null@*/ rpmfi
* @param spec spec file control structure
* @return number of duplicate files
*/
-static int checkDuplicateFiles(Spec spec, size_t buildrootL)
+static int checkDuplicateFiles(Spec spec, size_t buildrootL,
+ int _duplicate_files_terminate_build)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies *spec->packages,
rpmGlobalMacroContext, fileSystem, internalState @*/
@@ -2997,7 +2999,7 @@ static int checkDuplicateFiles(Spec spec
#endif
if (fi2 == NULL) continue;
(void) rpmfiSetHeader(fi2, pkg2->header);
- n += fiIntersect(fi1, fi2, buildrootL);
+ n += fiIntersect(fi1, fi2, buildrootL, _duplicate_files_terminate_build);
(void) rpmfiSetHeader(fi2, NULL);
fi2 = rpmfiFree(fi2);
}
@@ -3181,9 +3183,13 @@ rpmRC processBinaryFiles(Spec spec, int
}
if (res == RPMRC_OK) {
+ int _duplicate_files_terminate_build =
+ rpmExpandNumeric("%{?_duplicate_files_terminate_build}");
if (checkUnpackagedFiles(spec) > 0)
res = RPMRC_FAIL;
- (void) checkDuplicateFiles(spec, buildrootL);
+ if (checkDuplicateFiles(spec, buildrootL, _duplicate_files_terminate_build) > 0 &&
+ _duplicate_files_terminate_build)
+ res = RPMRC_FAIL;
(void) checkUnpackagedSubdirs(spec, buildrootL);
}
--- rpm-5.4.10/macros/mandriva.in.dups_terminate~ 2012-05-19 22:35:44.000000000 +0200
+++ rpm-5.4.10/macros/mandriva.in 2012-07-10 20:13:41.582742985 +0200
@@ -126,6 +126,9 @@ end\
# use XZ to compress binary packages:
%_binary_payload w5.xzdio
+%_duplicate_files_terminate_build 1
+
+
%_build_pkgcheck_set /usr/bin/rpmlint -T -f %{_sourcedir}/%{name}.rpmlintrc
%_build_pkgcheck_srpm /usr/bin/rpmlint -T -f %{_sourcedir}/%{name}.rpmlintrc
%_nonzero_exit_pkgcheck_terminate_build 1

View file

@ -1,11 +0,0 @@
--- rpm-5.4.10/macros/mandriva.in~ 2013-04-02 08:31:46.123220885 +0200
+++ rpm-5.4.10/macros/mandriva.in 2013-04-02 08:33:23.468152733 +0200
@@ -187,6 +187,8 @@ export CFLAGS="%{optflags} -fPIE"; expor
# 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers
%_vsflags_query 0xc0c00
+# enable nofsync when rebuilding rpmdb
+%__dbi_rebuild nofsync
# Open all indices before doing chroot(2).
#

View file

@ -1,13 +0,0 @@
--- rpm-5.4.10/macros/mandriva.in.rename~ 2013-02-24 23:17:05.947081929 +0100
+++ rpm-5.4.10/macros/mandriva.in 2013-02-25 00:33:33.342514014 +0100
@@ -47,8 +47,8 @@
%EVRD %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}%{?distepoch::%{distepoch}}
%rename() \
-Obsoletes: %{1} < %{EVRD} \
-Provides: %{1} = %{EVRD}
+Obsoletes: %{1} < %{?2}%{!?2:%{EVRD}} \
+Provides: %{1} = %{?2}%{!?2:%{EVRD}}
%_default_patch_flags -s -U

View file

@ -1,11 +0,0 @@
--- rpm-5.4.10.orig/macros/mandriva.in 2014-05-26 14:37:35.534125641 +0400
+++ rpm-5.4.10/macros/mandriva.in 2014-05-26 14:38:35.576130442 +0400
@@ -160,7 +160,7 @@
%Werror_cflags -Wformat -Werror=format-security
%_ssp_cflags -fstack-protector --param=ssp-buffer-size=4%{?_serverbuild_flags: %_serverbuild_flags}
-%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags}
+%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags} -ffat-lto-objects
%__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags}
# Servers opt flags.

View file

@ -1,74 +0,0 @@
--- rpm-5.4.10/build/files.c.twice_terminate~ 2012-07-10 20:18:14.613329633 +0200
+++ rpm-5.4.10/build/files.c 2012-07-10 20:18:14.677328833 +0200
@@ -1329,7 +1329,7 @@ static rpmuint32_t getDigestAlgo(Header
* @param h
* @param isSrc
*/
-static void genCpioListAndHeader(/*@partial@*/ FileList fl,
+static rpmRC genCpioListAndHeader(/*@partial@*/ FileList fl,
rpmfi * fip, Header h, int isSrc)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, *fip, fl->processingFailed, fl->fileList,
@@ -1349,6 +1349,7 @@ static void genCpioListAndHeader(/*@part
rpmuint32_t dalgo = getDigestAlgo(h, isSrc);
char buf[BUFSIZ];
int i, xx;
+ rpmRC rc = RPMRC_OK;
memset(buf, 0, sizeof(buf)); /* XXX valgrind on rhel6 beta pickier */
@@ -1377,9 +1378,14 @@ memset(buf, 0, sizeof(buf)); /* XXX valg
/* file flags */
flp[1].flags |= flp->flags;
- if (!(flp[1].flags & RPMFILE_EXCLUDE))
- rpmlog(RPMLOG_WARNING, _("File listed twice: %s\n"),
+ if (!(flp[1].flags & RPMFILE_EXCLUDE)) {
+ int terminate = rpmExpandNumeric("%{?_files_listed_twice_terminate_build}");
+
+ rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING, _("File listed twice: %s\n"),
flp->fileURL);
+ if (terminate)
+ rc = RPMRC_FAIL;
+ }
/* file mode */
if (S_ISDIR(flp->fl_mode)) {
@@ -1792,6 +1798,8 @@ if (_rpmbuildFlags & 4) {
fi = rpmfiFree(fi);
/*@=compdef@*/
}
+
+ return rc;
}
/**
@@ -2514,7 +2522,8 @@ static rpmRC processPackageFiles(Spec sp
"PartialHardlinkSets", "4.0.4-1");
/* XXX should tags be added if filelist is empty? */
- genCpioListAndHeader(&fl, &pkg->fi, pkg->header, 0);
+ if (genCpioListAndHeader(&fl, &pkg->fi, pkg->header, 0) != RPMRC_OK)
+ fl.processingFailed = 1;
if (spec->timeCheck)
timeCheck(spec->timeCheck, pkg->header);
@@ -2828,7 +2837,7 @@ int processSourceFiles(Spec spec)
/* XXX should tags be added if filelist is empty? */
spec->fi = NULL;
- genCpioListAndHeader(&fl, &spec->fi, spec->sourceHeader, 1);
+ rc = genCpioListAndHeader(&fl, &spec->fi, spec->sourceHeader, 1);
exit:
*sfp = rpmiobFree(*sfp);
--- rpm-5.4.10/macros/mandriva.in.twice_terminate~ 2012-07-10 20:18:14.000000000 +0200
+++ rpm-5.4.10/macros/mandriva.in 2012-07-10 20:18:32.060111516 +0200
@@ -128,6 +128,7 @@ end\
%_duplicate_files_terminate_build 1
%_unpackaged_subdirs_terminate_build 0
+%_files_listed_twice_terminate_build 1
%_build_pkgcheck_set /usr/bin/rpmlint -T -f %{_sourcedir}/%{name}.rpmlintrc
%_build_pkgcheck_srpm /usr/bin/rpmlint -T -f %{_sourcedir}/%{name}.rpmlintrc

View file

@ -1,29 +0,0 @@
diff -urN rpm-5.4.10/scripts/find-lang.sh rpm-5.4.10-patched/scripts/find-lang.sh
--- rpm-5.4.10/scripts/find-lang.sh 2012-06-02 00:29:07.000000000 +1100
+++ rpm-5.4.10-patched/scripts/find-lang.sh 2015-03-12 14:56:08.000000000 +1000
@@ -192,9 +192,9 @@
s:%lang(C) ::
/^$/d' >> $MO_NAME
-KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null`
-if [ x"$KDE3_HTML" != x -a -d "$TOP_DIR$KDE3_HTML" ]; then
-find "$TOP_DIR$KDE3_HTML" -type d|sed '
+KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null`
+if [ x"$KDE4_HTML" != x -a -d "$TOP_DIR$KDE4_HTML" ]; then
+find "$TOP_DIR$KDE4_HTML" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'/\)::
'"$NO_ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) \1\2\3:
@@ -205,9 +205,9 @@
/^$/d' >> $MO_NAME
fi
-KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null`
-if [ x"$KDE4_HTML" != x -a -d "$TOP_DIR$KDE4_HTML" ]; then
-find "$TOP_DIR$KDE4_HTML" -type d|sed '
+KDE5_HTML="/usr/share/doc5/HTML/"
+if [ -d "$TOP_DIR$KDE5_HTML" ]; then
+find "$TOP_DIR$KDE5_HTML" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'/\)::
'"$NO_ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) \1\2\3:

View file

@ -1,11 +0,0 @@
--- rpm-5.4.10/rpmdb/header.c.ui64p~ 2013-03-18 12:43:09.043950947 +0100
+++ rpm-5.4.10/rpmdb/header.c 2013-03-18 12:44:35.059800829 +0100
@@ -398,7 +398,7 @@ static unsigned char * tagSwab(/*@out@*/
switch (he->t) {
case RPM_UINT64_TYPE:
{ rpmuint32_t * tt = (rpmuint32_t *)t;
-assert(nb == (he->c * sizeof(*tt)));
+assert(nb == (he->c * sizeof(rpmuint64_t)));
for (i = 0; i < he->c; i++) {
rpmuint32_t j = 2 * i;
rpmuint32_t b = (rpmuint32_t) htonl(he->p.ui32p[j]);

View file

@ -1,11 +0,0 @@
--- rpm-5.4.10/tools/debugedit.c.debugedit_memleaks~ 2012-05-19 22:14:30.000000000 +0200
+++ rpm-5.4.10/tools/debugedit.c 2013-01-03 09:24:01.764153125 +0100
@@ -1689,6 +1689,8 @@ main (int argc, char *argv[])
/* Restore old access rights */
chmod (file, stat_buf.st_mode);
+ _free(dso->filename);
+ _free(dso);
poptFreeContext (optCon);
return 0;

View file

@ -1,20 +0,0 @@
diff -ur rpm-5.4.10/build/pack.c rpm-5.4.10.new/build/pack.c
--- rpm-5.4.10/build/pack.c 2012-05-20 00:24:58.000000000 +0400
+++ rpm-5.4.10.new/build/pack.c 2015-04-07 17:54:36.410943594 +0300
@@ -649,7 +649,7 @@
char buf[BUFSIZ];
Header h;
Header sigh = NULL;
- int addsig = 0;
+ int addsig = (passPhrase && passPhrase[0]);
int isSource;
rpmRC rc = RPMRC_OK;
size_t nbr;
@@ -859,7 +859,6 @@
(void) rpmAddSignature(sigh, sigtarget, RPMSIGTAG_MD5, passPhrase);
sigtag = RPMSIGTAG_GPG;
- addsig = (passPhrase && passPhrase[0]);
if (addsig) {
rpmlog(RPMLOG_NOTICE, _("Generating signature: %d\n"), sigtag);

View file

@ -1,20 +0,0 @@
diff -urN rpm-5.4.10-orig/lib/rpmfc.c rpm-5.4.10-patched/lib/rpmfc.c
--- rpm-5.4.10-orig/lib/rpmfc.c 2018-06-21 16:46:02.416087354 +1000
+++ rpm-5.4.10-patched/lib/rpmfc.c 2018-06-21 16:54:06.839041871 +1000
@@ -1468,6 +1468,16 @@
else if (_suffix(s, "qmldir"))
ftype = "qml file";
+ /* XXX all files with extension ".egg" are ASCII text for now. */
+ /* XXX python code examples from them give false Python script result. */
+ else if (_suffix(s, ".egg"))
+ ftype = "ASCII text";
+
+ /* XXX all files with extension ".egg-info" are ASCII text for now. */
+ /* XXX python code examples from them give false Python script result. */
+ else if (_suffix(s, ".egg-info"))
+ ftype = "ASCII text";
+
/* XXX all files with extension ".php" are PHP for now. */
else if (_suffix(s, ".php"))
ftype = "PHP script text";

View file

@ -1,11 +0,0 @@
--- rpm-5.4.10/lib/rpmfc.c.fontdep_sure~ 2013-04-16 02:17:42.052532219 +0200
+++ rpm-5.4.10/lib/rpmfc.c 2013-04-16 02:18:44.003630165 +0200
@@ -971,7 +971,7 @@ static int rpmfcSCRIPT(rpmfc fc)
if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
xx = rpmfcHelper(fc, 'R', "ruby");
} else
- if (fc->fcolor->vals[fc->ix] & RPMFC_FONT) {
+ if ((fc->fcolor->vals[fc->ix] == (RPMFC_FONT|RPMFC_INCLUDE))) {
xx = rpmfcHelper(fc, 'P', "font");
/* XXX: currently of no use, but for the sake of consistency... */
xx = rpmfcHelper(fc, 'R', "font");

View file

@ -1,58 +0,0 @@
diff -urN rpm-5.4.10/lib/depends.c rpm-5.4.10-patched/lib/depends.c
--- rpm-5.4.10/lib/depends.c 2012-04-16 08:20:56.000000000 +1100
+++ rpm-5.4.10-patched/lib/depends.c 2017-01-24 22:01:08.293412374 +1000
@@ -58,7 +58,13 @@
{
const uint32_t * aptr = (const uint32_t *) a;
const uint32_t * bptr = (const uint32_t *) b;
- int rc = (*aptr - *bptr);
+ int rc;
+ if (*aptr > *bptr)
+ rc = 1;
+ else if (*aptr < *bptr)
+ rc = -1;
+ else
+ rc = 0;
return rc;
}
diff -urN rpm-5.4.10/lib/rpmts.c rpm-5.4.10-patched/lib/rpmts.c
--- rpm-5.4.10/lib/rpmts.c 2012-04-16 08:20:58.000000000 +1100
+++ rpm-5.4.10-patched/lib/rpmts.c 2017-01-24 22:00:48.517412898 +1000
@@ -1211,20 +1211,32 @@
*/
case FA_CREATE:
dsi->bneeded += bneeded;
- dsi->bneeded -= BLOCK_ROUND(prevSize, dsi->f_bsize);
+ bneeded = BLOCK_ROUND(prevSize, dsi->f_bsize);
+ if (dsi->bneeded > bneeded)
+ dsi->bneeded -= bneeded;
+ else
+ dsi->bneeded = 0;
/*@switchbreak@*/ break;
case FA_ERASE:
dsi->ineeded--;
- dsi->bneeded -= bneeded;
+ if (dsi->bneeded > bneeded)
+ dsi->bneeded -= bneeded;
+ else
+ dsi->bneeded = 0;
/*@switchbreak@*/ break;
default:
/*@switchbreak@*/ break;
}
- if (fixupSize)
- dsi->bneeded -= BLOCK_ROUND(fixupSize, dsi->f_bsize);
+ if (fixupSize) {
+ bneeded = BLOCK_ROUND(fixupSize, dsi->f_bsize);
+ if (dsi->bneeded > bneeded)
+ dsi->bneeded -= bneeded;
+ else
+ dsi->bneeded = 0;
+ }
}
void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)

View file

@ -1,12 +0,0 @@
--- rpm-5.4.10/macros/mandriva.in.ldflags~ 2012-10-30 09:49:34.586248202 +0100
+++ rpm-5.4.10/macros/mandriva.in 2012-10-31 13:12:19.439849728 +0100
@@ -349,7 +349,8 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} -
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
- %(if [ -n '%ldflags' ]; then echo 'LDFLAGS="$LDFLAGS%ldflags"; export LDFLAGS ;'; fi)
+ %{?ldflags:LDFLAGS="${LDFLAGS:-%{ldflags}}"; export LDFLAGS ;} \
+ %{nil}
%before_configure \
%setup_compile_flags \

View file

@ -1,12 +0,0 @@
--- rpm-5.4.10/rpmdb/rpmdb.c.xrealloc~ 2013-03-19 10:57:50.188039986 +0100
+++ rpm-5.4.10/rpmdb/rpmdb.c 2013-03-26 15:16:47.114499354 +0100
@@ -2660,7 +2660,8 @@ assert(keylen == sizeof(hdrNum));
}
if(set && set->count != size) {
set->count = size;
- set->recs = xrealloc(set->recs, size * sizeof(*set->recs));
+ if (size)
+ set->recs = xrealloc(set->recs, size * sizeof(*set->recs));
}
xx = dbiCclose(pdbi, pdbc, 0);

View file

@ -1,56 +0,0 @@
--- rpm-5.4.10/rpmio/rpmdav.c.dl_error~ 2012-07-06 17:39:19.000000000 +0200
+++ rpm-5.4.10/rpmio/rpmdav.c 2012-07-11 19:49:00.504968365 +0200
@@ -1722,6 +1722,7 @@ int davReq(FD_t ctrl, const char * httpC
{
urlinfo u;
int rc = 0;
+ const ne_status *status;
assert(ctrl != NULL);
u = (urlinfo) ctrl->u;
@@ -1789,10 +1790,24 @@ assert(ctrl->req != NULL);
}
/* XXX somewhere else instead? */
-if (_dav_debug) {
- const ne_status *status = ne_get_status((ne_request *)ctrl->req);
-fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase);
-}
+ status = ne_get_status((ne_request *)ctrl->req);
+ if (_dav_debug)
+ fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase);
+
+ switch (status->code) {
+ case 200:
+ case 201: /* 201 Created. */
+ break;
+ case 204: /* HACK: if overwriting, 204 No Content. */
+ case 403: /* 403 Forbidden. */
+ rc = FTPERR_UNKNOWN;
+ break;
+ default:
+ rc = FTPERR_FILE_NOT_FOUND;
+ break;
+ }
+ if (rc || _dav_debug)
+ fprintf(stderr, "HTTP request sent, awaiting response... %d %s\n", status->code, status->reason_phrase);
if (rc)
goto errxit;
--- rpm-5.4.10/rpmio/rpmio.c.dl_error~ 2012-07-06 17:39:19.000000000 +0200
+++ rpm-5.4.10/rpmio/rpmio.c 2012-07-11 19:47:59.396732322 +0200
@@ -2306,9 +2306,12 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o
u->openError = httpReq(fd, cmd, path);
#endif
if (u->openError < 0) {
+ /* XXX rpmdav doesn't behave consistently with the rest...*/
+#ifndef WITH_NEON
/* XXX make sure that we can exit through ufdClose */
- fd = fdLink(fd, "error ctrl (ufdOpen HTTP)");
- fd = fdLink(fd, "error data (ufdOpen HTTP)");
+ fd = u->ctrl = fdLink(fd, "error ctrl (ufdOpen HTTP)");
+ fd = u->data fdLink(fd, "error data (ufdOpen HTTP)");
+#endif
} else {
fd->bytesRemain = ((!strcmp(cmd, "GET"))
? fd->contentLength : -1);

View file

@ -1,22 +0,0 @@
--- rpm-5.4.10/scripts/perl.prov.perl_abiver~ 2012-12-19 01:42:07.219674388 +0100
+++ rpm-5.4.10/scripts/perl.prov 2012-12-19 01:42:13.285755596 +0100
@@ -97,11 +97,15 @@ sub process_file {
my ($file) = @_;
if ($file =~ m/$Config{archname}\/Config.pm$/) {
- my $vercmd = "perl -I". File::Basename::dirname($file) . " -MConfig -e 'print \"\$Config{version}\"'";
- my $v = `$vercmd`;
- if ($v) {
- $require{"abi"} = $v;
+ my $vercmd = "perl -I". File::Basename::dirname($file) . " -MConfig -e 'print \"VERSION=\$Config{version}\"'";
+ my $v = `$vercmd 2>&1`;
+ if ($v) {
+ if ($? && $v =~ m!^Perl lib version \((\d*.\d*.\d*)\) doesn't match executable!) {
+ $require{"abi"} = $1;
+ } elsif($v =~ m!^VERSION=(\d*.\d*.\d*)!) {
+ $require{"abi"} = $1;
}
+ }
}
if (!open(FILE, $file)) {

View file

@ -1,11 +0,0 @@
--- rpm-5.4.10/lib/rpmds.c.initialize~ 2012-10-04 16:34:29.681882554 +0200
+++ rpm-5.4.10/lib/rpmds.c 2012-10-04 16:34:31.081905144 +0200
@@ -3583,7 +3583,7 @@ int rpmdsSymlink(const char * fn, int fl
int is_symlink;
const char * soname = NULL;
rpmds ds;
- int xx;
+ int xx = -1;
int isElf64;
int isuClibc;
int gotSONAME = 0;

View file

@ -1,12 +0,0 @@
diff -Naur rpm-5.4.10.orig/macros/mandriva.in rpm-5.4.10/macros/mandriva.in
--- rpm-5.4.10.orig/macros/mandriva.in 2014-05-22 14:47:17.000000000 +0400
+++ rpm-5.4.10/macros/mandriva.in 2014-05-22 15:03:31.704614385 +0400
@@ -352,7 +352,7 @@
%__libtoolize_configure %{?__libtoolize:(cd $CONFIGURE_TOP; [ ! -f configure.in -a ! -f configure.ac ] || %{__libtoolize} --copy --force)}
-%ldflags %{?!_disable_ld_as_needed: -Wl,--as-needed}%{?!_disable_ld_no_undefined: -Wl,--no-undefined}%{?!_disable_ld_relro: -Wl,-z,relro}%{?!_disable_ld_O1: -Wl,-O1}%{?!_disable_ld_build_id: -Wl,--build-id}%{?!_disable_ld_enable_new_dtags: -Wl,--enable-new-dtags}%{?!_disable_hash_style_gnu: -Wl,--hash-style=gnu}%{?_hardened_flags: %_hardened_flags}
+%ldflags %{?!_disable_ld_as_needed: -Wl,--as-needed}%{?!_disable_ld_no_undefined: -Wl,--no-undefined}%{?!_disable_ld_now: -Wl,-z,now}%{?!_disable_ld_relro: -Wl,-z,relro}%{?!_disable_ld_O1: -Wl,-O1}%{?!_disable_ld_build_id: -Wl,--build-id}%{?!_disable_ld_enable_new_dtags: -Wl,--enable-new-dtags}%{?!_disable_hash_style_gnu: -Wl,--hash-style=gnu}%{?_hardened_flags: %_hardened_flags}
%setup_compile_flags \
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \

View file

@ -1,43 +0,0 @@
We need to sanity check that the nlink size and our linksLeft counter
do match. If an rpm is badly constructed with identical inode values
for multiple hardlinked files, such an rpm will otherwise access memory
out of array bounds and cause memory corruption and crashes.
The fix is to add in the sanity check and exit if bad circumstances
are found. We need to fix the caller to check the return code too.
RP 2014/6/10
Upstream-Status: Pending
Index: rpm-5.4.9/lib/fsm.c
===================================================================
--- rpm-5.4.9.orig/lib/fsm.c 2014-06-10 10:54:08.601049402 +0000
+++ rpm-5.4.9/lib/fsm.c 2014-06-10 10:55:45.633046077 +0000
@@ -495,6 +495,11 @@
}
if (fsm->goal == IOSM_PKGBUILD) --fsm->li->linksLeft;
+ if (fsm->li->linksLeft > st->st_nlink) {
+ rpmlog(RPMLOG_ERR, _("Corrupted hardlinks found (count %d does not match %d), exiting.\n"), fsm->li->linksLeft, st->st_nlink);
+ return -1;
+ }
+
fsm->li->filex[fsm->li->linksLeft] = fsm->ix;
/*@-observertrans -dependenttrans@*/
fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix;
@@ -1876,8 +1881,13 @@
fsm->postpone = iosmFileActionSkipped(fsm->action);
if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) {
/*@-evalorder@*/ /* FIX: saveHardLink can modify fsm */
- if (S_ISREG(st->st_mode) && st->st_nlink > 1)
+ if (S_ISREG(st->st_mode) && st->st_nlink > 1) {
fsm->postpone = saveHardLink(fsm);
+ if (fsm->postpone < 0) {
+ rc = RPMRC_FAIL;
+ break;
+ }
+ }
/*@=evalorder@*/
}
if (fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_LIST) fsm->postpone = 1;

View file

@ -1,67 +0,0 @@
--- rpm-5.4.10/lib/psm.c.cb~ 2013-03-18 03:54:33.548013203 +0100
+++ rpm-5.4.10/lib/psm.c 2013-03-18 03:39:40.643465724 +0100
@@ -842,6 +842,8 @@ assert(he->p.str != NULL);
psm->NVRA = NVRA = he->p.str;
}
+ scriptFd = rpmtsNotify(psm->ts, psm->te, RPMCALLBACK_SCRIPT_START, psm->scriptTag, 0);
+
if (op != NULL)
(void) rpmswEnter(op, 0);
@@ -1003,7 +1006,8 @@ assert(he->p.str != NULL);
break;
}
- scriptFd = rpmtsScriptFd(ts);
+ if (scriptFd == NULL)
+ scriptFd = rpmtsScriptFd(ts);
if (scriptFd != NULL) {
if (rpmIsVerbose()) {
out = fdDup(Fileno(scriptFd));
@@ -1165,6 +1169,8 @@ exit:
if (ix >= 0 && ix < RPMSCRIPT_MAX)
psm->smetrics[ix] += op->usecs / scale;
}
+ rpmtsNotify(psm->ts, psm->te, RPMCALLBACK_SCRIPT_STOP, psm->scriptTag,
+ rc != RPMRC_OK ? RPMRC_NOTFOUND : rc);
if (out)
xx = Fclose(out); /* XXX dup'd STDOUT_FILENO */
--- rpm-5.4.10/lib/rpminstall.c.cb~ 2013-03-18 03:54:48.316206560 +0100
+++ rpm-5.4.10/lib/rpminstall.c 2013-03-17 09:19:38.855870381 +0100
@@ -293,6 +293,10 @@ void * rpmShowProgress(/*@null@*/ const
break;
case RPMCALLBACK_SCRIPT_ERROR:
break;
+ case RPMCALLBACK_SCRIPT_START:
+ break;
+ case RPMCALLBACK_SCRIPT_STOP:
+ break;
case RPMCALLBACK_UNKNOWN:
default:
break;
--- rpm-5.4.10/python/rpmmodule.c.cb~ 2013-03-18 03:55:29.704746913 +0100
+++ rpm-5.4.10/python/rpmmodule.c 2013-03-17 09:19:38.855870381 +0100
@@ -559,6 +559,8 @@ void init_rpm(void)
REGISTER_ENUM(RPMCALLBACK_UNPACK_ERROR);
REGISTER_ENUM(RPMCALLBACK_CPIO_ERROR);
REGISTER_ENUM(RPMCALLBACK_SCRIPT_ERROR);
+ REGISTER_ENUM(RPMCALLBACK_SCRIPT_START);
+ REGISTER_ENUM(RPMCALLBACK_SCRIPT_STOP);
REGISTER_ENUM(RPMPROB_BADARCH);
REGISTER_ENUM(RPMPROB_BADOS);
--- rpm-5.4.10/rpmio/rpmiotypes.h.cb~ 2013-03-18 03:54:05.472641157 +0100
+++ rpm-5.4.10/rpmio/rpmiotypes.h 2013-03-18 03:53:36.692228344 +0100
@@ -138,7 +138,9 @@ typedef enum rpmCallbackType_e {
RPMCALLBACK_REPACKAGE_STOP = (1 << 12),
RPMCALLBACK_UNPACK_ERROR = (1 << 13),
RPMCALLBACK_CPIO_ERROR = (1 << 14),
- RPMCALLBACK_SCRIPT_ERROR = (1 << 15)
+ RPMCALLBACK_SCRIPT_ERROR = (1 << 15),
+ RPMCALLBACK_SCRIPT_START = (1 << 16),
+ RPMCALLBACK_SCRIPT_STOP = (1 << 17)
} rpmCallbackType;
/**

View file

@ -1,22 +0,0 @@
diff -urN rpm-5.4.10/macros/mandriva rpm-5.4.10-patched/macros/mandriva
--- rpm-5.4.10/macros/mandriva 2012-07-07 04:02:38.000000000 +1100
+++ rpm-5.4.10-patched/macros/mandriva 2016-04-01 20:39:01.781545961 +1000
@@ -70,6 +70,7 @@
%make %{__make} %{_smp_mflags}
%makeinstall_std make DESTDIR=%{?buildroot:%{buildroot}} install
+%makeinstall_qt make INSTALL_ROOT=%{?buildroot:%{buildroot}} install STRIP=true
# mdvbz#62322
%__grep /bin/grep
diff -urN rpm-5.4.10/macros/mandriva.in rpm-5.4.10-patched/macros/mandriva.in
--- rpm-5.4.10/macros/mandriva.in 2012-05-20 07:35:44.000000000 +1100
+++ rpm-5.4.10-patched/macros/mandriva.in 2016-04-01 20:38:32.015548091 +1000
@@ -70,6 +70,7 @@
%make %{__make} %{_smp_mflags}
%makeinstall_std make DESTDIR=%{?buildroot:%{buildroot}} install
+%makeinstall_qt make INSTALL_ROOT=%{?buildroot:%{buildroot}} install STRIP=true
# mdvbz#62322
%__grep /bin/grep

View file

@ -1,503 +0,0 @@
--- rpm-5.4.10/macros/mandriva.in.perl_deps~ 2012-07-10 20:24:43.536467425 +0200
+++ rpm-5.4.10/macros/mandriva.in 2012-07-10 20:25:11.522117555 +0200
@@ -272,9 +272,6 @@ Group: %{group}\
# Use internal dependency generator rather than external helpers?
%_use_internal_dependency_generator 1
-# TODO: merge relevant changes into rpm version rather than using our own
-%__perl_provides @USRLIBRPM@/@RPMCANONVENDOR@/perl.prov
-%__perl_requires @USRLIBRPM@/@RPMCANONVENDOR@/perl.req
%__find_provides @USRLIBRPM@/@RPMCANONVENDOR@/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' '%{?_exclude_files_from_autoprov:%{_exclude_files_from_autoprov}}%{!?_exclude_files_from_autoprov: }' '%{buildroot}' @USRLIBRPM@/@RPMCANONVENDOR@/find-provides
%__find_requires @USRLIBRPM@/@RPMCANONVENDOR@/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' '%{?_exclude_files_from_autoreq:%{_exclude_files_from_autoreq}}%{!?_exclude_files_from_autoreq: }' '%{buildroot}' @USRLIBRPM@/@RPMCANONVENDOR@/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}}
--- rpm-5.4.10/scripts/perl.prov.perl_deps~ 2012-07-06 17:39:20.000000000 +0200
+++ rpm-5.4.10/scripts/perl.prov 2012-07-10 20:28:13.776839058 +0200
@@ -45,8 +45,11 @@
# by Ken Estes Mail.com kestes@staff.mail.com
+use File::Basename ();
+
if ("@ARGV") {
foreach (@ARGV) {
+ next if !/\.pm$/;
process_file($_);
}
} else {
@@ -55,12 +58,22 @@ if ("@ARGV") {
# contents of the file.
foreach (<>) {
+ chomp $_;
+ next if !/\.pm$/;
process_file($_);
}
}
foreach $module (sort keys %require) {
+ if ($module =~ m/^abi$/) {
+ print "perl($module) = $require{$module}\n";
+ next;
+ }
+ # XXX: skip any modules not starting with upper case letters
+ if ($module =~ m/^[^A-Z]/) {
+ next;
+ }
if (length($require{$module}) == 0) {
print "perl($module)\n";
} else {
@@ -69,7 +82,9 @@ foreach $module (sort keys %require) {
# operators. Also I will need to change the processing of the
# $RPM_* variable when I upgrade.
- print "perl($module) = $require{$module}\n";
+ my $v = qx{ rpm --eval '%perl_convert_version $require{$module}' };
+ chomp($v);
+ print "perl($module) = $v\n";
}
}
@@ -80,21 +95,31 @@ exit 0;
sub process_file {
my ($file) = @_;
- chomp $file;
- open(FILE, "<$file") || return;
+ if ($file =~ m/$Config{archname}\/Config.pm$/) {
+ my $vercmd = "perl -I". File::Basename::dirname($file) . " -MConfig -e 'print \"\$Config{version}\"'";
+ my $v = `$vercmd`;
+ if ($v) {
+ $require{"abi"} = $v;
+ }
+ }
+
+ if (!open(FILE, $file)) {
+ warn("$0: Warning: Could not open file '$file' for reading: $!\n");
+ return;
+ }
my ($package, $version, $incomment, $inover) = ();
while (<FILE>) {
-
+
# skip the documentation
# we should not need to have item in this if statement (it
# properly belongs in the over/back section) but people do not
# read the perldoc.
- if (m/^=(head[1-4]|pod|item)/) {
+ if (m/^=(head[1-4]|pod|for|item)/) {
$incomment = 1;
}
@@ -102,7 +127,7 @@ sub process_file {
$incomment = 0;
$inover = 0;
}
-
+
if (m/^=(over)/) {
$inover = 1;
}
@@ -111,10 +136,10 @@ sub process_file {
$inover = 0;
}
- if ($incomment || $inover) {
+ if ($incomment || $inover || m/^\s*#/) {
next;
}
-
+
# skip the data section
if (m/^__(DATA|END)__$/) {
last;
@@ -125,17 +150,20 @@ sub process_file {
# false positives as if they were provided packages (really ugly).
if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
- $package=$1;
- undef $version;
- if ($package eq 'main') {
- undef $package;
- } else {
- # If $package already exists in the $require hash, it means
- # 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});
- }
+ # some internal packages, like DB, might be temporarily redefined inside a module.
+ if (!($package && $1 eq 'DB')) {
+ $package=$1;
+ undef $version;
+ if ($package eq 'main') {
+ undef $package;
+ } else {
+ # If $package already exists in the $require hash, it means
+ # 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});
+ }
+ }
}
# after we found the package name take the first assignment to
@@ -148,45 +176,36 @@ sub process_file {
#ExtUtils/Install.pm:$VERSION = substr q$Revision: 1.12.10.1 $, 10;
#CGI/Apache.pm:$VERSION = (qw$Revision: 1.12.10.1 $)[1];
#DynaLoader.pm:$VERSION = $VERSION = "1.03"; # avoid typo warning
- #General.pm:$Config::General::VERSION = 2.33;
- #
- # or with the new "our" pragma you could (read will) see:
- #
- # our $VERSION = '1.00'
- if (($package) && (m/^\s*(our\s+)?\$(\Q$package\E::)?VERSION\s*=\s+/)) {
+ #$Locale::Maketext::Simple::VERSION = '0.21';
+
+ if (
+ $package &&
+ (m/^(.*;)?\s*((my|our)\s+)?\$(${package}::)?VERSION\s*=\s+/)
+ ) {
# first see if the version string contains the string
# '$Revision' this often causes bizarre strings and is the most
# common method of non static numbering.
- if (m/(\$Revision: (\d+[.0-9]+))/) {
- $version= $2;
+ if (m/\$Revision: (\d+[.0-9]+)/) {
+ $version = $1;
} elsif (m/[\'\"]?(\d+[.0-9]+)[\'\"]?/) {
-
- # look for a static number hard coded in the script
-
- $version= $1;
+
+ # look for a static number hard coded in the script
+
+ $version= $1;
}
- $require{$package}=$version;
+ $require{$package} = $version;
}
-
- # Allow someone to have a variable that defines virtual packages
- # The variable is called $RPM_Provides. It must be scoped with
- # "our", but not "local" or "my" (just would not make sense).
- #
- # For instance:
- #
- # $RPM_Provides = "blah bleah"
- #
- # Will generate provides for "blah" and "bleah".
- #
+
+
# Each keyword can appear multiple times. Don't
# bother with datastructures to store these strings,
# if we need to print it print it now.
-
- if ( m/^\s*(our\s+)?\$RPM_Provides\s*=\s*["'](.*)['"]/i) {
- foreach $_ (split(/\s+/, $2)) {
- print "$_\n";
+
+ if (m/^\s*\$RPM_Provides\s*=\s*["'](.*)['"]/i) {
+ foreach $_ (split(/\s+/, $1)) {
+ print "$_\n";
}
}
@@ -195,5 +214,5 @@ sub process_file {
close(FILE) ||
die("$0: Could not close file: '$file' : $!\n");
- return ;
+ return;
}
--- rpm-5.4.10/scripts/perl.req.perl_deps~ 2012-07-06 17:39:20.000000000 +0200
+++ rpm-5.4.10/scripts/perl.req 2012-07-10 20:25:11.525117519 +0200
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# RPM (and its source code) is covered under two separate licenses.
+# RPM (and its source code) is covered under two separate licenses.
# The entire code base may be distributed under the terms of the GNU
# General Public License (GPL), which appears immediately below.
@@ -18,7 +18,7 @@
# Erik Troan <ewt@redhat.com>.
# a simple makedepend like script for perl.
-
+
# To save development time I do not parse the perl grammmar but
# instead just lex it looking for what I want. I take special care to
# ignore comments and pod's.
@@ -39,22 +39,36 @@
# by Ken Estes Mail.com kestes@staff.mail.com
+use Config;
+
if ("@ARGV") {
foreach (@ARGV) {
process_file($_);
}
} else {
-
+
# notice we are passed a list of filenames NOT as common in unix the
# contents of the file.
-
+
foreach (<>) {
+ chomp $_;
process_file($_);
}
}
foreach $module (sort keys %require) {
+ if ($module =~ m/^abi$/) {
+ print "perl($module) = $require{$module}\n";
+ next;
+ } elsif ($module =~ m/^api$/) {
+ print "perl(abi) >= $require{$module}\n";
+ next;
+ }
+ # XXX: skip any modules not starting with upper case letters
+ if ($module =~ m/^[^A-Z]/) {
+ next;
+ }
if (length($require{$module}) == 0) {
print "perl($module)\n";
} else {
@@ -63,7 +77,9 @@ foreach $module (sort keys %require) {
# operators. Also I will need to change the processing of the
# $RPM_* variable when I upgrade.
- print "perl($module) >= $require{$module}\n";
+ my $v = qx{ rpm --eval '%perl_convert_version $require{$module}' }; #' workaround vim highlighting issue.. ;)
+ chomp($v);
+ print "perl($module) >= $v\n";
}
}
@@ -72,16 +88,24 @@ exit 0;
sub process_file {
-
+
my ($file) = @_;
- chomp $file;
-
- open(FILE, "<$file") || return;
-
- while (<FILE>) {
+ # XXX: dependendency on perl(abi) = <version> for perl extensions
+ if ($file =~ m/$Config{archname}/) {
+ $require{"abi"} = $Config{version};
+ } elsif ($file =~ m/($Config{installsitelib}|$Config{installvendorlib}|$Config{installprivlib})/ and $file =~ m/$Config{version}/) {
+ $require{"api"} = $Config{version};
+ }
+
+ if (!open(FILE, $file)) {
+ warn("$0: Warning: Could not open file '$file' for reading: $!\n");
+ return;
+ }
+
+ while (<FILE>) {
# skip the documentation
- if ( /^ = (?: head\d | pod | item | over | back | (?: begin|end|for ) \s+\S+ ) \b/x ) {
+ if ( /^ = (?: head\d | pod | for | item | over | back | (?: begin|end|for ) \s+\S+ ) \b/x ) {
$_ = <FILE> until /^=cut/ or eof;
next;
}
@@ -100,12 +124,12 @@ sub process_file {
# skip q{} quoted sections - just hope we don't have curly brackets
# within the quote, nor an escaped hash mark that isn't a comment
# marker, such as occurs right here. Draw the line somewhere.
- if ( m/^.*\Wq[qxwr]?\s*([\{\(\[#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
+ if ( m/^.*\Wq[qxwr]?\s*([{([#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
$tag = $1;
$tag =~ tr/{([/})]/;
$_ = <FILE> until m/\Q$tag\E/ or eof;
}
-
+
# skip the data section
if (m/^__(DATA|END)__$/) {
last;
@@ -115,28 +139,28 @@ sub process_file {
# bother with datastructures to store these strings,
# if we need to print it print it now.
#
- # Again allow for "our".
+ # Again allow for "our".
if ( m/^\s*(our\s+)?\$RPM_Requires\s*=\s*["'](.*)['"]/i) {
foreach $_ (split(/\s+/, $2)) {
- print "$_\n";
+ print "$_\n";
}
}
# handle "use base qw/ foo::bar baz::blah /;" and variations
if (
m/^ \s* use \s+ base
- (?: \s+ q[wq]? \s* ( [!@#\$%^&*'"\/+=`~,.?-] ) \s* ( [\w:]+? (?: \s+[\w:]+? )*? ) \s* \1
+ (?: \s+ q[wq]? \s* ( [!@#\$%^&*'"\/+=`~,.?-] ) \s* ( [\w:]+? (?: \s+[\w:]+? )*? ) \s* \1
|
- \s* ( ["'] ) ( [\w:]+? ) \3
+ \s* ( ["'] ) ( [\w:]+? ) \3
|
# qw[], qw(), qw<>, qw{} are handled here; lax, but who gives
- \s+ q[wq]? \s* [\[({<] \s* ( [\w:]+? (?: \s+[\w:]+? )*? ) \s* [\])}>]
+ \s+ q[wq]? \s* [\[({<] \s* ( [\w:]+? (?: \s+[\w:]+? )*? ) \s* [\])}>]
)
\s* ;
/x
)
{
- my @deps = ( $1 ? split /\s+/, $2 : $3 ? $4 : split /\s+/, $5 );
+ my @deps = ( $1 ? split /\s+/, $2 : $3 ? $4 : split /\s+/, $5 );
for my $mod ( grep !exists $require{$_}, @deps ) {
$require{$mod} = '';
$line{$mod} = $_;
@@ -153,17 +177,18 @@ sub process_file {
# eval { require Carp } if defined $^S; # If error/warning during compilation,
- (m/^(\s*) # we hope the inclusion starts the line
- (require|use)\s+(?!\{) # do not want 'do {' loops
- # quotes around name are always legal
- [\'\"]?([^\;\ \'\"\t]*)[\'\"]?[\t\;\ ]
- # the syntax for 'use' allows version requirements
- \s*([.0-9]*)
- /x)
+ (m/^(\s*) # we hope the inclusion starts the line
+ (require|use)\s+(?!\{) # do not want 'do {' loops
+ # quotes around name are always legal
+ ['"]?([^; '"\t#]+)['"]?[\t; ]
+ # the syntax for 'use' allows version requirements
+ \s*([.0-9]*)
+ /x)
) {
my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4);
+ my $usebase;
- # we only consider require statements that are flush against
+ # we only consider require statements that are flushed against
# the left edge. any other require statements give too many
# false positives, as they are usually inside of an if statement
# as a fallback module or a rarely used option
@@ -173,7 +198,7 @@ sub process_file {
# if there is some interpolation of variables just skip this
# dependency, we do not want
# do "$ENV{LOGDIR}/$rcfile";
-
+
($module =~ m/\$/) && next;
# skip if the phrase was "use of" -- shows up in gimp-perl, et al.
@@ -198,6 +223,18 @@ sub process_file {
next;
}
+ # as seen in some perl scripts
+ # use base qw(App::CLI Class::Accessor::Chained::Fast App::CLI::Command);
+ if ($module eq 'base') {
+ $require{$module} = $version;
+ $line{$module} = $current_line;
+ ($module = $_) =~ s/use\s*base\s*//;
+ $module =~ s/qw\((.*)\)\s*;/$1/;
+ $module =~ s/qw(.)(.*)\1\s*;/$2/;
+ $module =~ s/\s*;$//;
+ $module =~ s/#.*//;
+ $usebase = 1;
+ }
# sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc.
# we can strip qw.*$, as well as (.*$:
$module =~ s/qw.*$//;
@@ -205,7 +242,7 @@ sub process_file {
$module =~ s/\.pm$//;
- # some perl programmers write 'require URI/URL;' when
+ # some perl programmers write 'require URI/URL;' when
# they mean 'require URI::URL;'
$module =~ s/\//::/;
@@ -215,45 +252,41 @@ sub process_file {
$module =~ s/\(\s*\)$//;
- if ( $module =~ m/^v?([0-9._]+)$/ ) {
# if module is a number then both require and use interpret that
- # to mean that a particular version of perl is specified
-
- my $ver=$1;
- if ($ver =~ /5.00/) {
- print "perl >= 0:$ver\n";
- next;
- }
- else {
- print "perl >= 1:$ver\n";
- next;
- }
-
- };
+ # to mean that a particular version of perl is specified. Don't
+ # add a dependency, though, since the rpm will already require
+ # perl-base at the build version (via find-requires)
+ next if $module =~ /^v?\d/;
# ph files do not use the package name inside the file.
# perlmodlib documentation says:
-
# the .ph files made by h2ph will probably end up as
# extension modules made by h2xs.
-
- # so do not expend much effort on these.
-
+ # so do not spend much effort on these.
# there is no easy way to find out if a file named systeminfo.ph
# will be included with the name sys/systeminfo.ph so only use the
# basename of *.ph files
- ($module =~ m/\.ph$/) && next;
+ ($module =~ m/\.ph$/) && next;
- $require{$module}=$version;
- $line{$module}=$_;
+ # if the module was loaded trough base, we need to split the list
+ if ($usebase) {
+ my $current_line = $_;
+ foreach (split(/\s+/, $module)) {
+ next unless $_;
+ $require{$_} = $version;
+ $line{$_} = $current_line;
+ }
+ } else {
+ $require{$module}=$version;
+ $line{$module}=$current_line;
+ }
}
-
}
close(FILE) ||
die("$0: Could not close file: '$file' : $!\n");
-
- return ;
+
+ return ;
}

View file

@ -1,93 +0,0 @@
From 0ae3d55d40be97727e64b20a6bec6758f9ef023e Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Tue, 25 Dec 2018 03:32:04 +0300
Subject: [PATCH] prevent exceeding 32 bit memory limitations with
multithreaded xz compression
Port of https://github.com/rpm-software-management/rpm/commit/a60f36a55cff3331e8bef3a1ab95c87d313911bb
As 32 bit build suffers under the limitation of 32 bit address space,
regardless of it's environment would be ie. 64 bit and not have this
constration, rpm must make sure not to exceed this memory limitation.
When using multithreaded xz compression, the number of threads used will
increase the memory usage, making it necessary to check the memory
required with the number of threads to be used.
Number of compression threads will therefore be kept reduced untill
amount of memory required won't exceed this limitation.
For 32 bit binaries running under 64 bit host environment, where less
available memory will be reserved for kernel, easing memory constraints,
determination of this will be done by a combination of checking host
arch as well as whether 32 bit personality flag is set, thereby still
allow a sligthly greater memory usage for such cases to avoid
imposing unnecessatry limitations under such environments.
---
rpmio/xzdio.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/rpmio/xzdio.c b/rpmio/xzdio.c
index 0e5e612..a1492f1 100644
--- a/rpmio/xzdio.c
+++ b/rpmio/xzdio.c
@@ -8,6 +8,10 @@
#include <rpmmacro.h>
#include <rpmcb.h>
#include <ctype.h>
+#if defined(__linux__)
+#include <sys/personality.h>
+#endif
+#include <sys/utsname.h>
#if defined(WITH_XZ)
@@ -132,7 +136,45 @@ static XZFILE *xzopen_internal(const char *path, const char *mode, int fdno, int
.timeout = 0,
.preset = level,
.filters = NULL,
- .check = LZMA_CHECK_SHA256 };
+ .check = LZMA_CHECK_CRC32 };
+#if __WORDSIZE == 32
+ /* In 32 bit environment, required memory easily exceeds memory address
+ * space limit if compressing using multiple threads.
+ * By setting a memory limit, liblzma will automatically adjust number
+ * of threads to avoid exceeding memory.
+ */
+ if (threads > 1) {
+ struct utsname u;
+ uint32_t memlimit = (SIZE_MAX>>1) + (SIZE_MAX>>3);
+ uint64_t memory_usage;
+ /* While a 32 bit linux kernel will have an address limit of 3GiB
+ * for processes (which is why set the memory limit to 2.5GiB as a safety
+ * margin), 64 bit kernels will have a limit of 4GiB for 32 bit binaries.
+ * Therefore the memory limit should be higher if running on a 64 bit
+ * kernel, so we increase it to 3,5GiB.
+ */
+ uname(&u);
+ if (strstr(u.machine, "64") || strstr(u.machine, "s390x")
+#if defined(__linux__)
+ || ((personality(0xffffffff) & PER_MASK) == PER_LINUX32)
+#endif
+ )
+ memlimit += (SIZE_MAX>>2);
+
+ /* keep reducing the number of threads untill memory usage gets below limit */
+ while ((memory_usage = lzma_stream_encoder_mt_memusage(&mt_options)) > memlimit) {
+ /* number of threads shouldn't be able to hit zero with compression
+ * settings aailable to set through rpm... */
+ assert(--mt_options.threads != 0);
+ }
+ lzma_memlimit_set(&xzfile->strm, memlimit);
+
+ if (threads != (int)mt_options.threads)
+ rpmlog(RPMLOG_NOTICE,
+ "XZ: Adjusted the number of threads from %d to %d to not exceed the memory usage limit of %lu bytes",
+ threads, mt_options.threads, memlimit);
+ }
+#endif
ret = lzma_stream_encoder_mt(&xzfile->strm, &mt_options);
}
--
2.17.1

View file

@ -1,12 +0,0 @@
diff -Naur rpm-5.4.10.orig/macros/mandriva.in rpm-5.4.10/macros/mandriva.in
--- rpm-5.4.10.orig/macros/mandriva.in 2014-09-10 07:00:38.045847753 -0400
+++ rpm-5.4.10/macros/mandriva.in 2014-09-10 07:01:54.058851415 -0400
@@ -162,7 +162,7 @@
%Werror_cflags -Wformat -Werror=format-security
%_ssp_cflags -fstack-protector --param=ssp-buffer-size=4%{?_serverbuild_flags: %_serverbuild_flags}
-%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags} -ffat-lto-objects
+%__common_cflags -O2 %{debugcflags} -pipe %{Werror_cflags} %{?_fortify_cflags} -ffat-lto-objects -fno-delete-null-pointer-checks
%__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags}
# Servers opt flags.

View file

@ -1,39 +0,0 @@
--- rpm-5.4.10/scripts/perl.req.perl_abireq~ 2012-12-19 04:47:18.928428133 +0100
+++ rpm-5.4.10/scripts/perl.req 2012-12-19 04:45:40.698118700 +0100
@@ -59,15 +59,18 @@ if ("@ARGV") {
foreach $module (sort keys %require) {
if ($module =~ m/^abi$/) {
- print "perl($module) = $require{$module}\n";
- next;
+# in ROSA Linux the perl library now has a versioned soname, so no need
+# for explicit version dependency for modules anymore
+# print "perl($module) = $require{$module}\n";
+ print "perl($module) >= $require{$module}\n";
+ next;
} elsif ($module =~ m/^api$/) {
- print "perl(abi) >= $require{$module}\n";
- next;
+ print "perl(abi) >= $require{$module}\n";
+ next;
}
# XXX: skip any modules not starting with upper case letters
if ($module =~ m/^[^A-Z]/) {
- next;
+ next;
}
if (length($require{$module}) == 0) {
print "perl($module)\n";
@@ -78,9 +81,9 @@ foreach $module (sort keys %require) {
# $RPM_* variable when I upgrade.
my $v = qx{ rpm --eval '%perl_convert_version $require{$module}' }; #' workaround vim highlighting issue.. ;)
- chomp($v);
- print "perl($module) >= $v\n";
- }
+ chomp($v);
+ print "perl($module) >= $v\n";
+}
}
exit 0;

View file

@ -1,66 +0,0 @@
diff -Naur rpm-5.4.10.orig/lib/rpmfc.h rpm-5.4.10/lib/rpmfc.h
--- rpm-5.4.10.orig/lib/rpmfc.h 2014-04-30 17:14:01.158698669 +0400
+++ rpm-5.4.10/lib/rpmfc.h 2014-04-30 17:15:21.236691127 +0400
@@ -62,7 +62,9 @@
RPMFC_WHITE = (1 << 29),
RPMFC_INCLUDE = (1 << 30),
- RPMFC_ERROR = (1 << 31)
+ RPMFC_ERROR = (1 << 31),
+
+ RPMFC_NODEJS = (1 << 11)
} FCOLOR_t;
#if defined(_RPMFC_INTERNAL)
diff -Naur rpm-5.4.10.orig/lib/rpmfc.c rpm-5.4.10/lib/rpmfc.c
--- rpm-5.4.10.orig/lib/rpmfc.c 2014-04-30 17:14:01.158698669 +0400
+++ rpm-5.4.10/lib/rpmfc.c 2014-04-30 17:16:46.669683082 +0400
@@ -635,6 +635,7 @@
{ "perl script text", RPMFC_PERL|RPMFC_INCLUDE },
{ "Perl5 module source text", RPMFC_PERL|RPMFC_MODULE|RPMFC_INCLUDE },
+ { "NodeJS script text", RPMFC_NODEJS|RPMFC_INCLUDE },
{ "PHP script text", RPMFC_PHP|RPMFC_INCLUDE },
{ "G-IR binary database", RPMFC_TYPELIB|RPMFC_INCLUDE },
@@ -912,6 +913,8 @@
fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON;
else if (!strncmp(bn, "php", sizeof("php")-1))
fc->fcolor->vals[fc->ix] |= RPMFC_PHP;
+ else if (!strncmp(bn, "json", sizeof("json")-1))
+ fc->fcolor->vals[fc->ix] |= RPMFC_NODEJS;
else if (!strncmp(bn, "ruby", sizeof("ruby")-1))
fc->fcolor->vals[fc->ix] |= RPMFC_RUBY;
@@ -932,6 +935,10 @@
if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
xx = rpmfcHelper(fc, 'R', "python");
} else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_NODEJS) {
+ xx = rpmfcHelper(fc, 'P', "nodejs");
+ xx = rpmfcHelper(fc, 'R', "nodejs");
+ } else
if (fc->fcolor->vals[fc->ix] & RPMFC_LIBTOOL) {
xx = rpmfcHelper(fc, 'P', "libtool");
#ifdef NOTYET
@@ -1140,7 +1147,7 @@
/*@unchecked@*/
static struct rpmfcApplyTbl_s rpmfcApplyTable[] = {
{ rpmfcELF, RPMFC_ELF },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_RUBY|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB) },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_RUBY|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB|RPMFC_NODEJS) },
#if defined(RPM_VENDOR_MANDRIVA)
{ rpmfcSYMLINK, RPMFC_SYMLINK },
#endif
@@ -1452,6 +1459,10 @@
else if (_suffix(s, ".php"))
ftype = "PHP script text";
+ /* XXX all files with extension ".json" are NodeJS for now. */
+ else if (_suffix(s, ".json"))
+ ftype = "NodeJS script text";
+
/* XXX files with extension ".typelib" are GNOME typelib for now. */
else if (_suffix(s, ".typelib"))
ftype = "G-IR binary database";

View file

@ -1,144 +0,0 @@
If we run builds on a filesystem with 64 bit inodes like XFS, we need to
map the inode numbers to something 32 bit since the cpio header only allows
for 32 bit inode values. If we don't do this:
#define SET_NUM_FIELD(phys, val, space) \
sprintf(space, "%8.8lx", (unsigned long) (val)); \
memcpy(phys, space, 8)
from cpio.c will print larger that 8 character values and then truncate the
LSBs. This generates cpio files where hardlinked files may have the same
inode number. The resulting rpms are then corrupted.
There is a separate patch for the crash the identical inode numbers causes
when extracting the rpm.
Patch taken from http://git.pld-linux.org/?p=packages/rpm.git;a=commitdiff;h=10526c23aac60b7b636e4c93862887dbef8e8f15
RP 2014/6/10
Upstream-Status: Pending
diff -ur rpm-5.4.10/build/files.c rpm-5.4.10-collision/build/files.c
--- rpm-5.4.10/build/files.c 2013-03-17 13:17:38.233358389 +0100
+++ rpm-5.4.10-collision/build/files.c 2013-03-17 13:07:37.468483625 +0100
@@ -1323,6 +1323,26 @@
return dalgo;
}
+static int isHardLink(FileListRec flp, FileListRec tlp)
+{
+ return ((S_ISREG(flp->fl_mode) && S_ISREG(tlp->fl_mode)) &&
+ ((flp->fl_nlink > 1) && (flp->fl_nlink == tlp->fl_nlink)) &&
+ (flp->fl_ino == tlp->fl_ino) &&
+ (flp->fl_dev == tlp->fl_dev));
+}
+
+static int seenHardLink(FileList fl, FileListRec flp, ino_t *fileid)
+{
+ FileListRec ilp;
+ for (ilp = fl->fileList; ilp < flp; ilp++) {
+ if (isHardLink(flp, ilp)) {
+ *fileid = ilp - fl->fileList;
+ return 1;
+ }
+ }
+ return 0;
+}
+
/**
* Add file entries to header.
* @todo Should directories have %doc/%config attributes? (#14531)
@@ -1370,6 +1390,7 @@
for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
const char *s;
+ ino_t fileid = flp - fl->fileList;
/* Merge duplicate entries. */
while (i < (fl->fileListRecsUsed - 1) &&
@@ -1437,6 +1458,13 @@
/* Leave room for both dirname and basename NUL's */
dpathlen += (strlen(flp->diskURL) + 2);
+ /* Excludes and dupes have been filtered out by now. */
+ if (S_ISREG(flp->fl_mode)) {
+ if (flp->fl_nlink == 1 || !seenHardLink(fl, flp, &fileid)) {
+ fl->totalFileSize += flp->fl_size;
+ }
+ }
+
/*
* Make the header, the OLDFILENAMES will get converted to a
* compressed file list write before we write the actual package to
@@ -1519,7 +1547,11 @@
/* XXX Hash instead of 64b->32b truncate to prevent aliasing. */
{ ino_t _ino = flp->fl_ino;
- ui32 = hashFunctionString(0, &_ino, sizeof(_ino));
+ /* don't use hash here, as hash collisions which happen on large packages
+ cause bus errors in rpmbuild
+ ui32 = hashFunctionString(0, &_ino, sizeof(_ino));
+ */
+ ui32 = fileid + 1;
}
he->tag = RPMTAG_FILEINODES;
he->t = RPM_UINT32_TYPE;
@@ -1752,39 +1780,6 @@
IOSM_MAP_TYPE | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID;
if (isSrc)
fi->fmapflags[i] |= IOSM_FOLLOW_SYMLINKS;
-
- if (S_ISREG(flp->fl_mode)) {
- int bingo = 1;
- /* Hard links need be tallied only once. */
- if (flp->fl_nlink > 1) {
- FileListRec jlp = flp + 1;
- int j = i + 1;
- for (; (unsigned)j < fi->fc; j++, jlp++) {
- /* follow outer loop logic */
- while (((jlp - fl->fileList) < (fl->fileListRecsUsed - 1)) &&
- !strcmp(jlp->fileURL, jlp[1].fileURL))
- jlp++;
- if (jlp->flags & RPMFILE_EXCLUDE) {
- j--;
- /*@innercontinue@*/ continue;
- }
- if (jlp->flags & RPMFILE_GHOST)
- /*@innercontinue@*/ continue;
- if (!S_ISREG(jlp->fl_mode))
- /*@innercontinue@*/ continue;
- if (flp->fl_nlink != jlp->fl_nlink)
- /*@innercontinue@*/ continue;
- if (flp->fl_ino != jlp->fl_ino)
- /*@innercontinue@*/ continue;
- if (flp->fl_dev != jlp->fl_dev)
- /*@innercontinue@*/ continue;
- bingo = 0; /* don't tally hardlink yet. */
- /*@innerbreak@*/ break;
- }
- }
- if (bingo)
- fl->totalFileSize += flp->fl_size;
- }
}
ui32 = fl->totalFileSize;
--- rpm-5.4.10/lib/fsm.c~
+++ rpm-5.4.10/lib/fsm.c
@@ -898,6 +898,7 @@ int fsmMapAttrs(IOSM_t fsm)
if (fi && i >= 0 && i < (int) fi->fc) {
mode_t perms = (S_ISDIR(st->st_mode) ? fi->dperms : fi->fperms);
+ ino_t finalInode = (fi->finodes ? (ino_t)fi->finodes[i] : 0);
mode_t finalMode = (fi->fmodes ? (mode_t)fi->fmodes[i] : perms);
dev_t finalRdev = (dev_t)(fi->frdevs ? fi->frdevs[i] : 0);
rpmuint32_t finalMtime = (fi->fmtimes ? fi->fmtimes[i] : 0);
@@ -937,6 +938,7 @@ int fsmMapAttrs(IOSM_t fsm)
if ((S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
&& st->st_nlink == 0)
st->st_nlink = 1;
+ st->st_ino = finalInode;
st->st_rdev = finalRdev;
st->st_mtime = finalMtime;
}

View file

@ -1,13 +0,0 @@
--- rpm-5.4.10/macros/macros.rpmbuild.in.helper_order~ 2012-10-04 16:36:15.673593212 +0200
+++ rpm-5.4.10/macros/macros.rpmbuild.in 2012-10-30 08:59:38.687200958 +0100
@@ -399,9 +399,9 @@ echo "Patch #%{__patch_number} (%{basena
%{?buildroot:%{__rm} -rf '%{buildroot}'; %{__mkdir_p} '%{buildroot}'}
%__spec_install_body %{___build_body}
%__spec_install_post\
-%{?__debug_package:%{__debug_install_post}}\
%{__arch_install_post}\
%{__os_install_post}\
+%{?__debug_package:%{__debug_install_post}}\
%{nil}
%__spec_install_template #!%{__spec_install_shell}\
%{__spec_install_pre}\

View file

@ -1,73 +0,0 @@
--- ./build/files.c.subpackage_failures~ 2013-05-22 18:56:03.629212893 +0400
+++ ./build/files.c 2013-05-22 19:07:50.697775045 +0400
@@ -2513,8 +2513,8 @@
files = argvFree(files);
- if (fl.processingFailed)
- goto exit;
+/* if (fl.processingFailed)
+ goto exit;*/
/* Verify that file attributes scope over hardlinks correctly. */
if (checkHardLinks(&fl))
@@ -3147,6 +3147,7 @@
HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
Package pkg;
rpmRC res = RPMRC_OK;
+ short failed_once = 0;
char *buildroot = rpmExpand("%{?buildroot}", NULL);
size_t buildrootL = strlen(buildroot);
@@ -3167,22 +3168,23 @@
he->p.ptr = _free(he->p.ptr);
if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) {
- res = RPMRC_FAIL;
- (void) headerMacrosUnload(pkg->header);
- break;
+ failed_once = 1;
}
/* Finalize package scriptlets before extracting dependencies. */
if ((rc = processScriptFiles(spec, pkg))) {
res = rc;
(void) headerMacrosUnload(pkg->header);
- break;
+ if (res == RPMRC_FAIL) {
+ failed_once = 1;
+ }
+ else {
+ break;
+ }
}
if ((rc = rpmfcGenerateDepends(spec, pkg))) {
- res = RPMRC_FAIL;
- (void) headerMacrosUnload(pkg->header);
- break;
+ failed_once = 1;
}
/* XXX this should be earlier for deps to be entirely sorted. */
@@ -3191,7 +3193,10 @@
(void) headerMacrosUnload(pkg->header);
}
- if (res == RPMRC_OK) {
+ if (failed_once == 1)
+ res = RPMRC_FAIL;
+
+/* if (res == RPMRC_OK) {*/
int _duplicate_files_terminate_build =
rpmExpandNumeric("%{?_duplicate_files_terminate_build}");
int _unpackaged_subdirs_terminate_build =
@@ -3204,7 +3209,7 @@
if (checkUnpackagedSubdirs(spec, buildrootL, _unpackaged_subdirs_terminate_build) > 0 &&
_unpackaged_subdirs_terminate_build)
res = RPMRC_FAIL;
- }
+/* }*/
return res;
}

View file

@ -1,114 +0,0 @@
--- rpm-5.4.10/build/spec.c.printspec~ 2013-01-23 01:04:32.483889763 +0100
+++ rpm-5.4.10/build/spec.c 2013-01-23 01:12:59.970655457 +0100
@@ -27,6 +27,10 @@ int _spec_debug;
/*@-redecl@*/
extern int specedit;
+
+/*@-redecl@*/
+extern int printspec;
+
/*@=redecl@*/
#define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;}
@@ -489,7 +493,7 @@ static inline /*@only@*/ /*@null@*/ spec
/*@*/
{
speclines sl = NULL;
- if (specedit) {
+ if (specedit || printspec) {
sl = xmalloc(sizeof(*sl));
sl->sl_lines = NULL;
sl->sl_nalloc = 0;
@@ -836,6 +840,34 @@ printNewSpecfile(Spec spec)
}
/**
+ * Print parsed copy of spec file with expanded macros.
+ * @param spec spec file control structure
+ */
+static void
+printParsedSpecfile(Spec spec)
+ /*@globals fileSystem, internalState @*/
+ /*@modifies spec->sl->sl_lines[], spec->packages->header,
+ fileSystem, internalState @*/
+{
+ speclines sl = spec->sl;
+ int i;
+
+ if (sl == NULL)
+ return;
+
+ for (i = 0; i < sl->sl_nlines; i++) {
+ const char * s = sl->sl_lines[i];
+ const char * expandedLine;
+ if (s == NULL)
+ continue;
+ expandedLine = rpmMCExpand(spec->macros, s, NULL);
+ printf("%s", expandedLine);
+ _free(expandedLine);
+ if (strchr(s, '\n') == NULL && s[strlen(s)-1] != '\n')
+ printf("\n");
+ }
+}
+/**
* Add expanded build scriptlet to srpm header.
* @param h srpm header
* @param progTag interpreter tag (0 disables)
@@ -939,6 +971,11 @@ static int _specQuery(rpmts ts, QVA_t qv
goto exit;
}
+ if (printspec) {
+ printParsedSpecfile(spec);
+ goto exit;
+ }
+
switch (qva->qva_source) {
case RPMQV_SPECSRPM:
xx = initSourceHeader(spec, NULL);
--- rpm-5.4.10/lib/librpm.vers.printspec~ 2013-01-23 01:09:47.257299567 +0100
+++ rpm-5.4.10/lib/librpm.vers 2013-01-23 01:10:48.125643410 +0100
@@ -37,6 +37,7 @@ LIBRPM_0
_nosigh;
nplatpat;
platpat;
+ printspec;
_print_pkts;
_psm_debug;
_psm_threads;
--- rpm-5.4.10/lib/poptQV.c.printspec~ 2013-01-23 01:04:46.489658974 +0100
+++ rpm-5.4.10/lib/poptQV.c 2013-01-23 01:07:29.416493474 +0100
@@ -21,6 +21,9 @@ struct rpmQVKArguments_s rpmQVKArgs;
/*@unchecked@*/
int specedit = 0;
+/*@unchecked@*/
+int printspec = 0;
+
#define POPT_QUERYFORMAT -1000
#define POPT_WHATREQUIRES -1001
#define POPT_WHATPROVIDES -1002
@@ -363,6 +366,8 @@ struct poptOption rpmQueryPoptTable[] =
N_("skip %%readme files"), NULL },
#endif
+ { "printspec", '\0', POPT_ARG_VAL, &printspec, -1,
+ N_("print parsed spec file"), NULL },
{ "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0,
POPT_QUERYFORMAT, NULL, NULL },
{ "queryformat", '\0', POPT_ARG_STRING, 0, POPT_QUERYFORMAT,
--- rpm-5.4.10/lib/rpmcli.h.printspec~ 2013-01-23 01:04:53.165920321 +0100
+++ rpm-5.4.10/lib/rpmcli.h 2013-01-23 01:05:20.375518501 +0100
@@ -293,6 +293,11 @@ extern int specedit;
/** \ingroup rpmcli
*/
/*@unchecked@*/
+extern int printspec;
+
+/** \ingroup rpmcli
+ */
+/*@unchecked@*/
extern struct poptOption rpmQueryPoptTable[];
/** \ingroup rpmcli

View file

@ -1,27 +0,0 @@
diff -Naur rpm-5.4.10.orig/scripts/pythoneggs.py rpm-5.4.10/scripts/pythoneggs.py
--- rpm-5.4.10.orig/scripts/pythoneggs.py 2013-06-14 14:26:18.171626023 +0400
+++ rpm-5.4.10/scripts/pythoneggs.py 2013-06-14 14:28:45.434611910 +0400
@@ -125,7 +125,10 @@
if not name in py_deps:
py_deps[name] = []
py_deps[name].append(('==', dist.py_version))
- name = 'pythonegg(%s)' % dist.key
+ if f.find('python3') > 0:
+ name = 'python3egg(%s)' % dist.key
+ else:
+ name = 'pythonegg(%s)' % dist.key
if not name in py_deps:
py_deps[name] = []
if dist.version:
@@ -155,7 +158,10 @@
deps = depsextras
# add requires/suggests based on egg metadata
for dep in deps:
- name = 'pythonegg(%s)' % dep.key
+ if f.find('python3') > 0:
+ name = 'python3egg(%s)' % dep.key
+ else:
+ name = 'pythonegg(%s)' % dep.key
for spec in dep.specs:
if spec[0] != '!=':
if not name in py_deps:

View file

@ -1,245 +0,0 @@
diff -urN rpm-5.4.10-orig/configure.ac rpm-5.4.10-patched/configure.ac
--- rpm-5.4.10-orig/configure.ac 2016-10-13 19:51:48.630996187 +1000
+++ rpm-5.4.10-patched/configure.ac 2016-10-13 21:31:19.476242608 +1000
@@ -2572,7 +2572,7 @@
macros/macros macros/macros.rpmbuild
macros/cmake macros/gstreamer macros/java macros/kernel macros/libtool
macros/mandriva macros/suse macros/fedora macros/mono macros/perl macros/pkgconfig macros/php
- macros/python macros/ruby macros/selinux macros/tcl
+ macros/python macros/ruby macros/selinux macros/tcl macros/qml
doc/Makefile
doc/manual/Makefile doc/fr/Makefile doc/ja/Makefile doc/ko/Makefile
doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile
diff -urN rpm-5.4.10-orig/lib/rpmfc.c rpm-5.4.10-patched/lib/rpmfc.c
--- rpm-5.4.10-orig/lib/rpmfc.c 2016-10-13 19:51:48.806996194 +1000
+++ rpm-5.4.10-patched/lib/rpmfc.c 2016-10-13 22:14:04.696348477 +1000
@@ -647,6 +647,7 @@
{ "libtool library ", RPMFC_LIBTOOL|RPMFC_INCLUDE },
{ "pkgconfig ", RPMFC_PKGCONFIG|RPMFC_INCLUDE },
+ { "qml ", RPMFC_QML|RPMFC_INCLUDE },
{ "Bourne ", RPMFC_BOURNE|RPMFC_INCLUDE },
{ "Bourne-Again ", RPMFC_BOURNE|RPMFC_INCLUDE },
@@ -953,6 +954,10 @@
#endif
xx = rpmfcHelper(fc, 'R', "pkgconfig");
} else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_QML) {
+ xx = rpmfcHelper(fc, 'P', "qml");
+// xx = rpmfcHelper(fc, 'R', "qml");
+ } else
if (fc->fcolor->vals[fc->ix] & RPMFC_BOURNE) {
#ifdef NOTYET
xx = rpmfcHelper(fc, 'P', "executable");
@@ -1147,7 +1152,7 @@
/*@unchecked@*/
static struct rpmfcApplyTbl_s rpmfcApplyTable[] = {
{ rpmfcELF, RPMFC_ELF },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_RUBY|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB|RPMFC_NODEJS) },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_RUBY|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_QML|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB|RPMFC_NODEJS) },
#if defined(RPM_VENDOR_MANDRIVA)
{ rpmfcSYMLINK, RPMFC_SYMLINK },
#endif
@@ -1455,6 +1460,14 @@
else if (_suffix(s, ".pc"))
ftype = "pkgconfig file";
+ /* XXX all files with extension ".qml" are qml for now. */
+ else if (_suffix(s, ".qml"))
+ ftype = "qml file";
+
+ /* XXX all files named "qmldir" are qml for now. */
+ else if (_suffix(s, "qmldir"))
+ ftype = "qml file";
+
/* XXX all files with extension ".php" are PHP for now. */
else if (_suffix(s, ".php"))
ftype = "PHP script text";
diff -urN rpm-5.4.10-orig/lib/rpmfc.h rpm-5.4.10-patched/lib/rpmfc.h
--- rpm-5.4.10-orig/lib/rpmfc.h 2016-10-13 19:51:48.806996194 +1000
+++ rpm-5.4.10-patched/lib/rpmfc.h 2016-10-13 21:31:19.498242609 +1000
@@ -24,7 +24,7 @@
#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
/* (1 << 3) leaks into package headers, reserved */
- /* bit 4 unused */
+ RPMFC_QML = (1 << 4),
RPMFC_TYPELIB = (1 << 5),
RPMFC_HASKELL = (1 << 6),
RPMFC_RUBY = (1 << 7),
diff -urN rpm-5.4.10-orig/macros/macros rpm-5.4.10-patched/macros/macros
--- rpm-5.4.10-orig/macros/macros 2016-10-13 19:51:48.798996194 +1000
+++ rpm-5.4.10-patched/macros/macros 2016-10-13 21:31:19.500242609 +1000
@@ -1061,6 +1061,10 @@
#%%{load:%{_usrlibrpm}/macros.d/pkgconfig}
#------------------------------------------------------------------------
+# qml(...) configuration.
+#%%{load:%{_usrlibrpm}/macros.d/qml}
+
+#------------------------------------------------------------------------
# mono(...) configuration.
#%%{load:%{_usrlibrpm}/macros.d/mono}
diff -urN rpm-5.4.10-orig/macros/macros.in rpm-5.4.10-patched/macros/macros.in
--- rpm-5.4.10-orig/macros/macros.in 2016-10-13 19:51:48.647996188 +1000
+++ rpm-5.4.10-patched/macros/macros.in 2016-10-13 21:31:19.509242609 +1000
@@ -1065,6 +1065,10 @@
%{load:%{_usrlibrpm}/macros.d/pkgconfig}
#------------------------------------------------------------------------
+# qml(...) configuration.
+%{load:%{_usrlibrpm}/macros.d/qml}
+
+#------------------------------------------------------------------------
# mono(...) configuration.
%{load:%{_usrlibrpm}/macros.d/mono}
diff -urN rpm-5.4.10-orig/macros/qml rpm-5.4.10-patched/macros/qml
--- rpm-5.4.10-orig/macros/qml 1970-01-01 10:00:00.000000000 +1000
+++ rpm-5.4.10-patched/macros/qml 2016-10-13 21:31:19.513242610 +1000
@@ -0,0 +1,11 @@
+# QML specific macro definitions.
+# To make use of these macros insert the following line into your spec file:
+# %{load:%{_usrlibrpm}/macros.d/qml}
+#
+
+# Path to scripts to autogenerate QML package dependencies,
+#
+# Note: Used iff _use_internal_dependency_generator is non-zero. The
+# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
+%__qml_provides %{_rpmhome}/qmldeps.sh --provides
+%__qml_requires %{_rpmhome}/qmldeps.sh --requires
diff -urN rpm-5.4.10-orig/macros/qml.in rpm-5.4.10-patched/macros/qml.in
--- rpm-5.4.10-orig/macros/qml.in 1970-01-01 10:00:00.000000000 +1000
+++ rpm-5.4.10-patched/macros/qml.in 2016-10-13 21:31:19.515242610 +1000
@@ -0,0 +1,11 @@
+# QML specific macro definitions.
+# To make use of these macros insert the following line into your spec file:
+# %{load:%{_usrlibrpm}/macros.d/qml}
+#
+
+# Path to scripts to autogenerate QML package dependencies,
+#
+# Note: Used iff _use_internal_dependency_generator is non-zero. The
+# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
+%__qml_provides %{_rpmhome}/qmldeps.sh --provides
+%__qml_requires %{_rpmhome}/qmldeps.sh --requires
diff -urN rpm-5.4.10-orig/Makefile.am rpm-5.4.10-patched/Makefile.am
--- rpm-5.4.10-orig/Makefile.am 2012-03-17 11:24:19.000000000 +1100
+++ rpm-5.4.10-patched/Makefile.am 2016-10-13 21:31:19.515242610 +1000
@@ -118,7 +118,7 @@
pkgcfg_DATA = \
macros/cmake macros/gstreamer macros/java macros/kernel macros/libtool \
macros/mandriva macros/mono macros/perl macros/pkgconfig macros/php \
- macros/python macros/ruby macros/selinux macros/tcl
+ macros/python macros/ruby macros/selinux macros/tcl macros/qml
noinst_HEADERS = build.h debug.h system.h
diff -urN rpm-5.4.10-orig/scripts/Makefile.am rpm-5.4.10-patched/scripts/Makefile.am
--- rpm-5.4.10-orig/scripts/Makefile.am 2016-10-13 19:51:47.745996150 +1000
+++ rpm-5.4.10-patched/scripts/Makefile.am 2016-10-13 21:31:19.519242610 +1000
@@ -67,7 +67,8 @@
rpm.daily rpm.log rpm.xinetd \
rubygems.rb \
tgpg u_pkg.sh \
- vcheck vpkg-provides.sh vpkg-provides2.sh
+ vcheck vpkg-provides.sh vpkg-provides2.sh \
+ qmldeps.sh
pkglibbindir = @USRLIBRPM@/bin
diff -urN rpm-5.4.10-orig/scripts/qmldeps.sh rpm-5.4.10-patched/scripts/qmldeps.sh
--- rpm-5.4.10-orig/scripts/qmldeps.sh 1970-01-01 10:00:00.000000000 +1000
+++ rpm-5.4.10-patched/scripts/qmldeps.sh 2016-10-13 22:13:24.485346817 +1000
@@ -0,0 +1,88 @@
+#!/bin/bash
+# Copyright (C) 2012 Jolla Oy
+# Contact: Bernd Wachter <bernd.wachter@jollamobile.com>
+# Modified by Andrey Bondrov <andrey.bondrov@rosalab.ru>
+#
+# Try to locate module information for automatic provide generation from
+# qmldir files as well as information about imported modules for automatic
+# require generation from qml files.
+#
+# TODO:
+# - figure out if type handling needs special attention in regard to versioning
+# - stuff like Sailfish.Silica.theme currently can't get autodetected
+# - implement requires generation
+# - check if the regex include all valid characters allowed in module definitions
+# - fine tune the regex -- they're currently not perfect, just "good enough"
+#
+# A note about versioning:
+# A module package should provide the module in the version of the highest file
+# included in the package. A package using a module should require the module
+# in a version >= the one used for the import.
+
+[ $# -ge 1 ] || {
+ cat > /dev/null
+ exit 0
+}
+
+# grep blows up with C/POSIX locale, so make sure we're using a working locale
+if [ -z "$LANG" ] || [ "$LANG" = "C" ] || [ "$LANG" = "POSIX" ] ; then
+ export LANG=en_US.UTF-8
+fi
+
+case $1 in
+-P|--provides)
+ while read file; do
+ case "$file" in
+ */qmldir)
+ if head -1 "$file" | grep -iq '^module\s*' 2>/dev/null; then
+ provides="`head -1 ${file} | sed -r 's/^module\s+//'`"
+ version="`grep -i -E -o '^[a-z]*\s+[0-9.]*\s+[a-z0-9]*.qml' ${file} | awk '{print $2}' | sort -r | uniq | head -1`"
+ if [ -z "$version" ]; then
+# echo "qmldeps: WARNING: no version number found, package version will be used." >&2
+ echo "qml($provides)"
+ else
+ echo "qml($provides) = $version"
+ fi
+ else
+ echo "qmldeps: no valid module definition found in $file" >&2
+ fi
+ ;;
+ esac
+ done
+ ;;
+-R|--requires)
+ while read file; do
+ case "$file" in
+ *.qml)
+ # this first part is some hack to avoid depending on own provides
+ # for modules
+ qmldir=`echo ${file}|sed 's,/[^/]*$,,'`
+ qmldir_noprivate=`echo ${file}|sed 's,private/[^/]*$,,'`
+ if [ -f $qmldir/qmldir ]; then
+ module=`head -1 $qmldir/qmldir | sed -r 's/^.*\s+//'`
+ elif [ -f $qmldir_noprivate/qmldir ]; then
+ module=`head -1 $qmldir_noprivate/qmldir | sed -r 's/^.*\s+//'`
+ fi
+ IFS=$'\n'
+ imports=`grep -i -E -o '^\s*import\s+[a-z0-9.]*\s+[0-9.]*' ${file} | sed -r -e 's/^\s*import\s*//' | sort | uniq`
+ if [ -z "$imports" ]; then
+ echo "qmldeps: no imports found in $file. Probably should not happen." >&2
+ fi
+ for i in $imports; do
+ import=`echo $i | awk '{ print $1 }'`
+ import_version=`echo $i | awk '{ print $2 }'`
+ if [ $import = "$module" ]; then
+ echo "qmldeps: skipping provide for own module '$module' in $file" >&2
+ elif echo $import | grep -q '\.private$'; then
+ echo "qmldeps: skipping private import '$import' in $file" >&2
+ else
+ # remove the >&2 to enable requires generation as well
+ echo "qml($import) >= $import_version"
+ fi
+ done
+ ;;
+ esac
+ done
+ ;;
+esac
+exit 0

View file

@ -1,20 +0,0 @@
--- rpm-5.4.10/macros/macros.rpmbuild.in.realpath~ 2013-01-04 19:05:11.947714307 +0100
+++ rpm-5.4.10/macros/macros.rpmbuild.in 2013-01-04 19:04:46.741328887 +0100
@@ -326,7 +326,7 @@ echo "Patch #%{__patch_number} (%{basena
%___build_args -e
%___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
%___build_pre \
- RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
+ RPM_BUILD_DIR=\"%{realpath:%{u2p:%{_builddir}}}\"\
RPM_OPT_FLAGS=\"%{optflags}\"\
export RPM_BUILD_DIR RPM_OPT_FLAGS\
%{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
@@ -345,7 +345,7 @@ echo "Patch #%{__patch_number} (%{basena
\
%{verbose:set -x}%{!verbose:exec > /dev/null}\
umask 022\
- cd "%{u2p:%{_builddir}}"\
+ cd "%{realpath:%{u2p:%{_builddir}}}"\
#%___build_body %{nil}

View file

@ -1,56 +0,0 @@
--- rpm-5.4.10/rpmdb/rpmdb.h.typecast~ 2013-01-16 18:43:33.115896979 +0100
+++ rpm-5.4.10/rpmdb/rpmdb.h 2013-01-16 18:43:37.789965686 +0100
@@ -938,7 +938,7 @@ fprintf(stderr, "<-- %s(%p,%p,0x%x) logc
/*@unused@*/ static inline
int rpmlgcGet(rpmdb rpmdb, DB_LSN * _lsn, DBT * data, uint32_t flags)
{
- DB_LOGC * _logc = rpmdb->db_logc;
+ DB_LOGC * _logc = (DB_LOGC*)rpmdb->db_logc;
int rc = (_logc ? _logc->get(_logc, _lsn, data, flags) : ENOTSUP);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p,%p,0x%x) rc %d\n", "logc->get", _logc, _lsn, data, flags, rc);
@@ -948,7 +948,7 @@ fprintf(stderr, "<-- %s(%p,%p,%p,0x%x) r
/*@unused@*/ static inline
int rpmlgcClose(rpmdb rpmdb)
{
- DB_LOGC * _logc = rpmdb->db_logc;
+ DB_LOGC * _logc = (DB_LOGC*)rpmdb->db_logc;
uint32_t _flags = 0;
int rc = (_logc ? _logc->close(_logc, _flags) : ENOTSUP);
rpmdb->db_logc = NULL;
@@ -1026,7 +1026,7 @@ fprintf(stderr, "<-- %s(%p,%d) nwrote %d
/*@unused@*/ static inline
int rpmmpfClose(rpmdb rpmdb)
{
- DB_MPOOLFILE * mpf = rpmdb->db_mpf;
+ DB_MPOOLFILE * mpf = (DB_MPOOLFILE*)rpmdb->db_mpf;
uint32_t _flags = 0;
int rc = (mpf ? mpf->close(mpf, _flags) : ENOTSUP);
rpmdb->db_mpf = NULL;
@@ -1038,7 +1038,7 @@ fprintf(stderr, "<-- %s(%p) rc %d\n", "m
/*@unused@*/ static inline
int rpmmpfGet(rpmdb rpmdb, uint32_t * _pgnop, uint32_t _flags, void ** _pagep)
{
- DB_MPOOLFILE * mpf = rpmdb->db_mpf;
+ DB_MPOOLFILE * mpf = (DB_MPOOLFILE*)rpmdb->db_mpf;
DB_TXN * _txnid = (DB_TXN*)rpmdb->db_txn;
int rc = mpf->get(mpf, _pgnop, _txnid, _flags, _pagep);
if (_rpmdb_debug)
@@ -1072,7 +1072,7 @@ exit:
/*@unused@*/ static inline
int rpmmpfPut(rpmdb rpmdb, void * _page, uint32_t flags)
{
- DB_MPOOLFILE * mpf = rpmdb->db_mpf;
+ DB_MPOOLFILE * mpf = (DB_MPOOLFILE*) rpmdb->db_mpf;
uint32_t _priority = DB_PRIORITY_DEFAULT;
int rc = mpf->put(mpf, _page, (DB_CACHE_PRIORITY)_priority, flags);
if (_rpmdb_debug)
@@ -1083,7 +1083,7 @@ fprintf(stderr, "<-- %s(%p,%p,0x%x,0x%x)
/*@unused@*/ static inline
int rpmmpfSync(rpmdb rpmdb)
{
- DB_MPOOLFILE * mpf = rpmdb->db_mpf;
+ DB_MPOOLFILE * mpf = (DB_MPOOLFILE*)rpmdb->db_mpf;
int rc = (mpf ? mpf->sync(mpf) : ENOTSUP);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p) rc %d\n", "mpf->close", mpf, rc);

View file

@ -1,333 +0,0 @@
--- rpm-5.4.10/tools/Makefile.am.rpmdbchk~ 2012-05-04 17:58:08.000000000 +0200
+++ rpm-5.4.10/tools/Makefile.am 2013-04-02 09:11:56.264985289 +0200
@@ -29,7 +29,7 @@ EXTRA_PROGRAMS = augtool cudftool dbconv
nix-env nix-hash nix-install-package nix-instantiate \
nix-log2xml nix-prefetch-url nix-pull nix-push nix-store nix-worker \
xiu-echo xiu-hash xiu-instantiate xiu-store \
- roto rpmkey sandbox semodule spooktool
+ roto rpmdbchk rpmkey sandbox semodule spooktool
RPMMISC_LDADD_COMMON = \
$(top_builddir)/misc/librpmmisc.la \
@@ -60,7 +60,7 @@ pkgbin_PROGRAMS = \
rpmcache rpmdigest rpmrepo rpmspecdump \
rpmcmp rpmdeps sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
if WITH_DB
-pkgbin_PROGRAMS += dbconvert
+pkgbin_PROGRAMS += dbconvert rpmdbchk
endif
dist_man_MANS = rpmgrep.1
@@ -230,6 +230,13 @@ rpm2cpio_LDFLAGS = @LDFLAGS_STATIC@ $(LD
rpm2cpio_LDADD = $(LDFLAGS) $(RPM_LDADD_COMMON)
##
+## rpmdbchk tool for finding and fixing broken headers
+##
+rpmdbchk_SOURCES = rpmdbchk.c
+rpmdbchk_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
+rpmdbchk_LDADD = $(LDFLAGS) $(RPM_LDADD_COMMON)
+
+##
## keyctl(1) clone
##
rpmkey_SOURCES = rpmkey.c
--- rpm-5.4.10/tools/rpmdbchk.c.rpmdbchk~ 2013-04-02 09:11:56.264985289 +0200
+++ rpm-5.4.10/tools/rpmdbchk.c 2013-04-06 01:03:20.082982283 +0200
@@ -0,0 +1,296 @@
+#include <arpa/inet.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <popt.h>
+
+#include <rpmio.h>
+#include <rpmlog.h>
+#include <rpmmacro.h>
+#include <argv.h>
+
+#define _RPMTAG_INTERNAL
+#define _RPMDB_INTERNAL
+#define WITH_DB
+#include <rpmdb.h>
+
+#include <rpmts.h>
+#include <rpmrc.h>
+#include <pkgio.h>
+#include <rpmcli.h>
+
+static char *rootPath = NULL;
+static char *rpmdbPath = NULL;
+static int checkOnly = 0;
+
+struct node {
+ uint32_t state;
+ uint32_t keysize;
+ void *keydata;
+ struct node *next;
+};
+
+static int
+rpmdb_check(const char *prefix, const char *path, uint32_t **state, uint32_t *nkeys, struct node **broken)
+{
+ rpmts ts = NULL;
+
+ const char * dbpath = path ? path : rpmExpand("%{?_dbpath}", NULL);
+
+ DBC *dbcp = NULL;
+ dbiIndex dbi = NULL;
+ DBT key;
+ DBT data;
+ DB_TXN *txnid = NULL;
+ DB *bdb;
+
+ uint32_t hdrNum = 0;
+ uint32_t damaged = 0;
+ float pct = 0;
+ uint8_t tmp;
+
+ int xx;
+
+ ts = rpmtsCreate();
+
+ addMacro(NULL, "_dbpath", NULL, dbpath, -1);
+ rpmtsSetRootDir(ts, prefix && prefix[0] ? prefix : NULL);
+ if(rpmtsOpenDB(ts, O_RDONLY))
+ goto exit;
+
+ dbi = dbiOpen(rpmtsGetRdb(ts), RPMDBI_PACKAGES, 0);
+
+ if ((xx = dbiCopen(dbi, NULL, NULL, 0)))
+ goto exit;
+
+ txnid = dbiTxnid(dbi);
+ *nkeys = 0;
+
+ memset(&key, 0, sizeof(key));
+ memset(&data, 0, sizeof(data));
+ bdb = dbi->dbi_db;
+
+ /* Acquire a cursor for the database. */
+ xx = bdb->cursor(bdb, NULL, &dbcp, 0);
+ if (xx)
+ bdb->err(bdb, xx, "DB->cursor");
+
+ xx = bdb->stat(bdb, txnid, &dbi->dbi_stats, 0);
+ if (xx)
+ goto exit;
+
+ switch (bdb->type) {
+ case DB_BTREE:
+ case DB_RECNO:{
+ DB_BTREE_STAT *db_stat = dbi->dbi_stats;
+ *nkeys = db_stat->bt_nkeys;
+ } break;
+ case DB_HASH:{
+ DB_HASH_STAT *db_stat = dbi->dbi_stats;
+ *nkeys = db_stat->hash_nkeys;
+ } break;
+ case DB_QUEUE:{
+ DB_QUEUE_STAT *db_stat = dbi->dbi_stats;
+ *nkeys = db_stat->qs_nkeys;
+ } break;
+ case DB_UNKNOWN:
+ default:
+ xx = -1;
+ goto exit;
+ break;
+ }
+ uint32_t *status = calloc(*nkeys, sizeof(uint32_t));
+ struct node *curr;
+
+ hdrNum = 0;
+ pct = 0;
+
+ while ((xx = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) {
+ tmp = pct;
+ pct = (100 * (float) ++hdrNum / *nkeys) + 0.5;
+ /* TODO: callbacks for status output? */
+ if (tmp < (int) (pct + 0.5)) {
+ fprintf(stderr, "\rchecking %s%s/Packages: %u/%u %d%%",
+ prefix && prefix[0] ? prefix : "",
+ dbpath, hdrNum, *nkeys, (int) pct);
+ }
+ const char *msg = NULL;
+ int lvl = headerCheck(rpmtsDig(ts), data.data, data.size, &msg);
+ rpmtsCleanDig(ts);
+ if (lvl == RPMRC_FAIL) {
+ status[hdrNum-1] = htonl(*(uint32_t*)(dbcp->rkey->data));
+ damaged++;
+ fprintf(stderr, "\n%d (%d): %s\n", hdrNum-1, status[hdrNum-1], msg);
+ } else if (key.size != sizeof(hdrNum)) {
+ curr = malloc(sizeof(struct node));
+ curr->state = htonl(*(uint32_t*)(dbcp->rkey->data));
+ curr->keysize = key.size;
+ curr->keydata = malloc(key.size);
+ memcpy(curr->keydata, key.data, key.size);
+ curr->next = *broken;
+ *broken = curr;
+ status[hdrNum-1] = -1;
+ damaged++;
+ fprintf(stderr, "\n%d: %s (key.size(%d) != %d)\n", hdrNum-1, msg, key.size, sizeof(hdrNum));
+ } else
+ status[hdrNum-1] = -1;
+ fflush(stderr);
+ }
+
+ fprintf(stderr, "\n");
+
+
+ *state = status;
+ xx = dbiCclose(dbi, dbcp, 0);
+
+exit:
+ xx = rpmtsCloseDB(ts);
+ ts = rpmtsFree(ts);
+
+ return damaged;
+}
+
+static int
+rpmdb_dump_delete(DB *dbp, const char *db, const char *lost, DBT *key, uint32_t n) {
+ int gotrec;
+ int ret = 0;
+ DBT data;
+
+ memset(&data, 0, sizeof(data));
+
+ if ((ret = dbp->get(dbp, NULL, key, &data, 0)) == 0) {
+ char copy[1024];
+ snprintf(copy, sizeof(copy), "%s/header.%d", lost, n);
+ FILE *fp = fopen(copy, "w");
+ fwrite(data.data, data.size, 1, fp);
+ fclose(fp);
+ gotrec = 0;
+ memcpy(&gotrec, key->data, sizeof(gotrec));
+ printf("db: get key: %p[%d] = 0x%x, data at %p[%d].\n",
+ (char *)key->data, key->size, gotrec,
+ (char *)data.data, data.size);
+ printf("Dumping broken header to disk: %s\n", copy);
+ } else {
+ dbp->err(dbp, ret, "DB->get");
+ if (ret == DB_NOTFOUND)
+ return 0;
+ return ret;
+ }
+
+ if ((ret = dbp->del(dbp, NULL, key, 0)) == 0) {
+ gotrec = 0;
+ memcpy(&gotrec, key->data, sizeof(gotrec));
+ printf("db: del key: %p[%d] = 0x%x, data at %p[%d].\n",
+ (char *)key->data, key->size, gotrec,
+ (char *)data.data, data.size);
+ } else {
+ dbp->err(dbp, ret, "DB->del");
+ return ret;
+ }
+ return 0;
+}
+
+static int
+rpmdb_fix(const char *prefix, const char *path, uint32_t *state, uint32_t nkeys, struct node *broken)
+{
+ DB * dbp;
+ DBT key;
+ struct stat sb;
+ const char * db = rpmGetPath(prefix && prefix[0] ? prefix : "", path, "/Packages", NULL);
+ const char * lost = rpmGetPath(prefix && prefix[0] ? prefix : "", path, "/broken", NULL);
+ int ret, t_ret;
+ uint32_t i;
+
+
+ if ((ret = db_create(&dbp, NULL, 0)) != 0) {
+ fprintf(stderr, "db_create: %s\n", db_strerror(ret));
+ exit (1);
+ }
+
+ if (Stat(lost, &sb))
+ Mkdir(lost, 0700);
+
+ if ((ret = dbp->open(dbp, NULL, db, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
+ dbp->err(dbp, ret, "%s", db);
+ goto err;
+ }
+
+ for (i = 0; i < nkeys; i++) {
+ if (state[i] == -1) continue;
+ int badrec, badrec2;
+ memset(&key, 0, sizeof(key));
+ badrec2 = state[i];
+ badrec = htonl(badrec2);
+ printf("fix record[%d] at #%d/#%d --\n", i, badrec2, badrec);
+ key.data = &badrec;
+ key.size = sizeof(badrec);
+
+ ret = rpmdb_dump_delete(dbp, db, lost, &key, state[i]);
+ }
+
+ while (broken) {
+ memset(&key, 0, sizeof(key));
+ key.size = broken->keysize;
+ key.data = broken->keydata;
+ ret = rpmdb_dump_delete(dbp, db, lost, &key, broken->state);
+ free(broken->keydata);
+ free(broken);
+ broken = broken->next;
+ }
+
+
+err:
+ if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0)
+ ret = t_ret;
+ _free(db);
+ _free(lost);
+
+ return 0;
+}
+
+static struct poptOption optionsTable[] = {
+ { "root", '\0', POPT_ARG_STRING, &rootPath, 0,
+ "rpm root path", "path"},
+ { "dbpath", '\0', POPT_ARG_STRING, &rpmdbPath, 0,
+ "rpmdb path", "path"},
+ { "checkonly", '\0', POPT_ARG_VAL, &checkOnly, 1,
+ "only check, don't fix anything", NULL},
+
+ POPT_AUTOALIAS
+ POPT_AUTOHELP
+ POPT_TABLEEND
+};
+
+int main(int argc, char *argv[])
+{
+ poptContext optCon = rpmcliInit(argc, argv, optionsTable);
+ ARGV_t av = poptGetArgs(optCon);
+ int ac = argvCount(av);
+ int rc = 2; /* assume failure */
+ uint32_t nkeys = 0;
+ uint32_t *state = NULL;
+ struct node *broken = NULL;
+
+ if (ac) {
+ poptPrintUsage(optCon, stderr, 0);
+ goto exit;
+ }
+
+ rc = rpmReadConfigFiles(NULL, NULL);
+
+
+ rc = rpmdb_check(rootPath, rpmdbPath, &state, &nkeys, &broken);
+ printf("%d/%d (%f%%) headers damaged", rc, nkeys, (float)rc/nkeys);
+ printf("\n");
+ if (!checkOnly && rc) {
+ printf("fixing...\n");
+ rc = rpmdb_fix(rootPath, rpmdbPath, state, nkeys, broken);
+ }
+
+exit:
+ _free(state);
+ optCon = rpmcliFini(optCon);
+ return rc;
+}

View file

@ -1,53 +0,0 @@
--- rpm-5.4.10/build/build.c.doc_post~ 2011-01-01 15:39:54.000000000 +0100
+++ rpm-5.4.10/build/build.c 2013-02-25 01:22:28.407418823 +0100
@@ -181,9 +181,9 @@ rpmRC doScript(Spec spec, int what, cons
break;
case RPMBUILD_STRINGBUF:
default:
- mTemplate = "%{___build_template}";
- mPost = "%{___build_post}";
- mCmd = "%{___build_cmd}";
+ mTemplate = "%{__spec_stringbuf_template}";
+ mPost = "%{__spec_stringbuf_post}";
+ mCmd = "%{__spec_stringbuf_cmd}";
break;
}
--- rpm-5.4.10/macros/macros.rpmbuild.in.doc_post~ 2013-02-25 01:22:28.400418746 +0100
+++ rpm-5.4.10/macros/macros.rpmbuild.in 2013-02-25 01:22:28.410418856 +0100
@@ -411,6 +411,22 @@ echo "Patch #%{__patch_number} (%{basena
#%{__spec_install_post}\
#%{nil}
+%__spec_stringbuf_shell %{___build_shell}
+%__spec_stringbuf_args %{___build_args}
+%__spec_stringbuf_cmd %{___build_cmd}
+%__spec_stringbuf_pre %{___build_pre}
+%__spec_stringbuf_body %{___build_body}
+%__spec_stringbuf_post\
+%{?__os_stringbuf_post}\
+%{nil}
+%__spec_stringbuf_template #!%{__spec_stringbuf_shell}\
+%{__spec_stringbuf_pre}\
+%{nil}
+
+#%{__spec_stringbuf_body}\
+#%{__spec_stringbuf_post}\
+#%{nil}
+
%__spec_check_shell %{___build_shell}
%__spec_check_args %{___build_args}
%__spec_check_cmd %{___build_cmd}
--- rpm-5.4.10/macros/mandriva.in.doc_post~ 2013-02-25 01:22:28.395418692 +0100
+++ rpm-5.4.10/macros/mandriva.in 2013-02-25 01:22:45.531606854 +0100
@@ -332,6 +332,10 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} -
%{?__spec_helper_post}%{?!__spec_helper_post:/usr/share/spec-helper/spec-helper} \
%{nil}
+%__os_stringbuf_post \
+ %{?__spec_helper_stringbuf_post} \
+%{nil}
+
#==============================================================================
# ---- specfile macros.
# Macro(s) here can be used reliably for reproducible builds.

View file

@ -1,57 +0,0 @@
--- rpm-5.4.10/lib/rpmds.c.uclibc_buildroot~ 2012-10-04 16:25:30.850199688 +0200
+++ rpm-5.4.10/lib/rpmds.c 2012-10-04 16:25:40.130349028 +0200
@@ -3063,8 +3063,10 @@ foo:
}
if (dyn->d_tag == DT_NEEDED) {
char *tmp, *tmp2;
- char buf[MAXPATHLEN];
- char path[MAXPATHLEN] = "";
+ /* XXX: we multiply by 4 to make sure to have room for several paths */
+ char buf[4*MAXPATHLEN] = "";
+ char path[4*MAXPATHLEN];
+ char *buildroot;
libpath = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
if (prev && *prev && libpath && !strcmp(basename(prev), libpath))
@@ -3084,10 +3086,9 @@ foo:
if (stat(libpath, &statbuf) == 0)
continue;
- tmp2 = path;
+ tmp2 = buf;
if (rpath && *rpath) {
- tmp2 = stpcpy(tmp2, rpath);
- tmp2 = stpcpy(tmp2, ":");
+ tmp2 = stpcpy(buf, rpath);
}
tmp = getenv("LD_LIBRARY_PATH");
if (tmp)
@@ -3096,6 +3097,28 @@ foo:
tmp2 = stpcpy(tmp2, ":");
/* XXX: do better check to ensure libraries are all of the same class */
tmp2 = stpcpy(tmp2, (class == ELFCLASS64) ? "/lib64:/usr/lib64" : "/lib:/usr/lib");
+ /* we need to search through library paths within buildroot as well */
+ buildroot = rpmExpand("%{buildroot}", NULL);
+ if (stat(buildroot, &statbuf) == 0) {
+ char *tmp3;
+ for (tmp2 = buf, tmp = path;
+ tmp2 != NULL;
+ tmp2 = tmp3) {
+ tmp = stpcpy(tmp, buildroot);
+ tmp3 = strchr(tmp2, ':');
+ if (tmp3)
+ *tmp3 = '\0';
+ tmp = stpcpy(tmp, tmp2);
+ tmp = stpcpy(tmp, ":");
+ if (tmp3) {
+ *tmp3 = ':';
+ tmp3++;
+ }
+ }
+ } else
+ tmp = path;
+ _free(buildroot);
+ stpcpy(tmp, buf);
tmp = buf;
{
int i, count = 1;

View file

@ -1,16 +0,0 @@
--- rpm-5.4.10/macros/ruby.in.ruby_utf8~ 2012-12-27 22:56:04.080134683 +0100
+++ rpm-5.4.10/macros/ruby.in 2012-12-27 22:55:11.132459560 +0100
@@ -27,11 +27,13 @@
%__gem_helper %{_usrlibrpm}/gem_helper.rb
%gem_build(f:j:) \
+ export LC_CTYPE=UTF-8 \
%__gem_helper build \\\
%{-f:-f%{-f*}} \\\
%{!-j:%{_smp_mflags}}%{-j:-j%{-j*}}
%gem_install(i:n:C) \
+ export LC_CTYPE=UTF-8 \
DESTDIR=${DESTDIR:-%{buildroot}} \\\
%__gem_helper install \\\
--env-shebang --rdoc --ri --force --ignore-dependencies \\\

View file

@ -1,20 +0,0 @@
diff -Naur rpm-5.4.10-orig/macros/mandriva rpm-5.4.10/macros/mandriva
--- rpm-5.4.10-orig/macros/mandriva 2012-07-06 21:02:38.000000000 +0400
+++ rpm-5.4.10/macros/mandriva 2018-05-29 13:05:54.292402124 +0300
@@ -505,3 +505,6 @@
%{nil}
%{load:/etc/rpm/macros.d/*.macros}
+
+# https://forum.rosalinux.ru/viewtopic.php?f=56&t=8427&p=88972&hilit=rpm4+rpm5#p88972
+%__nofsync nofsync
diff -Naur rpm-5.4.10-orig/macros/mandriva.in rpm-5.4.10/macros/mandriva.in
--- rpm-5.4.10-orig/macros/mandriva.in 2012-05-20 00:35:44.000000000 +0400
+++ rpm-5.4.10/macros/mandriva.in 2018-05-29 13:05:21.900835899 +0300
@@ -505,3 +505,6 @@
%{nil}
%{load:/etc/rpm/macros.d/*.macros}
+
+# https://forum.rosalinux.ru/viewtopic.php?f=56&t=8427&p=88972&hilit=rpm4+rpm5#p88972
+%__nofsync nofsync

View file

@ -1,32 +0,0 @@
diff -urN rpm-5.4.10/rpmio/rpmsquirrel.c rpm-5.4.10-patched/rpmio/rpmsquirrel.c
--- rpm-5.4.10/rpmio/rpmsquirrel.c 2012-04-16 08:20:53.000000000 +1100
+++ rpm-5.4.10-patched/rpmio/rpmsquirrel.c 2015-12-22 02:04:15.011765783 +1000
@@ -72,6 +72,16 @@
(void) rpmiobAppend(squirrel->iob, b, 0);
b = _free(b);
}
+
+#if defined(SQUIRREL_VERSION_NUMBER) && SQUIRREL_VERSION_NUMBER >= 300
+static void rpmsquirrelStderr(HSQUIRRELVM v, const SQChar *s,...)
+{
+ va_list vl;
+ va_start(vl, s);
+ vfprintf(stderr, s, vl);
+ va_end(vl);
+}
+#endif
#endif
/* XXX FIXME: honor 0x8000000 in flags to use global interpreter */
@@ -103,7 +113,11 @@
squirrel->I = v;
sq_setforeignptr(v, squirrel);
+#if defined(SQUIRREL_VERSION_NUMBER) && SQUIRREL_VERSION_NUMBER >= 300
+ sq_setprintfunc(v, rpmsquirrelPrint, rpmsquirrelStderr);
+#else
sq_setprintfunc(v, rpmsquirrelPrint);
+#endif
#ifdef NOTYET
{ int i;

View file

@ -1,45 +0,0 @@
--- rpm-5.4.10/lib/depends.c.ignore_arch~ 2012-07-27 21:11:47.463139875 +0200
+++ rpm-5.4.10/lib/depends.c 2012-07-27 21:29:21.811958701 +0200
@@ -587,11 +587,24 @@ int rpmtsAddInstallElement(rpmts ts, Hea
if (nplatpat > 1) {
const char * platform = NULL;
- he->tag = RPMTAG_PLATFORM;
- xx = headerGet(h, he, 0);
- platform = he->p.str;
- if (!xx || platform == NULL)
- platform = rpmExpand(arch, "-unknown-", os, NULL);
+ /*
+ * If ignore arch, we just set the arch in package platform string to
+ * same as on system so that we're sure that it'll match, same goes for
+ * os as well.
+ */
+ if (rpmExpandNumeric("%{__ignore_arch}") || rpmExpandNumeric("%{__ignore_os}")) {
+ platform = rpmExpand(
+ rpmExpandNumeric("%{__ignore_arch}") ? "%{_target_cpu}" : arch,
+ "-unknown-",
+ rpmExpandNumeric("%{__ignore_os}") ? "%{_target_os}" : os,
+ NULL);
+ } else {
+ he->tag = RPMTAG_PLATFORM;
+ xx = headerGet(h, he, 0);
+ platform = he->p.str;
+ if (!xx || platform == NULL)
+ platform = rpmExpand(arch, "-unknown-", os, NULL);
+ }
rc = rpmPlatformScore(platform, platpat, nplatpat);
#if defined(RPM_VENDOR_MANDRIVA)
--- rpm-5.4.10/rpmpopt.in.ignore_arch~ 2012-07-27 21:29:07.687135285 +0200
+++ rpm-5.4.10/rpmpopt.in 2012-07-27 21:29:35.399788829 +0200
@@ -431,6 +431,10 @@ rpm alias --without --define "_without_
rpm alias --arch --qf '%-34{=NAME}\t%{ARCH}\n' \
--POPTdesc=$"list package architecture"
+
+rpm alias --ignorearch --define '__ignore_arch 1'
+rpm alias --ignoreos --define '__ignore_os 1'
+
#==============================================================================
rpmbuild alias --dbpath --define '_dbpath !#:+' \
--POPTdesc=$"use database in DIRECTORY" \

View file

@ -1,847 +0,0 @@
--- rpm-5.4.15/build/parseReqs.c.trigtrans~ 2014-09-05 06:44:52.694095488 +0200
+++ rpm-5.4.15/build/parseReqs.c 2014-09-05 06:44:52.724095787 +0200
@@ -66,6 +66,22 @@ rpmRC parseRCPOT(Spec spec, Package pkg,
tagflags |= RPMSENSE_TRIGGERUN;
h = pkg->header;
break;
+ case RPMTAG_TRIGGERPRETRANSIN:
+ tagflags |= (RPMSENSE_TRIGGERTRANS | RPMSENSE_TRIGGERPREIN);
+ h = pkg->header;
+ break;
+ case RPMTAG_TRIGGERPRETRANSUN:
+ tagflags |= (RPMSENSE_TRIGGERTRANS | RPMSENSE_TRIGGERUN);
+ h = pkg->header;
+ break;
+ case RPMTAG_TRIGGERPOSTTRANSIN:
+ tagflags |= (RPMSENSE_TRIGGERTRANS | RPMSENSE_TRIGGERIN);
+ h = pkg->header;
+ break;
+ case RPMTAG_TRIGGERPOSTTRANSUN:
+ tagflags |= (RPMSENSE_TRIGGERTRANS | RPMSENSE_TRIGGERPOSTUN);
+ h = pkg->header;
+ break;
case RPMTAG_BUILDSUGGESTS:
case RPMTAG_BUILDENHANCES:
tagflags |= RPMSENSE_MISSINGOK;
--- rpm-5.4.15/build/parseScript.c.trigtrans~ 2014-09-05 06:44:52.697428855 +0200
+++ rpm-5.4.15/build/parseScript.c 2014-09-05 06:44:52.724095787 +0200
@@ -181,6 +181,34 @@ int parseScript(Spec spec, int parsePart
progtag = RPMTAG_TRIGGERSCRIPTPROG;
partname = "%triggerpostun";
break;
+ case PART_TRIGGERPRETRANSIN:
+ tag = RPMTAG_TRIGGERSCRIPTS;
+ tagflags = 0;
+ reqtag = RPMTAG_TRIGGERPRETRANSIN;
+ progtag = RPMTAG_TRIGGERSCRIPTPROG;
+ partname = "%triggerpretransin";
+ break;
+ case PART_TRIGGERPRETRANSUN:
+ tag = RPMTAG_TRIGGERSCRIPTS;
+ tagflags = 0;
+ reqtag = RPMTAG_TRIGGERPRETRANSUN;
+ progtag = RPMTAG_TRIGGERSCRIPTPROG;
+ partname = "%triggerpretransun";
+ break;
+ case PART_TRIGGERPOSTTRANSIN:
+ tag = RPMTAG_TRIGGERSCRIPTS;
+ tagflags = 0;
+ reqtag = RPMTAG_TRIGGERPOSTTRANSIN;
+ progtag = RPMTAG_TRIGGERSCRIPTPROG;
+ partname = "%triggerposttransin";
+ break;
+ case PART_TRIGGERPOSTTRANSUN:
+ tag = RPMTAG_TRIGGERSCRIPTS;
+ tagflags = 0;
+ reqtag = RPMTAG_TRIGGERPOSTTRANSUN;
+ progtag = RPMTAG_TRIGGERSCRIPTPROG;
+ partname = "%triggerposttransun";
+ break;
/* support "%sanitycheck" script/section */
case PART_SANITYCHECK:
tag = RPMTAG_SANITYCHECK;
--- rpm-5.4.15/build/parseSpec.c.trigtrans~ 2014-09-05 06:44:52.607427959 +0200
+++ rpm-5.4.15/build/parseSpec.c 2014-09-05 06:44:52.724095787 +0200
@@ -47,6 +47,10 @@ static struct PartRec {
{ PART_TRIGGERUN, 0, "%triggerun"},
{ PART_TRIGGERIN, 0, "%triggerin"},
{ PART_TRIGGERIN, 0, "%trigger"},
+ { PART_TRIGGERPRETRANSIN,0, "%triggerpretransin"},
+ { PART_TRIGGERPRETRANSUN,0, "%triggerpretransun"},
+ { PART_TRIGGERPOSTTRANSIN,0, "%triggerposttransin"},
+ { PART_TRIGGERPOSTTRANSUN,0, "%triggerposttransun"},
{ PART_VERIFYSCRIPT, 0, "%verifyscript"},
{ PART_SANITYCHECK, 0, "%sanitycheck"}, /* support "%sanitycheck" scriptlet */
{0, 0, NULL}
@@ -608,6 +612,10 @@ int parseSpec(rpmts ts, const char *spec
case PART_TRIGGERIN:
case PART_TRIGGERUN:
case PART_TRIGGERPOSTUN:
+ case PART_TRIGGERPRETRANSIN:
+ case PART_TRIGGERPRETRANSUN:
+ case PART_TRIGGERPOSTTRANSIN:
+ case PART_TRIGGERPOSTTRANSUN:
parsePart = parseScript(spec, parsePart);
/*@switchbreak@*/ break;
--- rpm-5.4.15/build/rpmbuild.h.trigtrans~ 2010-02-10 19:36:17.000000000 +0100
+++ rpm-5.4.15/build/rpmbuild.h 2014-09-05 06:44:52.724095787 +0200
@@ -76,10 +76,14 @@ typedef enum rpmParseState_e {
PART_BUILDARCHITECTURES= 29+PART_BASE,/*!< */
PART_TRIGGERPOSTUN = 30+PART_BASE, /*!< */
PART_TRIGGERPREIN = 31+PART_BASE, /*!< */
+ PART_TRIGGERPRETRANSIN= 32+PART_BASE, /*!< */
+ PART_TRIGGERPRETRANSUN= 33+PART_BASE, /*!< */
+ PART_TRIGGERPOSTTRANSIN= 34+PART_BASE, /*!< */
+ PART_TRIGGERPOSTTRANSUN= 35+PART_BASE, /*!< */
/* support "%sanitycheck" script */
- PART_SANITYCHECK = 32+PART_BASE, /*!< */
- PART_ARBITRARY = 33+PART_BASE, /*!< */
- PART_LAST = 34+PART_BASE /*!< */
+ PART_SANITYCHECK = 36+PART_BASE, /*!< */
+ PART_ARBITRARY = 37+PART_BASE, /*!< */
+ PART_LAST = 38+PART_BASE /*!< */
} rpmParseState;
/** \ingroup rpmbuild
--- rpm-5.4.15/lib/psm.c.trigtrans~ 2014-09-05 06:44:52.704095588 +0200
+++ rpm-5.4.15/lib/psm.c 2014-09-05 06:45:30.931142793 +0200
@@ -59,6 +59,7 @@
(*((unsigned *)&(_psm)->flags) &= ~(RPMPSM_FLAGS_##_FLAG))
#define _RPMEVR_INTERNAL
+#define _RPMDS_INTERNAL
#include "rpmds.h"
#define _RPMTE_INTERNAL
@@ -404,6 +405,10 @@ static /*@observer@*/ const char * tag2s
case RPMTAG_POSTUN: return "%postun";
case RPMTAG_POSTTRANS: return "%posttrans";
case RPMTAG_TRIGGERPOSTUN: return "%triggerpostun";
+ case RPMTAG_TRIGGERPRETRANSIN: return "%triggerpretransin";
+ case RPMTAG_TRIGGERPRETRANSUN: return "%triggerpretransun";
+ case RPMTAG_TRIGGERPOSTTRANSIN: return "%triggerposttransin";
+ case RPMTAG_TRIGGERPOSTTRANSUN: return "%triggerposttransun";
case RPMTAG_VERIFYSCRIPT: return "%verify";
case RPMTAG_SANITYCHECK: return "%sanitycheck";
case RPMTAG_BUILDPREP: return "%prep";
@@ -434,6 +439,10 @@ static rpmScriptID tag2slx(rpmTag tag)
case RPMTAG_POSTUN: return RPMSCRIPT_POSTUN;
case RPMTAG_POSTTRANS: return RPMSCRIPT_POSTTRANS;
case RPMTAG_TRIGGERPOSTUN: return RPMSCRIPT_TRIGGERPOSTUN;
+ case RPMTAG_TRIGGERPRETRANSIN: return RPMSCRIPT_TRIGGERPRETRANSIN;
+ case RPMTAG_TRIGGERPRETRANSUN: return RPMSCRIPT_TRIGGERPRETRANSUN;
+ case RPMTAG_TRIGGERPOSTTRANSIN: return RPMSCRIPT_TRIGGERPOSTTRANSIN;
+ case RPMTAG_TRIGGERPOSTTRANSUN: return RPMSCRIPT_TRIGGERPOSTTRANSUN;
case RPMTAG_VERIFYSCRIPT: return RPMSCRIPT_VERIFY;
case RPMTAG_SANITYCHECK: return RPMSCRIPT_SANITYCHECK;
case RPMTAG_BUILDPREP: return RPMSCRIPT_PREP;
@@ -1279,7 +1288,6 @@ static rpmRC handleOneTrigger(const rpmp
rpmds Fds = NULL;
rpmds Dds = NULL;
rpmds Pds = NULL;
- const char * sourceName;
const char * triggerName;
rpmRC rc = RPMRC_OK;
int arg1;
@@ -1287,10 +1295,6 @@ static rpmRC handleOneTrigger(const rpmp
int i;
he->tag = RPMTAG_NAME;
- xx = headerGet(sourceH, he, 0);
- sourceName = he->p.str;
-
- he->tag = RPMTAG_NAME;
xx = headerGet(triggeredH, he, 0);
triggerName = he->p.str;
@@ -1428,7 +1432,6 @@ exit:
She->p.ptr = _free(She->p.ptr);
Phe->p.ptr = _free(Phe->p.ptr);
triggerName = _free(triggerName);
- sourceName = _free(sourceName);
return rc;
}
@@ -1749,6 +1752,348 @@ exit:
return rc;
}
+/**
+ * Return transaction element's file info.
+ * @todo Take a rpmfi refcount here.
+ * @param tsi transaction element iterator
+ * @return transaction element file info
+ */
+static /*@null@*/
+rpmfi rpmtsiFi(const rpmtsi tsi)
+ /*@*/
+{
+ rpmfi fi = NULL;
+
+ if (tsi != NULL && tsi->ocsave != -1) {
+ /*@-type -abstract@*/ /* FIX: rpmte not opaque */
+ rpmte te = rpmtsElement(tsi->ts, tsi->ocsave);
+ /*@-assignexpose@*/
+ if (te != NULL && (fi = te->fi) != NULL)
+ fi->te = te;
+ /*@=assignexpose@*/
+ /*@=type =abstract@*/
+ }
+ /*@-compdef -refcounttrans -usereleased @*/
+ return fi;
+ /*@=compdef =refcounttrans =usereleased @*/
+}
+/**
+ * Execute triggers.
+ * @param psm package state machine data
+ * @param sourceH
+ * @param triggeredH
+ * @param arg2
+ * @return RPMRC_OK on success
+ */
+static rpmRC handleOneScriptTrigger(const rpmpsm psm,
+ rpmds sourceDs, Header triggeredH, int arg2)
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState@*/
+ /*@modifies psm, sourceH, triggeredH,
+ rpmGlobalMacroContext, fileSystem, internalState @*/
+{
+ static int scareMem = 0;
+ HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
+ HE_t Ihe = memset(alloca(sizeof(*Ihe)), 0, sizeof(*Ihe));
+ HE_t She = memset(alloca(sizeof(*She)), 0, sizeof(*She));
+ HE_t Phe = memset(alloca(sizeof(*Phe)), 0, sizeof(*Phe));
+ miRE mire = NULL;
+ const rpmts ts = psm->ts;
+ rpmds Tds = NULL;
+ const char * triggerName;
+ rpmRC rc = RPMRC_OK;
+ int arg1;
+ int xx;
+ int i;
+
+ he->tag = RPMTAG_NAME;
+ xx = headerGet(triggeredH, he, 0);
+ triggerName = he->p.str;
+
+ arg1 = rpmdbCountPackages(rpmtsGetRdb(ts), triggerName);
+ if (arg1 < 0) {
+ /* XXX W2DO? fails as "execution of script failed" */
+ rc = RPMRC_FAIL;
+ goto exit;
+ }
+ arg1 += psm->countCorrection;
+
+ Tds = rpmdsNew(triggeredH, RPMTAG_TRIGGERNAME, scareMem);
+ if (Tds == NULL)
+ goto exit;
+ xx = rpmdsSetNoPromote(Tds, 1);
+
+ Ihe->tag = RPMTAG_TRIGGERINDEX;
+ if (!headerGet(triggeredH, Ihe, 0))
+ goto exit;
+
+ She->tag = RPMTAG_TRIGGERSCRIPTS;
+ if (!headerGet(triggeredH, She, 0))
+ goto exit;
+
+ Phe->tag = RPMTAG_TRIGGERSCRIPTPROG;
+ if (!headerGet(triggeredH, Phe, 0))
+ goto exit;
+
+ if ((Tds = rpmdsInit(Tds)) != NULL)
+ while ((i = rpmdsNext(Tds)) >= 0) {
+ rpmuint32_t Flags = rpmdsFlags(Tds);
+ char * depName;
+ ARGV_t matches = NULL;
+ int bingo;
+
+ /* Skip triggers that are not in this context. */
+ if (!((Flags & psm->sense) & RPMSENSE_TRIGGERTRANS))
+ continue;
+
+ bingo = 0; /* no trigger to fire. */
+ depName = (char *) rpmdsN(Tds);
+ if (rpmdsTagN(sourceDs) == RPMTAG_BASENAMES || rpmdsTagN(sourceDs) == RPMTAG_DIRNAMES) {
+ if (mire == NULL)
+ mire = mireNew(depName[0] == '^' ? RPMMIRE_PCRE : RPMMIRE_GLOB, 0);
+
+ xx = mireRegcomp(mire, depName);
+ for(rpmdsSetIx(sourceDs, 0);
+ rpmdsIx(sourceDs) < rpmdsCount(sourceDs);
+ rpmdsSetIx(sourceDs, rpmdsIx(sourceDs)+1)) {
+ char * N = (char *) sourceDs->N[sourceDs->i];
+ xx = mireRegexec(mire, N, 0);
+ if (xx < 0)
+ /*@innercontinue@*/ continue;
+ bingo = 1;
+ if (_psm_debug)
+ rpmlog(RPMLOG_DEBUG, "--> %s:%d bingo! N: %s\n", __FUNCTION__, __LINE__, N);
+
+ argvAdd(&matches, N);
+ }
+ xx = mireClean(mire);
+ /* If trigger not fired yet, try provided dependency match. */
+ } else {
+ bingo = rpmdsMatch(Tds, sourceDs);
+ bingo = rpmdsNegateRC(Tds, bingo);
+ }
+
+ if (!bingo)
+ continue;
+
+ /* Coerce strings into header argv return. */
+ { int index = Ihe->p.ui32p[i];
+ const char * s = Phe->p.argv[index];
+ char * t;
+
+ he->tag = Phe->tag;
+ he->t = RPM_STRING_ARRAY_TYPE;
+ he->c = 1;
+ he->p.argv = xmalloc(sizeof(Phe->p.argv[0]) + strlen(s) + 1);
+ he->p.argv[0] = t = (char *) &he->p.argv[1];
+ t = stpcpy(t, s);
+ *t = '\0';
+
+ rc |= runScript(psm, triggeredH, "%trigger", he,
+ She->p.argv[index], arg1, arg2, matches);
+ if (_psm_debug)
+ rpmlog(RPMLOG_DEBUG, "--> %s:%d runScript: %s arg1: %d arg2: %d matches: %d rc: %d\n", __FUNCTION__, __LINE__, She->p.argv[index], arg1, arg2, matches, rc);
+
+ he->p.ptr = _free(he->p.ptr);
+ }
+ argvFree(matches);
+ }
+
+ mire = mireFree(mire);
+ (void)rpmdsFree(Tds);
+ Tds = NULL;
+
+exit:
+ Ihe->p.ptr = _free(Ihe->p.ptr);
+ She->p.ptr = _free(She->p.ptr);
+ Phe->p.ptr = _free(Phe->p.ptr);
+ triggerName = _free(triggerName);
+
+ return rc;
+}
+
+/**
+ * Run a dependency set loop against rpmdb triggers.
+ * @param psm package state machine data
+ * @param tagno dependency set to run against rpmdb
+ * @param arg2 scriptlet arg2
+ * @return RPMRC_OK on success
+ */
+static rpmRC runScriptTriggersLoop(rpmpsm psm, rpmTag tagno, int arg2)
+ /*@globals rpmGlobalMacroContext, h_errno,
+ fileSystem, internalState @*/
+ /*@modifies psm, rpmGlobalMacroContext,
+ fileSystem, internalState @*/
+{
+ static int scareMem = 0;
+ const rpmts ts = psm->ts;
+ rpmfi fi = NULL;
+ rpmds sourceDs = memset(alloca(sizeof(*sourceDs)), 0, sizeof(*sourceDs));
+ char * depName = NULL;
+ char * evr;
+ char * ptr = NULL;
+ ARGI_t instances = NULL;
+ rpmmi mi;
+ Header triggeredH;
+ rpmRC rc = RPMRC_OK;
+ int xx;
+ rpmtsi pi;
+ rpmte p = NULL;
+ int n;
+
+ if (tagno == RPMTAG_BASENAMES || tagno == RPMTAG_DIRNAMES)
+ n = (psm->goal == PSM_PKGINSTALL) ? ts->numAddedFiles : ts->numErasedFiles;
+ else
+ n = ts->orderCount;
+
+ evr = memset(alloca(n * 64 * sizeof(*evr)), 0, n * 64 * sizeof(*evr));
+ ptr = evr;
+ sourceDs->tagN = tagno;
+ sourceDs->Type = tagName(tagno);
+ sourceDs->Count = n;
+ sourceDs->i = -1;
+ sourceDs->N = memset(alloca(n * sizeof(*sourceDs->N)), 0, n * sizeof(*sourceDs->N));
+ sourceDs->EVR = memset(alloca(n * sizeof(*sourceDs->EVR)), 0, n * sizeof(*sourceDs->EVR));
+ sourceDs->Flags = (evrFlags *) memset(alloca(n * sizeof(*sourceDs->Flags)), 0, n * sizeof(*sourceDs->Flags));
+
+ pi = rpmtsiInit(ts);
+ while ((p = rpmtsiNext(pi, psm->goal == PSM_PKGINSTALL ? TR_ADDED : TR_REMOVED)) != NULL) {
+ if (p->isSource) continue;
+ if ((fi = rpmtsiFi(pi)) == NULL)
+ continue;
+ if (tagno == RPMTAG_BASENAMES || tagno == RPMTAG_DIRNAMES) {
+ fi = rpmfiInit(fi, 0);
+ if (fi != NULL) {
+ while (rpmfiNext(fi) >= 0) {
+ sourceDs->N[++sourceDs->i] = (tagno == RPMTAG_DIRNAMES ? rpmfiDN(fi) : rpmfiFN(fi));
+ }
+ }
+ } else {
+ char *ptr = evr;
+ if (rpmteE(p)) ptr = stpcpy(stpcpy(ptr, rpmteE(p)), ":");
+ ptr = stpcpy(stpcpy(stpcpy(ptr, rpmteV(p)), "-"), rpmteR(p));
+ if (rpmteD(p)) ptr = stpcpy(stpcpy(ptr, ":"), rpmteD(p));
+ sourceDs->N[++sourceDs->i] = rpmteN(p);
+ sourceDs->EVR[sourceDs->i] = evr++;
+ sourceDs->Flags[sourceDs->i] = RPMSENSE_EQUAL;
+ }
+ }
+
+ xx = rpmteClose(p, ts, 0);
+ pi = rpmtsiFree(pi);
+
+ if (sourceDs->i == -1)
+ return rc;
+
+ /* Fire elements against rpmdb trigger strings. */
+ for(sourceDs->i = 0; sourceDs->i < (int)sourceDs->Count; sourceDs->i++) {
+ const char * depName = sourceDs->N[sourceDs->i];
+ unsigned prev, instance;
+ unsigned nvals;
+ ARGint_t vals;
+
+
+ if (!depName || !*depName)
+ return rc;
+
+ if (_psm_debug)
+ rpmlog(RPMLOG_DEBUG, "--> %s:%d depName: %s tagno: %d ix: %d\n", __FUNCTION__, __LINE__, depName, tagno, sourceDs->i);
+
+ if (depName[0] == '/' && psm->Tmires != NULL) {
+ miRE mire;
+ int j;
+
+ /* XXX mireApply doesn't tell which pattern matched. */
+ for (j = 0, mire = psm->Tmires; j < psm->nTmires; j++, mire++) {
+ const char * pattern = psm->Tpats[j];
+ size_t npattern = strlen(pattern);
+ if (tagno == RPMTAG_DIRNAMES && !PATT_ISDIR(pattern, npattern))
+ continue;
+ if (mireRegexec(mire, depName, 0) < 0)
+ /*@innercontinue@*/ continue;
+
+ /* Reset the primary retrieval key to the pattern. */
+ depName = pattern;
+ /*@innerbreak@*/ break;
+ }
+ }
+
+ /* Retrieve triggered header(s) by key. */
+ mi = rpmtsInitIterator(ts, RPMTAG_TRIGGERNAME, depName, 0);
+ nvals = argiCount(instances);
+ vals = argiData(instances);
+ if (nvals > 0)
+ xx = rpmmiPrune(mi, (uint32_t *)vals, nvals, 1);
+
+ prev = 0;
+ while((triggeredH = rpmmiNext(mi)) != NULL) {
+ instance = rpmmiInstance(mi);
+ if (prev == instance)
+ /*@innercontinue@*/ continue;
+ rc |= handleOneScriptTrigger(psm, sourceDs, triggeredH, arg2);
+ prev = instance;
+ xx = argiAdd(&instances, -1, instance);
+ xx = argiSort(instances, NULL);
+ }
+ mi = rpmmiFree(mi);
+ }
+
+ instances = argiFree(instances);
+
+ return rc;
+}
+
+/**
+ * Run trigger scripts in the database that are fired by this header.
+ * @param psm package state machine data
+ * @return 0 on success
+ */
+static rpmRC runScriptTriggers(rpmpsm psm)
+ /*@globals rpmGlobalMacroContext, h_errno,
+ fileSystem, internalState @*/
+ /*@modifies psm, rpmGlobalMacroContext,
+ fileSystem, internalState @*/
+{
+ int numPackage = 0;
+ int xx;
+ rpmTag tagno;
+ rpmRC rc = RPMRC_OK;
+
+ /* Select RPMTAG_NAME or RPMTAG_PROVIDENAME index for triggering. */
+ if (_trigger_tag == 0) {
+ const char * t = rpmExpand("%{?_trigger_tag}", NULL);
+/*@-mods@*/
+ _trigger_tag = (!strcmp(t, "name") ? RPMTAG_NAME : RPMTAG_PROVIDENAME);
+/*@=mods@*/
+ t = _free(t);
+ }
+ tagno = _trigger_tag;
+
+ /* XXX Save/restore count correction. */
+ { int countCorrection = psm->countCorrection;
+
+ psm->countCorrection = 0;
+
+ /* Try name/providename triggers first. */
+ rc |= runScriptTriggersLoop(psm, tagno, numPackage);
+ /* If not limited to NEVRA triggers, also try file/dir path triggers. */
+ if (tagno != RPMTAG_NAME) {
+ /* Retrieve trigger patterns from rpmdb. */
+ xx = rpmdbTriggerGlobs(psm);
+
+ rc |= runScriptTriggersLoop(psm, RPMTAG_BASENAMES, numPackage);
+ rc |= runScriptTriggersLoop(psm, RPMTAG_DIRNAMES, numPackage);
+
+ psm->Tpats = argvFree(psm->Tpats);
+ psm->Tmires = mireFreeAll(psm->Tmires, psm->nTmires);
+ psm->nTmires = 0;
+ }
+
+ psm->countCorrection = countCorrection;
+ }
+
+ return rc;
+}
+
/*@observer@*/
static const char * pkgStageString(pkgStage a)
/*@*/
@@ -1776,6 +2121,8 @@ static const char * pkgStageString(pkgSt
case PSM_CHROOT_IN: return "chrootin";
case PSM_CHROOT_OUT: return "chrootout";
case PSM_SCRIPT: return "script";
+ case PSM_PRETRANS: return "pretrans";
+ case PSM_POSTTRANS: return "posttrans";
case PSM_TRIGGERS: return "triggers";
case PSM_IMMED_TRIGGERS: return "immedtriggers";
@@ -1816,8 +2163,20 @@ assert(psm != NULL);
case RPMTAG_VERIFYSCRIPT: psm->stepName = "verify"; break;
case RPMTAG_PRETRANS: psm->stepName = "pretrans"; break;
case RPMTAG_POSTTRANS: psm->stepName = "posttrans"; break;
+ case RPMTAG_TRIGGERPRETRANSIN: psm->stepName = "triggerpretransin"; break;
+ case RPMTAG_TRIGGERPRETRANSUN: psm->stepName = "triggerpretransun"; break;
+ case RPMTAG_TRIGGERPOSTTRANSIN: psm->stepName = "triggerposttransin"; break;
+ case RPMTAG_TRIGGERPOSTTRANSUN: psm->stepName = "triggerposttransun"; break;
+ }
+ switch (scriptTag) {
+ default: psm->stage = PSM_SCRIPT; break;
+ case RPMTAG_TRIGGERPRETRANSIN:
+ case RPMTAG_TRIGGERPRETRANSUN: psm->stage = PSM_PRETRANS; break;
+ case RPMTAG_TRIGGERPOSTTRANSIN:
+ case RPMTAG_TRIGGERPOSTTRANSUN: psm->stage = PSM_POSTTRANS; break;
}
- return rpmpsmStage(psm, PSM_SCRIPT);
+
+ return rpmpsmStage(psm, psm->stage);
}
/*@-mustmod@*/
@@ -2254,7 +2613,7 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage s
/* XXX hackery to assert(!scareMem) in rpmfiNew. */
/*@-castexpose@*/
-if (fi->h == NULL && fi->te && ((rpmte)fi->te)->h != NULL) fi->h = headerLink(((rpmte)fi->te)->h);
+if (fi != NULL && fi->h == NULL && fi->te && ((rpmte)fi->te)->h != NULL) fi->h = headerLink(((rpmte)fi->te)->h);
/*@=castexpose@*/
switch (stage) {
@@ -3041,6 +3400,34 @@ assert(psm->te != NULL);
if (rc)
xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn);
else
+ xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
+ rpmtsGetRdb(ts)->db_txn = NULL;
+ } break;
+ case PSM_PRETRANS:
+ { rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL);
+ xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
+ psm->scriptTag = RPMTAG_PRETRANS;
+ psm->progTag = RPMTAG_PRETRANSPROG;
+ psm->sense = psm->goal == PSM_PKGINSTALL ? (RPMSENSE_TRIGGERTRANS|RPMSENSE_TRIGGERPREIN) : (RPMSENSE_TRIGGERTRANS|RPMSENSE_TRIGGERUN);
+ psm->countCorrection = 0;
+ rc = runScriptTriggers(psm);
+ if (rc)
+ xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn);
+ else
+ xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
+ rpmtsGetRdb(ts)->db_txn = NULL;
+ } break;
+ case PSM_POSTTRANS:
+ { rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL);
+ xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
+ psm->scriptTag = RPMTAG_POSTTRANS;
+ psm->progTag = RPMTAG_POSTTRANSPROG;
+ psm->sense = psm->goal == PSM_PKGINSTALL ? (RPMSENSE_TRIGGERTRANS|RPMSENSE_TRIGGERIN) : (RPMSENSE_TRIGGERTRANS|RPMSENSE_TRIGGERPOSTUN);
+ psm->countCorrection = 0;
+ rc = runScriptTriggers(psm);
+ if (rc)
+ xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn);
+ else
xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
rpmtsGetRdb(ts)->db_txn = NULL;
} break;
--- rpm-5.4.15/lib/psm.h.trigtrans~ 2014-07-20 00:56:20.000000000 +0200
+++ rpm-5.4.15/lib/psm.h 2014-09-05 06:44:52.724095787 +0200
@@ -52,9 +52,11 @@ typedef enum pkgStage_e {
PSM_CHROOT_IN = 51,
PSM_CHROOT_OUT = 52,
PSM_SCRIPT = 53,
- PSM_TRIGGERS = 54,
- PSM_IMMED_TRIGGERS = 55,
- PSM_RPMIO_FLAGS = 56,
+ PSM_PRETRANS = 54,
+ PSM_POSTTRANS = 55,
+ PSM_TRIGGERS = 56,
+ PSM_IMMED_TRIGGERS = 57,
+ PSM_RPMIO_FLAGS = 58,
PSM_RPMDB_LOAD = 97,
PSM_RPMDB_ADD = 98,
--- rpm-5.4.15/lib/transaction.c.trigtrans~ 2014-09-05 06:44:52.620761425 +0200
+++ rpm-5.4.15/lib/transaction.c 2014-09-05 06:44:52.727429154 +0200
@@ -1349,6 +1349,41 @@ assert(0);
return 0;
}
+/*
+ * Run pre/post transaction script.
+ * param ts transaction set
+ * param stag RPMTAG_TRIGGERPRETRANS or RPMTAG_TRIGGERPOSTTRANS
+ * return 0 on success
+ */
+static int rpmtsRunScriptTriggers(rpmts ts, rpmTag stag)
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
+ /*@modifies ts, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
+{
+ rpmtsi pi;
+ rpmte p;
+ rpmfi fi;
+ rpmpsm psm;
+ int xx;
+ rpmTag ptag;
+
+FPSDEBUG(0, (stderr, "--> %s(%p,%s(%u))\n", __FUNCTION__, ts, tagName(stag), (unsigned)stag));
+ switch (stag) {
+ default:
+assert(0);
+ /*@notreached@*/ break;
+ case RPMTAG_TRIGGERPRETRANSIN:
+ case RPMTAG_TRIGGERPRETRANSUN: ptag = RPMTAG_PRETRANSPROG; break;
+ case RPMTAG_TRIGGERPOSTTRANSIN:
+ case RPMTAG_TRIGGERPOSTTRANSUN: ptag = RPMTAG_POSTTRANSPROG; break;
+ }
+
+ psm = rpmpsmNew(ts, NULL, NULL);
+ psm->goal = (stag == RPMTAG_TRIGGERPRETRANSIN || stag == RPMTAG_TRIGGERPOSTTRANSIN) ? PSM_PKGINSTALL : PSM_PKGERASE;
+ xx = rpmpsmScriptStage(psm, stag, ptag);
+ psm = rpmpsmFree(psm, __FUNCTION__);
+
+ return 0;
+}
/* Add fingerprint for each file not skipped. */
static void rpmtsAddFingerprints(rpmts ts, uint32_t fileCount, hashTable ht,
fingerPrintCache fpc)
@@ -2264,6 +2299,13 @@ fprintf(stderr, "--> %s(%p,%p,0x%x) tsfl
{
rpmlog(RPMLOG_DEBUG, D_("running pre-transaction scripts\n"));
xx = rpmtsRunScript(ts, RPMTAG_PRETRANS);
+
+ /* Run *after* pre-transaction scripts so that they may perform
+ * any changes affecting pre-transaction triggers first if necessary.
+ */
+ rpmlog(RPMLOG_DEBUG, D_("running pre-transaction triggers\n"));
+ xx = rpmtsRunScriptTriggers(ts, RPMTAG_TRIGGERPRETRANSIN);
+ xx = rpmtsRunScriptTriggers(ts, RPMTAG_TRIGGERPRETRANSUN);
}
/* ===============================================
@@ -2321,6 +2363,10 @@ fprintf(stderr, "--> %s(%p,%p,0x%x) tsfl
rpmlog(RPMLOG_DEBUG, D_("running post-transaction scripts\n"));
xx = rpmtsRunScript(ts, RPMTAG_POSTTRANS);
+
+ rpmlog(RPMLOG_DEBUG, D_("running post-transaction triggers\n"));
+ xx = rpmtsRunScriptTriggers(ts, RPMTAG_TRIGGERPOSTTRANSIN);
+ xx = rpmtsRunScriptTriggers(ts, RPMTAG_TRIGGERPOSTTRANSUN);
}
exit:
--- rpm-5.4.15/rpmconstant/rpmconstanttbl.c.trigtrans~ 2014-08-17 14:28:12.000000000 +0200
+++ rpm-5.4.15/rpmconstant/rpmconstanttbl.c 2014-09-05 06:44:52.727429154 +0200
@@ -670,6 +670,8 @@ static const struct rpmconstant_s rpmPar
{ "PART_BUILDARCHITECTURES", PART_BUILDARCHITECTURES }, /*!< */
{ "PART_TRIGGERPOSTUN", PART_TRIGGERPOSTUN }, /*!< */
{ "PART_TRIGGERPREIN", PART_TRIGGERPREIN }, /*!< */
+ { "PART_TRIGGERPOSTTRANSIN", PART_TRIGGERPOSTTRANSIN }, /*!< */
+ { "PART_TRIGGERPOSTTRANSUN", PART_TRIGGERPOSTTRANSUN }, /*!< */
{ "PART_SANITYCHECK", PART_SANITYCHECK }, /*!< */
{ "PART_ARBITRARY", PART_ARBITRARY }, /*!< */
{ "PART_LAST", PART_LAST }, /*!< */
@@ -686,7 +688,7 @@ const struct rpmconstant_s * rpmParseSta
static const struct rpmconstant_s rpmsenseflagsctbl[] = {
#ifdef H_RPMEVR
{ "RPMSENSE_ANY", RPMSENSE_ANY },
- { "RPMSENSE_SERIAL", RPMSENSE_SERIAL },
+ { "RPMSENSE_TRIGGERTRANS", RPMSENSE_TRIGGERTRANS },
{ "RPMSENSE_LESS", RPMSENSE_LESS },
{ "RPMSENSE_GREATER", RPMSENSE_GREATER },
{ "RPMSENSE_EQUAL", RPMSENSE_EQUAL },
@@ -1093,6 +1095,10 @@ static const struct rpmconstant_s rpmTag
{ "RPMTAG_OBSOLETEYAMLENTRY", RPMTAG_OBSOLETEYAMLENTRY }, /* s[] */
{ "RPMTAG_PROVIDEYAMLENTRY", RPMTAG_PROVIDEYAMLENTRY }, /* s[] */
{ "RPMTAG_REQUIREYAMLENTRY", RPMTAG_REQUIREYAMLENTRY }, /* s[] */
+ { "RPMTAG_TRIGGERPRETRANSIN", RPMTAG_TRIGGERPRETRANSIN }, /* internal */
+ { "RPMTAG_TRIGGERPRETRANSUN", RPMTAG_TRIGGERPRETRANSUN }, /* internal */
+ { "RPMTAG_TRIGGERPOSTTRANSIN", RPMTAG_TRIGGERPOSTTRANSIN }, /* internal */
+ { "RPMTAG_TRIGGERPOSTTRANSUN", RPMTAG_TRIGGERPOSTTRANSUN }, /* internal */
{ "RPMTAG_FILEDIGESTALGO", RPMTAG_FILEDIGESTALGO }, /* i file checksum algorithm */
{ "RPMTAG_BUGURL", RPMTAG_BUGURL }, /* s */
{ "RPMTAG_FIRSTFREE_TAG", RPMTAG_FIRSTFREE_TAG }, /*!< internal */
@@ -1173,6 +1179,10 @@ static const struct rpmconstant_s rpmScr
{ "RPMSCRIPT_PREUN", RPMSCRIPT_PREUN }, /*!< %preun scriptlet */
{ "RPMSCRIPT_POSTUN", RPMSCRIPT_POSTUN }, /*!< %postun scriptlet */
{ "RPMSCRIPT_POSTTRANS", RPMSCRIPT_POSTTRANS }, /*!< %posttrans scriptlet */
+ { "RPMSCRIPT_TRIGGERPRETRANSIN", RPMSCRIPT_TRIGGERPRETRANSIN }, /*!< %triggerpretransin scriptlet */
+ { "RPMSCRIPT_TRIGGERPRETRANSUN", RPMSCRIPT_TRIGGERPRETRANSUN }, /*!< %triggerpretransun scriptlet */
+ { "RPMSCRIPT_TRIGGERPOSTTRANSIN", RPMSCRIPT_TRIGGERPOSTTRANSIN }, /*!< %triggerposttransin scriptlet */
+ { "RPMSCRIPT_TRIGGERPOSTTRANSUN", RPMSCRIPT_TRIGGERPOSTTRANSUN }, /*!< %triggerposttransun scriptlet */
{ "RPMSCRIPT_VERIFY", RPMSCRIPT_VERIFY }, /*!< %verify scriptlet */
{ "RPMSCRIPT_PREP", RPMSCRIPT_PREP }, /*!< %prep build scriptlet */
{ "RPMSCRIPT_BUILD", RPMSCRIPT_BUILD }, /*!< %build build scriptlet */
--- rpm-5.4.15/rpmdb/hdrfmt.c.trigtrans~ 2014-09-05 06:44:52.690762122 +0200
+++ rpm-5.4.15/rpmdb/hdrfmt.c 2014-09-05 06:44:52.727429154 +0200
@@ -663,16 +663,29 @@ assert(ix == 0);
val = xstrdup(_("(invalid type)"));
else {
rpmuint64_t anint = he->p.ui64p[ix];
- if (anint & RPMSENSE_TRIGGERPREIN)
- val = xstrdup("prein");
- else if (anint & RPMSENSE_TRIGGERIN)
- val = xstrdup("in");
- else if (anint & RPMSENSE_TRIGGERUN)
- val = xstrdup("un");
- else if (anint & RPMSENSE_TRIGGERPOSTUN)
- val = xstrdup("postun");
- else
- val = xstrdup("");
+ if (anint & RPMSENSE_TRIGGERTRANS) {
+ if (anint & RPMSENSE_TRIGGERPREIN)
+ val = xstrdup("pretransin");
+ else if (anint & RPMSENSE_TRIGGERIN)
+ val = xstrdup("posttransin");
+ else if (anint & RPMSENSE_TRIGGERUN)
+ val = xstrdup("pretransun");
+ else if (anint & RPMSENSE_TRIGGERPOSTUN)
+ val = xstrdup("posttransun");
+ else /* shouldn't be reached... */
+ val = xstrdup("");
+ } else {
+ if (anint & RPMSENSE_TRIGGERPREIN)
+ val = xstrdup("prein");
+ else if (anint & RPMSENSE_TRIGGERIN)
+ val = xstrdup("in");
+ else if (anint & RPMSENSE_TRIGGERUN)
+ val = xstrdup("un");
+ else if (anint & RPMSENSE_TRIGGERPOSTUN)
+ val = xstrdup("postun");
+ else
+ val = xstrdup("");
+ }
}
return val;
}
@@ -2114,16 +2127,29 @@ static int triggertypeTag(Header h, HE_t
}
/* XXX FIXME: there's memory leaks here. */
- if (flags.ui32p[j] & RPMSENSE_TRIGGERPREIN)
- he->p.argv[i] = xstrdup("prein");
- else if (flags.ui32p[j] & RPMSENSE_TRIGGERIN)
- he->p.argv[i] = xstrdup("in");
- else if (flags.ui32p[j] & RPMSENSE_TRIGGERUN)
- he->p.argv[i] = xstrdup("un");
- else if (flags.ui32p[j] & RPMSENSE_TRIGGERPOSTUN)
- he->p.argv[i] = xstrdup("postun");
- else
- he->p.argv[i] = xstrdup("");
+ if (flags.ui32p[j] & RPMSENSE_TRIGGERTRANS) {
+ if (flags.ui32p[j] & RPMSENSE_TRIGGERPREIN)
+ he->p.argv[i] = xstrdup("pretransin");
+ else if (flags.ui32p[j] & RPMSENSE_TRIGGERIN)
+ he->p.argv[i] = xstrdup("posttransin");
+ else if (flags.ui32p[j] & RPMSENSE_TRIGGERUN)
+ he->p.argv[i] = xstrdup("pretransun");
+ else if (flags.ui32p[j] & RPMSENSE_TRIGGERPOSTUN)
+ he->p.argv[i] = xstrdup("posttransun");
+ else /* shouldn't be reached... */
+ he->p.argv[i] = xstrdup("");
+ } else {
+ if (flags.ui32p[j] & RPMSENSE_TRIGGERPREIN)
+ he->p.argv[i] = xstrdup("prein");
+ else if (flags.ui32p[j] & RPMSENSE_TRIGGERIN)
+ he->p.argv[i] = xstrdup("in");
+ else if (flags.ui32p[j] & RPMSENSE_TRIGGERUN)
+ he->p.argv[i] = xstrdup("un");
+ else if (flags.ui32p[j] & RPMSENSE_TRIGGERPOSTUN)
+ he->p.argv[i] = xstrdup("postun");
+ else
+ he->p.argv[i] = xstrdup("");
+ }
/*@innerbreak@*/ break;
}
}
--- rpm-5.4.15/rpmdb/rpmevr.h.trigtrans~ 2014-07-20 01:15:45.000000000 +0200
+++ rpm-5.4.15/rpmdb/rpmevr.h 2014-09-05 06:44:52.727429154 +0200
@@ -27,7 +27,7 @@ typedef enum evrFlags_e {
#if defined(_RPMEVR_INTERNAL)
RPMSENSE_ANY = 0,
/*@-enummemuse@*/
- RPMSENSE_SERIAL = (1 << 0), /*!< (obsolete). */
+ RPMSENSE_TRIGGERTRANS = (1 << 0), /*!< modifies %triggerfoo to %triggerfootrans. */
/*@=enummemuse@*/
#endif
RPMSENSE_LESS = (1 << 1),
@@ -96,7 +96,7 @@ struct EVR_s {
};
#define RPMSENSE_TRIGGER \
- (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
+ (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN | RPMSENSE_TRIGGERTRANS)
#define _ALL_REQUIRES_MASK (\
RPMSENSE_INTERP | \
--- rpm-5.4.15/rpmdb/rpmtag.h.trigtrans~ 2014-07-20 00:01:02.000000000 +0200
+++ rpm-5.4.15/rpmdb/rpmtag.h 2014-09-05 06:44:52.727429154 +0200
@@ -416,6 +416,10 @@ enum rpmTag_e {
RPMTAG_OBSOLETEYAMLENTRY = 1220, /* s[] */
RPMTAG_PROVIDEYAMLENTRY = 1221, /* s[] */
RPMTAG_REQUIREYAMLENTRY = 1222, /* s[] */
+ RPMTAG_TRIGGERPRETRANSIN = 1223, /* internal */
+ RPMTAG_TRIGGERPRETRANSUN = 1224, /* internal */
+ RPMTAG_TRIGGERPOSTTRANSIN = 1225, /* internal */
+ RPMTAG_TRIGGERPOSTTRANSUN = 1226, /* internal */
RPMTAG_FILEDIGESTALGO = 5011, /* i file checksum algorithm */
RPMTAG_BUGURL = 5012, /* s */
--- rpm-5.4.15/rpmdb/rpmtypes.h.trigtrans~ 2011-05-03 17:58:19.000000000 +0200
+++ rpm-5.4.15/rpmdb/rpmtypes.h 2014-09-05 06:44:52.727429154 +0200
@@ -70,7 +70,11 @@ typedef enum rpmScriptID_e {
RPMSCRIPT_POSTUN = 7, /*!< %postun scriptlet */
RPMSCRIPT_TRIGGERPOSTUN = 8, /*!< %triggerpostun scriptlet */
RPMSCRIPT_POSTTRANS = 9, /*!< %posttrans scriptlet */
- /* 10-15 unused */
+ RPMSCRIPT_TRIGGERPRETRANSIN = 10, /*!< %triggerpretrans scriptlet */
+ RPMSCRIPT_TRIGGERPRETRANSUN = 11, /*!< %triggerpretrans scriptlet */
+ RPMSCRIPT_TRIGGERPOSTTRANSIN= 12, /*!< %triggerposttrans scriptlet */
+ RPMSCRIPT_TRIGGERPOSTTRANSUN= 13, /*!< %triggerposttrans scriptlet */
+ /* 14-15 unused */
RPMSCRIPT_VERIFY = 16, /*!< %verify scriptlet */
RPMSCRIPT_SANITYCHECK = 17, /*!< %sanitycheck scriptlet */
/* 18-23 unused */

View file

@ -1,76 +0,0 @@
diff -pNaur rpm-rosa.orig/lib/psm.c rpm-rosa/lib/psm.c
--- rpm-rosa.orig/lib/psm.c 2017-12-06 16:44:00.000000000 +1000
+++ rpm-rosa/lib/psm.c 2017-12-06 19:17:32.499534079 +1000
@@ -1904,7 +1904,8 @@ static rpmRC runScriptTriggersLoop(rpmps
rpmfi fi = NULL;
rpmds sourceDs = memset(alloca(sizeof(*sourceDs)), 0, sizeof(*sourceDs));
char * depName = NULL;
- char * evr;
+ char * evr = NULL;
+ char * evr_allocated = NULL;
char * ptr = NULL;
ARGI_t instances = NULL;
rpmmi mi;
@@ -1920,15 +1921,26 @@ static rpmRC runScriptTriggersLoop(rpmps
else
n = ts->orderCount;
- evr = memset(alloca(n * 64 * sizeof(*evr)), 0, n * 64 * sizeof(*evr));
- ptr = evr;
sourceDs->tagN = tagno;
sourceDs->Type = tagName(tagno);
sourceDs->Count = n;
sourceDs->i = -1;
- sourceDs->N = memset(alloca(n * sizeof(*sourceDs->N)), 0, n * sizeof(*sourceDs->N));
- sourceDs->EVR = memset(alloca(n * sizeof(*sourceDs->EVR)), 0, n * sizeof(*sourceDs->EVR));
- sourceDs->Flags = (evrFlags *) memset(alloca(n * sizeof(*sourceDs->Flags)), 0, n * sizeof(*sourceDs->Flags));
+
+ /* Avoid stack allocation as it overflows */
+ rc = RPMRC_FAIL;
+ ptr = evr = evr_allocated = calloc(n * 64, sizeof(*evr));
+ if (!evr_allocated)
+ goto exit_free;
+ sourceDs->N = calloc(n, sizeof(*sourceDs->N));
+ if (!sourceDs->N)
+ goto exit_free;
+ sourceDs->EVR = calloc(n, sizeof(*sourceDs->EVR));
+ if (!sourceDs->EVR)
+ goto exit_free;
+ sourceDs->Flags = calloc(n, sizeof(*sourceDs->Flags));
+ if (!sourceDs->Flags)
+ goto exit_free;
+ rc = RPMRC_OK;
pi = rpmtsiInit(ts);
while ((p = rpmtsiNext(pi, psm->goal == PSM_PKGINSTALL ? TR_ADDED : TR_REMOVED)) != NULL) {
@@ -1957,7 +1969,7 @@ static rpmRC runScriptTriggersLoop(rpmps
pi = rpmtsiFree(pi);
if (sourceDs->i == -1)
- return rc;
+ goto exit_free;
/* Fire elements against rpmdb trigger strings. */
for(sourceDs->i = 0; sourceDs->i < (int)sourceDs->Count; sourceDs->i++) {
@@ -1968,7 +1980,7 @@ static rpmRC runScriptTriggersLoop(rpmps
if (!depName || !*depName)
- return rc;
+ goto exit_free;
if (_psm_debug)
rpmlog(RPMLOG_DEBUG, "--> %s:%d depName: %s tagno: %d ix: %d\n", __FUNCTION__, __LINE__, depName, tagno, sourceDs->i);
@@ -2014,6 +2026,12 @@ static rpmRC runScriptTriggersLoop(rpmps
instances = argiFree(instances);
+exit_free:
+ free(sourceDs->Flags);
+ free(sourceDs->EVR);
+ free(sourceDs->N);
+ free(evr_allocated);
+
return rc;
}

View file

@ -1,70 +0,0 @@
diff -Naur rpm-5.4.10.orig/macros/mandriva rpm-5.4.10/macros/mandriva
--- rpm-5.4.10.orig/macros/mandriva 2013-09-17 17:34:34.805808860 +0400
+++ rpm-5.4.10/macros/mandriva 2013-10-03 17:06:36.947155301 +0400
@@ -32,6 +32,8 @@
# mdvbz#64914
%_rpmgio .ufdio
+%__urlgetfile(url, dest) (test -f `basename %1` && mkdir -p `dirname %2` && cp `basename %1` %2) || (wget %1 -O %2 || (rm -f %2 && exit 1))
+
# This will die as soon as remaining usage has been phased out...
%mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel}
%manbo_mkrel() %mkrel
diff -Naur rpm-5.4.10.orig/macros/mandriva.in rpm-5.4.10/macros/mandriva.in
--- rpm-5.4.10.orig/macros/mandriva.in 2013-09-17 17:34:34.805808860 +0400
+++ rpm-5.4.10/macros/mandriva.in 2013-10-03 17:33:15.669303875 +0400
@@ -32,6 +32,8 @@
# mdvbz#64914
%_rpmgio .ufdio
+%__urlgetfile(url, dest) (test -f `basename %1` && cp `basename %1` %2) || (wget %1 -O %2 || (rm -f %2 && exit 1))
+
# This will die as soon as remaining usage has been phased out...
%mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel}
%manbo_mkrel() %mkrel
diff -Naur rpm-5.4.10.orig/rpmio/url.c rpm-5.4.10/rpmio/url.c
--- rpm-5.4.10.orig/rpmio/url.c 2013-09-17 17:34:34.827808860 +0400
+++ rpm-5.4.10/rpmio/url.c 2013-10-03 17:49:34.590394849 +0400
@@ -446,6 +447,7 @@
/*@-observertrans@*/
if (pathp)
*pathp = path;
+
/*@=observertrans@*/
return ut;
}
@@ -602,6 +604,7 @@
const char * sfuPath = NULL;
int urlType = urlPath(url, &sfuPath);
char *result;
+ char *cmd;
if (*sfuPath == '\0')
return FTPERR_UNKNOWN;
@@ -616,17 +619,17 @@
return FTPERR_UNKNOWN;
/*@-globs -mods@*/ /* Avoid including <rpmmacro.h> everywhere for now */
- if (rpmExpandNumeric("%{?__urlgetfile:1}%{!?__urlgetfile:0}")) {
- result = rpmExpand("%{__urlgetfile ", url, " ", dest, "}", NULL);
- if (result != NULL && strcmp(result, "OK") == 0)
- rc = 0;
- else {
- rpmlog(RPMLOG_DEBUG, D_("failed to fetch URL %s via external command\n"), url);
- rc = FTPERR_UNKNOWN;
+ cmd = rpmExpand("%{?__urlgetfile:%{__urlgetfile ", url, " ", dest, "}}", NULL);
+ if (cmd != NULL && cmd[0] != '\0') {
+ rc = system(cmd);
+ if ((rc >> 8) != 0) {
+ rpmlog(RPMLOG_DEBUG, D_("failed to fetch URL %s via external command: %s: %s\n"), url, Fstrerror(sfd));
+ rc = FTPERR_UNKNOWN;
}
- result = _free(result);
- goto exit;
+ cmd = _free(cmd);
+ goto exit;
}
+
/*@=globs =mods@*/
sfd = Fopen(url, "r.ufdio");

View file

@ -1,67 +0,0 @@
--- rpm-5.4.10/build/files.c.subdir_terminate~ 2012-07-10 20:14:36.357058212 +0200
+++ rpm-5.4.10/build/files.c 2012-07-10 20:14:36.367058087 +0200
@@ -3025,7 +3025,7 @@ static inline int packagedDir(Package pk
* /A/B/C/D
* Now directories "/A/B" and "/A/B/C" should also be packaged.
*/
-static int pkgUnpackagedSubdirs(Package pkg, size_t buildrootL)
+static int pkgUnpackagedSubdirs(Package pkg, size_t buildrootL, int _unpackaged_subdirs_terminate_build)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies pkg->header,
rpmGlobalMacroContext, fileSystem, internalState @*/
@@ -3103,7 +3103,7 @@ static int pkgUnpackagedSubdirs(Package
}
unpackaged = _free(unpackaged);
- rpmlog(RPMLOG_WARNING,
+ rpmlog(_unpackaged_subdirs_terminate_build ? RPMLOG_ERR : RPMLOG_WARNING,
_("Unpackaged subdir(s) in %s:\n%s"),
N, rpmiobStr(list));
@@ -3119,7 +3119,7 @@ static int pkgUnpackagedSubdirs(Package
* @param spec spec file control structure
* @return number of unpackaged subdirectories
*/
-static int checkUnpackagedSubdirs(Spec spec, size_t buildrootL)
+static int checkUnpackagedSubdirs(Spec spec, size_t buildrootL, int _unpackaged_subdirs_terminate_build)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies *spec->packages,
rpmGlobalMacroContext, fileSystem, internalState @*/
@@ -3128,7 +3128,7 @@ static int checkUnpackagedSubdirs(Spec s
Package pkg;
for (pkg = spec->packages; pkg; pkg = pkg->next)
- n += pkgUnpackagedSubdirs(pkg, buildrootL);
+ n += pkgUnpackagedSubdirs(pkg, buildrootL, _unpackaged_subdirs_terminate_build);
return n;
}
@@ -3185,12 +3185,16 @@ rpmRC processBinaryFiles(Spec spec, int
if (res == RPMRC_OK) {
int _duplicate_files_terminate_build =
rpmExpandNumeric("%{?_duplicate_files_terminate_build}");
+ int _unpackaged_subdirs_terminate_build =
+ rpmExpandNumeric("%{?_unpackaged_subdirs_terminate_build}");
if (checkUnpackagedFiles(spec) > 0)
res = RPMRC_FAIL;
if (checkDuplicateFiles(spec, buildrootL, _duplicate_files_terminate_build) > 0 &&
_duplicate_files_terminate_build)
res = RPMRC_FAIL;
- (void) checkUnpackagedSubdirs(spec, buildrootL);
+ if (checkUnpackagedSubdirs(spec, buildrootL, _unpackaged_subdirs_terminate_build) > 0 &&
+ _unpackaged_subdirs_terminate_build)
+ res = RPMRC_FAIL;
}
return res;
--- rpm-5.4.10/macros/mandriva.in.subdir_terminate~ 2012-07-10 20:14:36.000000000 +0200
+++ rpm-5.4.10/macros/mandriva.in 2012-07-10 20:14:57.333795967 +0200
@@ -127,7 +127,7 @@ end\
%_binary_payload w5.xzdio
%_duplicate_files_terminate_build 1
-
+%_unpackaged_subdirs_terminate_build 0
%_build_pkgcheck_set /usr/bin/rpmlint -T -f %{_sourcedir}/%{name}.rpmlintrc
%_build_pkgcheck_srpm /usr/bin/rpmlint -T -f %{_sourcedir}/%{name}.rpmlintrc

View file

@ -1,59 +0,0 @@
--- rpm-5.4.10/macros/mandriva.in.brpcomp~ 2012-12-26 08:56:29.522684255 +0100
+++ rpm-5.4.10/macros/mandriva.in 2012-12-26 09:37:59.322548015 +0100
@@ -137,8 +137,9 @@ end\
%_enable_debug_packages 1
-# Default extension to use (for info files)
+# Default extension to use (for man & info files)
%_extension .xz
+%_compress xz -0f --text
# Macro: %{mklibname <name> [<major> [<minor>]] [-s] [-d]}
--- rpm-5.4.10/scripts/brp-compress.brpcomp~ 2012-12-26 08:55:38.248052991 +0100
+++ rpm-5.4.10/scripts/brp-compress 2012-12-26 09:38:15.914753103 +0100
@@ -8,8 +8,8 @@ fi
cd "$RPM_BUILD_ROOT"
# Compress man pages
-COMPRESS="gzip -9 -n"
-COMPRESS_EXT=.gz
+COMPRESS=${COMPRESS:-gzip -9 -n}
+COMPRESS_EXT=${COMPRESS_EXT:-.gz}
for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
@@ -17,15 +17,14 @@ for d in ./usr/man/man* ./usr/man/*/man*
./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
do
[ -d $d ] || continue
- for f in `find $d -type f`
+ for f in `find $d -type f ! -name dir`
do
[ -f "$f" ] || continue
- [ "`basename $f`" = "dir" ] && continue
case "$f" in
- *.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.Z$//'`;;
- *.gz) gunzip -f $f; b=`echo $f | sed -e 's/\.gz$//'`;;
- *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
+ *.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;;
esac
@@ -48,9 +47,10 @@ do
for f in `find $d -type l`
do
- l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
+ l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
+ echo $l
rm -f $f
- b=`echo $f | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
+ b=`echo $f | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT
done
done

View file

@ -1,11 +0,0 @@
--- rpm-5.4.14/scripts/rubygems.rb.no_ruby_version~ 2014-03-16 11:47:35.797098586 +0100
+++ rpm-5.4.14/scripts/rubygems.rb 2014-03-16 11:42:57.758190869 +0100
@@ -68,7 +68,7 @@ end
if requires or abi_provide
abidep = "ruby(abi)"
- if ruby_versioned
+ if ruby_versioned and RbConfig::CONFIG["ruby_version"] != ""
abidep += " = %s" % RbConfig::CONFIG["ruby_version"]
end
print abidep + "\n"

View file

@ -1,33 +0,0 @@
--- rpm-5.4.14/scripts/gem_helper.rb.gem_spec~ 2014-03-16 06:14:50.213542916 +0100
+++ rpm-5.4.14/scripts/gem_helper.rb 2014-03-16 08:22:46.196241762 +0100
@@ -6,8 +6,9 @@
#++
require 'optparse'
+require 'rubygems'
-if ARGV[0] == "build" or ARGV[0] == "install"
+if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
require 'yaml'
require 'zlib'
@@ -65,9 +66,18 @@ if ARGV[0] == "build" or ARGV[0] == "ins
body[iv.to_s.gsub(/^@/,'')] = header.instance_variable_get(iv)
end
- require 'rubygems'
spec = Gem::Specification.from_yaml(YAML.dump(header))
+ if ARGV[0] == "spec"
+ # Write the .gemspec specification (in Ruby)
+ file_name = spec.full_name.untaint + '.gemspec'
+ File.open(file_name, "w") do |file|
+ file.puts spec.to_ruby_for_cache
+ end
+ print "Wrote: %s\n" % file_name
+ exit(0)
+ end
+
if ARGV[0] == "install"
system("gem %s %s.gem" % [ARGV.join(' '), spec.full_name])
if !keepcache

View file

@ -1,10 +0,0 @@
--- rpm-5.4.14/scripts/rubygems.rb.rubyabiver~ 2014-03-16 08:07:27.652980213 +0100
+++ rpm-5.4.14/scripts/rubygems.rb 2014-03-16 08:19:23.104361204 +0100
@@ -41,6 +41,7 @@ for path in $stdin.readlines
# therefore provide ruby(abi) = version
if provides and path.match(RbConfig::CONFIG["archdir"] + "/rbconfig.rb")
abi_provide = true
+ ruby_versioned = true
elsif path.match(specpatt)
ruby_versioned = true
gems.push(path.chomp)

View file

@ -1,19 +0,0 @@
--- rpm-5.4.14/scripts/rubygems.rb.rubyarchdirs~ 2014-03-16 06:14:50.373536514 +0100
+++ rpm-5.4.14/scripts/rubygems.rb 2014-03-16 08:07:27.652980213 +0100
@@ -51,10 +51,16 @@ for path in $stdin.readlines
elsif not ruby_versioned
if path.match(RbConfig::CONFIG["rubylibdir"])
ruby_versioned = true
+ elsif path.match(RbConfig::CONFIG["archdir"])
+ ruby_versioned = true
elsif path.match(RbConfig::CONFIG["sitelibdir"])
ruby_versioned = true
+ elsif path.match(RbConfig::CONFIG["sitearchdir"])
+ ruby_versioned = true
elsif path.match(RbConfig::CONFIG["vendorlibdir"])
ruby_versioned = true
+ elsif path.match(RbConfig::CONFIG["vendorarchdir"])
+ ruby_versioned = true
end
end
end

View file

@ -1,19 +0,0 @@
--- rpm-5.4.14/scripts/gem_helper.rb.rubygems2~ 2014-03-16 11:17:38.008717554 +0100
+++ rpm-5.4.14/scripts/gem_helper.rb 2014-03-16 11:17:26.239185656 +0100
@@ -7,6 +7,7 @@
require 'optparse'
require 'rubygems'
+require 'rubygems/package'
if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
require 'yaml'
@@ -177,7 +178,7 @@ if ARGV[0] == "build" or ARGV[0] == "ins
spec = Gem::Specification.from_yaml(YAML.dump(header))
unless dry_run
- Gem::Builder.new(spec).build
+ Gem::Package.build(spec)
else
files.concat(spec.files)
print "%s\n" % files.join("\n")

View file

@ -1,40 +0,0 @@
diff -urN rpm-5.4.10/scripts/gem_helper.rb rpm-5.4.10-patched/scripts/gem_helper.rb
--- rpm-5.4.10/scripts/gem_helper.rb 2014-08-13 03:32:31.448925946 +1100
+++ rpm-5.4.10-patched/scripts/gem_helper.rb 2014-08-13 03:35:00.000000000 +1100
@@ -97,21 +97,20 @@
require 'rubygems/ext'
module Gem::Ext
class Builder
- def self.make(dest_path, results)
+ def build_extensions
make_program = ENV['make']
unless make_program then
make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
end
cmd = make_program
if ENV['GEM_MODE'] == "build"
- cmd += " %s" % ENV['jobs']
+ cmd += " %s" % ENV['jobs']
+ system("ruby %s" % @spec.extensions)
elsif ENV['GEM_MODE'] == "install"
cmd += " DESTDIR='%s' install" % ENV['DESTDIR']
end
- results << cmd
- results << `#{cmd} #{redirector}`
-
- raise Gem::ExtensionBuildError, "make failed:\n\n#{results}" unless
+ system(cmd)
+ raise Gem::ExtensionBuildError, "Make failed!\n" unless
$?.success?
end
end
@@ -123,6 +122,9 @@
def initialize(spec, options={})
@gem_dir = Dir.pwd
@spec = spec
+ @options = options
+
+ process_options
end
end
class ConfigFile

View file

@ -1,10 +0,0 @@
--- rpm-5.4.4/build/parseSpec.c.specfile~ 2011-11-11 13:41:29.137827186 +0100
+++ rpm-5.4.4/build/parseSpec.c 2011-11-11 13:42:12.938874762 +0100
@@ -542,6 +542,7 @@ int parseSpec(rpmts ts, const char *spec
* /.././../usr/../bin//./sh (XXX FIXME: dots not handled yet)
*/
spec->specFile = rpmGetPath(specFile, NULL);
+ addMacro(spec->macros, "_specfile", NULL, spec->specFile, RMIL_SPEC);
spec->fileStack = newOpenFileInfo();
spec->fileStack->fileName = xstrdup(spec->specFile);

View file

@ -1,11 +0,0 @@
--- rpm-5.4.4/rpmdb/rpmdb.c.repackage~ 2011-11-24 16:28:22.436460713 +0100
+++ rpm-5.4.4/rpmdb/rpmdb.c 2011-11-24 16:28:30.107464575 +0100
@@ -2758,7 +2758,7 @@ int rpmdbAdd(rpmdb db, int iid, Header h
if (_rpmdb_debug)
fprintf(stderr, "--> %s(%p, %u, %p, %p) h# %u\n", __FUNCTION__, db, (unsigned)iid, h, ts, (unsigned)hdrNum);
-assert(headerIsEntry(h, RPMTAG_REMOVETID) == 0); /* XXX sanity */
+//assert(headerIsEntry(h, RPMTAG_REMOVETID) == 0); /* XXX sanity */
/* Add the install transaction id. */
if (iid != 0 && iid != -1) {

View file

@ -1,16 +0,0 @@
--- rpm-5.4.4/build/reqprov.c.range_nooverlap~ 2012-02-15 18:58:39.075973279 +0100
+++ rpm-5.4.4/build/reqprov.c 2012-02-15 19:02:01.120218409 +0100
@@ -122,7 +122,12 @@ int addReqProv(/*@unused@*/ Spec spec, H
rpmds old = rpmdsSingle(flagtag, names[len], versions[len] ? versions[len] : "", flags[len]);
rpmds new = rpmdsSingle(flagtag, N, EVR, Flags);
- overlap = rpmdsCompare(new, old);
+ /* do not consider dependency ranges like R: foo > 1, R: foo < 3
+ * as overlapping (mdvbz#65269)
+ */
+ if (!((Flags & RPMSENSE_GREATER && flags[len] & RPMSENSE_LESS) ||
+ (Flags & RPMSENSE_LESS && flags[len] & RPMSENSE_GREATER)))
+ overlap = rpmdsCompare(new, old);
if (overlap) {
EVR_t lEVR = rpmEVRnew(RPMSENSE_ANY, 0),

View file

@ -1,16 +0,0 @@
--- rpm-5.4.4/build/reqprov.c.drop_basedeps~ 2011-12-11 03:55:58.958164657 +0100
+++ rpm-5.4.4/build/reqprov.c 2019-03-11 10:48:00.794169328 +0300
@@ -48,6 +48,13 @@ int addReqProv(/*@unused@*/ Spec spec, H
indextag = RPMTAG_TRIGGERINDEX;
extra = Flags & RPMSENSE_TRIGGER;
} else {
+#if defined(RPM_VENDOR_MANDRIVA)
+ //if (!strcmp(N, "/bin/sh") || !strcmp(N, "/sbin/ldconfig")) {
+ if (!strcmp(N, "/sbin/ldconfig")) {
+ rpmlog(RPMLOG_DEBUG, "%s will be satisfied by glibc or it's dependencies, won't add dependency to package\n", N);
+ return 0;
+ }
+#endif
nametag = RPMTAG_REQUIRENAME;
versiontag = RPMTAG_REQUIREVERSION;
flagtag = RPMTAG_REQUIREFLAGS;

View file

@ -1,23 +0,0 @@
--- rpm-5.4.4/scripts/pkgconfigdeps.sh.oneshot~ 2011-12-11 01:40:12.599487103 +0100
+++ rpm-5.4.4/scripts/pkgconfigdeps.sh 2011-12-11 01:40:14.418488230 +0100
@@ -37,12 +37,10 @@ case $1 in
done
;;
-R|--requires)
- oneshot="pkgconfig"
while read filename ; do
case "${filename}" in
*.pc)
if [[ "$(dirname ${filename})" =~ pkgconfig ]]; then
- [ -n "$oneshot" ] && echo "$oneshot"; oneshot=""
# Query the dependencies of the package.
DIR=`dirname ${filename}`
PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
@@ -54,7 +52,6 @@ case $1 in
else
echo "pkgconfig($n)"
fi
- oneshot=""
done
fi
;;

View file

@ -1,11 +0,0 @@
--- rpm-5.4.4/scripts/find-debuginfo.sh.strip_silent~ 2011-12-06 08:32:19.205381136 +0100
+++ rpm-5.4.4/scripts/find-debuginfo.sh 2011-12-06 08:33:02.954406789 +0100
@@ -103,7 +103,7 @@ strip_to_debug()
esac
[ -n "$EXCLUDE_FULL_REGEXP" ] && grep -E -q "$EXCLUDE_FULL_REGEXP" <<< "$2" && g=-g
- eu-strip --remove-comment $g $([ -n "$DISABLE_DEBUG" ] || echo $r -f "$1") "$2" || exit
+ eu-strip --remove-comment $g $([ -n "$DISABLE_DEBUG" ] || echo $r -f "$1") "$2" 1> /dev/null || exit
[ -n "$DISABLE_DEBUG" ] || chmod 444 "$1" || exit
}

View file

@ -1,95 +0,0 @@
--- rpm-5.4.4/build/reqprov.c.overlap~ 2011-04-01 12:39:50.000000000 +0200
+++ rpm-5.4.4/build/reqprov.c 2011-11-26 02:21:00.125251492 +0100
@@ -9,6 +9,8 @@
#include <rpmiotypes.h>
#define _RPMEVR_INTERNAL
#include "rpmbuild.h"
+#include <rpmds.h>
+#include <rpmlog.h>
#include "debug.h"
int addReqProv(/*@unused@*/ Spec spec, Header h,
@@ -110,37 +112,61 @@ int addReqProv(/*@unused@*/ Spec spec, H
* TODO: auto-generated deps too
*/
if (flagtag && versions != NULL) {
- int overlap;
+ int overlap = 0, res = 0;
+ rpmds old = rpmdsSingle(flagtag, names[len], versions[len] ? versions[len] : "", flags[len]);
+ rpmds new = rpmdsSingle(flagtag, N, EVR, Flags);
- if(*EVR && !*versions[len]) {
- overlap = 1;
- flags[len] = Flags;
- he->tag = flagtag;
- he->t = RPM_UINT32_TYPE;
- he->p.argv = (void *) &Flags;
- xx = headerMod(h, he, 0);
- } else {
+ overlap = rpmdsCompare(new, old);
+
+ if (overlap) {
EVR_t lEVR = rpmEVRnew(RPMSENSE_ANY, 0),
rEVR = rpmEVRnew(RPMSENSE_ANY, 0);
+ rpmuint32_t newflags;
+ /* if we have both a requires and suggests, we turn it into a requires */
+ if (!(Flags & RPMSENSE_MISSINGOK) || !(flags[len] & RPMSENSE_MISSINGOK)) {
+ flags[len] &= ~RPMSENSE_MISSINGOK;
+ Flags &= ~RPMSENSE_MISSINGOK;
+ }
+
+ /* merge all flags about dependency type */
+ newflags = ((flags[len]| Flags) & _ALL_REQUIRES_MASK);
rpmEVRparse(EVR, lEVR);
rpmEVRparse(versions[len], rEVR);
- lEVR->Flags = Flags | RPMSENSE_EQUAL;
- rEVR->Flags = flags[len] | RPMSENSE_EQUAL;
- overlap = rpmEVRoverlap(lEVR, rEVR);
- if (!overlap)
- if (rpmEVRoverlap(rEVR, lEVR))
- duplicate = 1;
+ lEVR->Flags = Flags;
+ rEVR->Flags = flags[len];
+
+ res = rpmEVRcompare(lEVR, rEVR);
+ /* we only update version if greater */
+ if (res > 0) {
+ flags[len] = Flags;
+
+ versions[len] = EVR;
+ he->tag = versiontag;
+ he->t = RPM_STRING_ARRAY_TYPE;
+ he->p.argv = versions;
+ xx = headerMod(h, he, 0);
+ rpmlog(RPMLOG_WARNING, "%s overlaps %s, removing %s\n", rpmdsDNEVR(old), rpmdsDNEVR(new), rpmdsDNEVR(old));
+ } else if (res < 0) {
+ rpmlog(RPMLOG_WARNING, "%s overlaps %s, removing %s\n", rpmdsDNEVR(new), rpmdsDNEVR(old), rpmdsDNEVR(new));
+ } else {
+ rpmlog(RPMLOG_DEBUG, "%s overlaps %s, removing %s and merging flags\n", rpmdsDNEVR(new), rpmdsDNEVR(old), rpmdsDNEVR(new));
+ }
+
+ flags[len] |= newflags;
+ he->tag = flagtag;
+ he->t = RPM_UINT32_TYPE;
+ he->p.ui32p = flags;
+ xx = headerMod(h, he, 0);
+
lEVR = rpmEVRfree(lEVR);
rEVR = rpmEVRfree(rEVR);
+ duplicate = 1;
}
- if (overlap) {
- versions[len] = EVR;
- he->tag = versiontag;
- he->t = RPM_STRING_ARRAY_TYPE;
- he->p.argv = versions;
- xx = headerMod(h, he, 0);
- } else
+ old = rpmdsFree(old);
+ new = rpmdsFree(new);
+
+ if (!overlap)
continue;
}
#else

View file

@ -1,20 +0,0 @@
--- rpm-5.4.4/rpmconstant/rpmconstant.c.locale~ 2008-08-18 12:57:58.000000000 +0200
+++ rpm-5.4.4/rpmconstant/rpmconstant.c 2011-12-16 16:41:27.721549143 +0100
@@ -89,7 +89,7 @@ int rpmconstInitToContext(rpmconst c, co
int rc = 0;
if (!context) return 0; /* programmer error */
for (ptr = lccontext; *ptr != 0; ptr++)
- *ptr = (char)tolower(*ptr);
+ *ptr = (char)xtolower(*ptr);
rpmconstInitL(c);
while (rpmconstNextL(c)) {
if (!strcmp(lccontext, rpmconstContext(c))) {
@@ -108,7 +108,7 @@ int rpmconstNameMatch(rpmconst c, const
char * ucname = strdup(name);
for (uc = ucname; *uc != 0; uc++)
- *uc = (char)toupper(*uc);
+ *uc = (char)xtoupper(*uc);
if (!prefixed) prefixed = ALLCASE_PREFIX;
if (prefixed & WITH_PREFIX)

View file

@ -1,22 +0,0 @@
--- rpm-5.4.4/lib/transaction.c.epoch_cmp~ 2011-11-30 22:25:26.646155379 +0100
+++ rpm-5.4.4/lib/transaction.c 2011-11-30 23:15:28.252768345 +0100
@@ -1187,12 +1187,15 @@ rpmlog(RPMLOG_DEBUG, D_("sanity checking
const char *val = NULL;
he->tag = tags[t];
xx = headerGet(h, he, 0);
- if (he->tag == RPMTAG_EPOCH)
+ if (he->tag == RPMTAG_EPOCH) {
val = rpmteE(p);
- else if (he->tag == RPMTAG_DISTEPOCH)
+ if (val ? atoi(val) : 0 != he->p.ui32p ? *(he->p.ui32p) : 0)
+ nkeys--;
+ } else if (he->tag == RPMTAG_DISTEPOCH) {
val = rpmteD(p);
- if (strcmp(he->p.str ? he->p.str : "", val ? val : ""))
- nkeys--;
+ if (strcmp(he->p.str ? he->p.str : "", val ? val : ""))
+ nkeys--;
+ }
he->p.ptr = _free(he->p.ptr);
}
mi = rpmmiFree(mi);

View file

@ -1,24 +0,0 @@
--- rpm-5.4.4/rpmio/macro.c.glob~ 2011-09-30 20:40:18.000000000 +0200
+++ rpm-5.4.4/rpmio/macro.c 2011-11-17 16:49:16.870465121 +0100
@@ -2798,6 +2798,9 @@ rpmLoadMacroFile(MacroContext mc, const
/* Parse %{load:...} immediately recursively. */
if (s[1] == '{' && !strncmp(s+2, "load:", sizeof("load:")-1)) {
char * se = (char *) matchchar(s, '{', '}');
+ const char ** argv = NULL;
+ int argc = 0;
+ int i;
if (se == NULL) {
rpmlog(RPMLOG_WARNING,
_("%s:%u Missing '}' in \"%s\", skipping.\n"),
@@ -2814,7 +2817,10 @@ rpmLoadMacroFile(MacroContext mc, const
continue;
}
se = rpmMCExpand(mc, s, NULL);
- rc = rpmLoadMacroFile(mc, se, nesting - 1);
+ rc = rpmGlob(se, &argc, &argv);
+ for(i = 0; i < argc; i++)
+ rc |= rpmLoadMacroFile(mc, argv[i], nesting - 1);
+ argv = _free(argv);
se = _free(se);
if (rc != 0)
goto exit;

View file

@ -1,23 +0,0 @@
--- rpm-5.4.4/macros/macros.rpmbuild.in.builddir~ 2011-12-20 15:36:20.813852241 +0100
+++ rpm-5.4.4/macros/macros.rpmbuild.in 2011-12-20 15:37:43.385806877 +0100
@@ -326,8 +326,9 @@ echo "Patch #%{__patch_number} (%{basena
%___build_args -e
%___build_cmd %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}
%___build_pre \
+ RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
RPM_OPT_FLAGS=\"%{optflags}\"\
- export RPM_OPT_FLAGS\
+ export RPM_BUILD_DIR RPM_OPT_FLAGS\
%{?buildroot:RPM_BUILD_ROOT=\"%{u2p:%{buildroot}}\"\
export RPM_BUILD_ROOT}\
%{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
--- rpm-5.4.4/scripts/find-debuginfo.sh.builddir~ 2011-12-20 15:36:31.962846125 +0100
+++ rpm-5.4.4/scripts/find-debuginfo.sh 2011-12-20 15:36:49.492836503 +0100
@@ -32,7 +32,6 @@ strip_r=false
# Barf on missing build IDs.
strict=false
-RPM_BUILD_DIR="`pwd`"
BUILDDIR=.
out=debugfiles.list
nout=0

View file

@ -1,76 +0,0 @@
--- rpm-5.4.4/scripts/pkgconfigdeps.sh.pc_path~ 2011-11-17 15:08:42.400054348 +0100
+++ rpm-5.4.4/scripts/pkgconfigdeps.sh 2011-11-17 15:08:44.380056984 +0100
@@ -16,20 +16,22 @@ case $1 in
while read filename ; do
case "${filename}" in
*.pc)
- # Query the dependencies of the package.
- DIR=`dirname ${filename}`
- PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
- export PKG_CONFIG_PATH
- $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do
- [ -n "$n" ] || continue
- # We have a dependency. Make a note that we need the pkgconfig
- # tool for this package.
- if [ -n "$r" ] && [ -n "$v" ]; then
- echo "pkgconfig($n) $r $v"
- else
- echo "pkgconfig($n)"
- fi
- done
+ if [[ "$(dirname ${filename})" =~ pkgconfig ]]; then
+ # Query the dependencies of the package.
+ DIR=`dirname ${filename}`
+ PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
+ export PKG_CONFIG_PATH
+ $pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do
+ [ -n "$n" ] || continue
+ # We have a dependency. Make a note that we need the pkgconfig
+ # tool for this package.
+ if [ -n "$r" ] && [ -n "$v" ]; then
+ echo "pkgconfig($n) $r $v"
+ else
+ echo "pkgconfig($n)"
+ fi
+ done
+ fi
;;
esac
done
@@ -39,20 +41,22 @@ case $1 in
while read filename ; do
case "${filename}" in
*.pc)
- [ -n "$oneshot" ] && echo "$oneshot"; oneshot=""
- # Query the dependencies of the package.
- DIR=`dirname ${filename}`
- PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
- export PKG_CONFIG_PATH
- $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
- [ -n "$n" ] || continue
- if [ -n "$r" ] && [ -n "$v" ]; then
- echo "pkgconfig($n) $r $v"
- else
- echo "pkgconfig($n)"
- fi
- oneshot=""
- done
+ if [[ "$(dirname ${filename})" =~ pkgconfig ]]; then
+ [ -n "$oneshot" ] && echo "$oneshot"; oneshot=""
+ # Query the dependencies of the package.
+ DIR=`dirname ${filename}`
+ PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
+ export PKG_CONFIG_PATH
+ $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
+ [ -n "$n" ] || continue
+ if [ -n "$r" ] && [ -n "$v" ]; then
+ echo "pkgconfig($n) $r $v"
+ else
+ echo "pkgconfig($n)"
+ fi
+ oneshot=""
+ done
+ fi
;;
esac
done

View file

@ -1,41 +0,0 @@
--- rpm-5.4.4/build/parseChangelog.c.clean~ 2011-08-15 00:43:47.000000000 +0200
+++ rpm-5.4.4/build/parseChangelog.c 2011-11-12 17:52:00.756971839 +0100
@@ -269,11 +269,7 @@ int parseChangelog(Spec spec)
/* There are no options to %changelog */
if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) {
iob = rpmiobFree(iob);
-#if defined(RPM_VENDOR_MANDRIVA)
- return (spec->clean == NULL) ? PART_CLEAN : PART_NONE;
-#else
return PART_NONE;
-#endif
}
if (rc != RPMRC_OK)
return rc;
@@ -285,11 +281,7 @@ int parseChangelog(Spec spec)
iob = rpmiobAppend(iob, spec->line, 0);
line = _free(line);
if ((rc = readLine(spec, STRIP_COMMENTS | STRIP_NOEXPAND)) > 0) {
-#if defined(RPM_VENDOR_MANDRIVA)
- nextPart = (spec->clean == NULL) ? PART_CLEAN : PART_NONE;
-#else
nextPart = PART_NONE;
-#endif
break;
}
if (rc != RPMRC_OK)
--- rpm-5.4.4/build/parseFiles.c.clean~ 2011-03-25 18:45:46.000000000 +0100
+++ rpm-5.4.4/build/parseFiles.c 2011-11-12 17:52:00.758971903 +0100
@@ -114,12 +114,7 @@ int parseFiles(Spec spec)
}
}
-#if defined(RPM_VENDOR_MANDRIVA)
- /* if no %clean section, add implicit */
- rc = (nextPart == PART_NONE && spec->clean == NULL) ? PART_CLEAN : nextPart;
-#else
rc = nextPart;
-#endif
exit:
argv = _free(argv);

View file

@ -1,10 +0,0 @@
--- rpm-5.4.4/rpmpopt.in.clean~ 2011-12-05 20:52:18.544053402 +0100
+++ rpm-5.4.4/rpmpopt.in 2011-12-05 20:53:51.520325674 +0100
@@ -454,5 +454,7 @@ rpmbuild alias --lsb --noautoreq --noaut
rpmbuild alias --withoutcheck --define 'check exit 0' \
--POPTdesc=$"disable %check stanza for build"
+rpmbuild alias --withoutclean --define '__spec_clean_body %{nil}' \
+ --POPTdesc=$"disable %clean stanza for build"
# \endverbatim
#*/

View file

@ -1,84 +0,0 @@
--- rpm-5.4.4/lib/order.c.ordering~ 2011-01-14 15:06:08.000000000 +0100
+++ rpm-5.4.4/lib/order.c 2011-11-16 11:31:23.529577558 +0100
@@ -332,7 +332,7 @@ static inline /*@observer@*/ const char
/*@-mustmod@*/ /* FIX: hack modifies, but -type disables */
static /*@owned@*/ /*@null@*/ const char *
zapRelation(rpmte q, rpmte p,
- int zap, /*@in@*/ /*@out@*/ int * nzaps, int msglvl)
+ int zap, /*@in@*/ /*@out@*/ int * nzaps, int msglvl, rpmuint32_t skipFlags)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies q, p, *nzaps, rpmGlobalMacroContext, internalState @*/
{
@@ -364,6 +364,18 @@ zapRelation(rpmte q, rpmte p,
dp = rpmdsNewDNEVR( identifyDepend(Flags), requires);
+ if(Flags & skipFlags) {
+ if(zap) {
+ rpmlog(msglvl,
+ _("not removing %s \"%s\" from tsort relations.\n"),
+ (rpmteNEVRA(p) ? rpmteNEVRA(p) : "???"), dp);
+ if (nzaps)
+ (*nzaps)++;
+ }
+ dp = _free(dp);
+ continue;
+ }
+
/*
* Attempt to unravel a dependency loop by eliminating Requires's.
*/
@@ -1812,6 +1824,18 @@ int _rpmtsOrder(rpmts ts)
int depth;
int breadth;
int qlen;
+ static const evrFlags orderPriority[] = {
+ RPMSENSE_MISSINGOK,
+ RPMSENSE_SCRIPT_VERIFY,
+ RPMSENSE_PACKAGE,
+ RPMSENSE_FIND_REQUIRES,
+ _ERASE_ONLY_MASK,
+ _INSTALL_ONLY_MASK,
+ _ALL_REQUIRES_MASK
+ }; /* dependency to zap in order to try resolve dependency loops */
+ rpmuint32_t skipFlags = _ALL_REQUIRES_MASK;
+ unsigned sfi = 0;
+
#endif /* REFERENCE */
if (_rpmts_debug)
@@ -2007,6 +2031,9 @@ fprintf(stderr, "--> %s(%p) tsFlags 0x%x
rescan:
if (pi != NULL) pi = rpmtsiFree(pi);
#endif
+ if (sfi < sizeof(orderPriority))
+ skipFlags &= ~orderPriority[sfi++];
+
q = r = NULL;
qlen = 0;
pi = rpmtsiInit(ts);
@@ -2168,10 +2195,14 @@ rescan:
const char * nevra;
#endif
const char * dp;
+ /*
+ * TODO: use RPMLOG_DEBUG for when loops can be resolved
+ * without zapping all dependencies in it
+ */
rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS))
? RPMLOG_WARNING : RPMLOG_ERR;
#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */
- // Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable
+ /* Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable */
msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}");
#endif
@@ -2184,7 +2215,7 @@ rescan:
}
/* Find (and destroy if co-requisite) "q <- p" relation. */
- dp = zapRelation(q, p, 1, &nzaps, msglvl);
+ dp = zapRelation(q, p, 1, &nzaps, msglvl, skipFlags);
#if 0
/* Print next member of loop. */

View file

@ -1,45 +0,0 @@
--- rpm-5.4.5/lib/rpmds.c.link_loop~ 2012-03-05 22:32:46.858675088 +0100
+++ rpm-5.4.5/lib/rpmds.c 2012-03-06 18:52:18.775950015 +0100
@@ -2938,7 +2938,7 @@ static char * sonameDep(/*@returned@*/ c
return t;
}
-static char *find_elf_interpreter(GElf_Ehdr *ehdr, Elf *elf, char *filename)
+static char *find_elf_interpreter(GElf_Ehdr *ehdr, Elf *elf, char *filename, char *prev)
{
FILE *fp = NULL;
struct stat statbuf;
@@ -3040,6 +3040,8 @@ foo:
char path[MAXPATHLEN] = "";
libpath = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
+ if (prev && *prev && libpath && !strcmp(basename(prev), libpath))
+ libpath = NULL;
if (!libpath || !strlen(libpath))
continue;
@@ -3066,7 +3068,7 @@ foo:
if ((rpath && *rpath) || tmp)
tmp2 = stpcpy(tmp2, ":");
/* XXX: do better check to ensure libraries are all of the same class */
- tmp2 = stpcpy(tmp2, (class == ELFCLASS64) ? "/lib64" : "/lib");
+ tmp2 = stpcpy(tmp2, (class == ELFCLASS64) ? "/lib64:/usr/lib64" : "/lib:/usr/lib");
tmp = buf;
{
int i, count = 1;
@@ -3116,13 +3118,13 @@ end:
fclose(fp);
}
if (!interp_name && libpath)
- return find_elf_interpreter(NULL, NULL, libpath);
+ return find_elf_interpreter(NULL, NULL, libpath, filename);
return interp_name;
}
static int checkuClibc(GElf_Ehdr *ehdr, Elf *elf) {
int ret = 0;
- char *interp = find_elf_interpreter(ehdr, elf, NULL);
+ char *interp = find_elf_interpreter(ehdr, elf, NULL, NULL);
if (interp) {
char *tmp = basename(interp);

View file

@ -1,70 +0,0 @@
--- rpm-5.4.5/lib/rpmfc.c.desktop~ 2012-03-03 04:52:25.531739631 +0100
+++ rpm-5.4.5/lib/rpmfc.c 2012-03-03 04:52:28.659741193 +0100
@@ -993,6 +993,17 @@ static int rpmfcSCRIPT(rpmfc fc)
xx = rpmfcHelper(fc, 'R', "kernel");
}
mire = mireFree(mire);
+ }
+ if ((fc->fcolor->vals[fc->ix] & RPMFC_SCRIPT)) {
+ miRE mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS);
+ if (!mireRegcomp(mire, "^.*/usr/share/applications/.*\\.desktop$"))
+ if (mireRegexec(mire, fc->fn[fc->ix], (size_t) 0) >= 0) {
+ fc->fcolor->vals[fc->ix] |= (RPMFC_MODULE|RPMFC_SCRIPT);
+ xx = rpmfcHelper(fc, 'P', "desktop");
+ /* XXX: currently of no use, but for the sake of consistency... */
+ xx = rpmfcHelper(fc, 'R', "desktop");
+ }
+ mire = mireFree(mire);
#endif
}
@@ -1208,6 +1219,12 @@ assert(fc->fn != NULL);
if (mireRegexec(mire, fc->fn[fc->ix], (size_t) 0) >= 0)
fc->fcolor->vals[fc->ix] |= (RPMFC_MODULE|RPMFC_SCRIPT);
mire = mireFree(mire);
+ mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS);
+ /* buttfuckin' retarded, but whatever.. it'll work at least! ;) */
+ if (!mireRegcomp(mire, "^.*/usr/share/applications/.*\\.desktop$"))
+ if (mireRegexec(mire, fc->fn[fc->ix], (size_t) 0) >= 0)
+ fc->fcolor->vals[fc->ix] |= RPMFC_SCRIPT;
+ mire = mireFree(mire);
#endif
}
}
--- rpm-5.4.5/macros/macros.rpmbuild.in.desktop~ 2012-03-03 04:51:07.041700511 +0100
+++ rpm-5.4.5/macros/macros.rpmbuild.in 2012-03-03 04:51:50.048721947 +0100
@@ -685,5 +685,8 @@ done \
%__font_provides %{_rpmhome}/fontconfig.prov
#%__font_requires %{_rpmhome}/fontconfig.req
+%__desktop_provides %{_rpmhome}/mandriva/desktop-file.prov
+#%__desktop_requires %{_rpmhome}/mandriva/desktop-file.prov
+
# \endverbatim
#*/
--- rpm-5.4.5/scripts/desktop-file.prov.desktop~ 2012-03-03 04:54:39.103806210 +0100
+++ rpm-5.4.5/scripts/desktop-file.prov 2012-03-03 04:54:27.703800528 +0100
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Transform desktop mimetype info into RPM mimehandler(type) provides
+#
+# Author: Richard Hughes <richard@hughsie.com>
+# Based on other provides scripts from RPM
+
+OLD_IFS="$IFS"
+while read instfile ; do
+ case "$instfile" in
+ *.desktop)
+ if ! grep -q '^Type=Application$' "$instfile"; then continue; fi
+ if ! grep -q '^Exec=' "$instfile"; then continue; fi
+ mime=`grep '^MimeType=' "$instfile" | cut -d'=' -f2`
+ IFS=';'
+ for type in $mime ; do
+ echo 'mimehandler('$type')'
+ done
+ ;;
+ esac
+done
+IFS=$OLD_IFS
+

View file

@ -1,36 +0,0 @@
--- rpm-5.4.5/build/reqprov.c.script_overlap~ 2012-03-06 21:09:05.867560098 +0100
+++ rpm-5.4.5/build/reqprov.c 2012-03-06 21:10:49.962670768 +0100
@@ -125,9 +125,14 @@ int addReqProv(/*@unused@*/ Spec spec, H
/* do not consider dependency ranges like R: foo > 1, R: foo < 3
* as overlapping (mdvbz#65269)
*/
+#define RPMSENSE_SCRIPTS (RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN|RPMSENSE_SCRIPT_VERIFY)
if (!((Flags & RPMSENSE_GREATER && flags[len] & RPMSENSE_LESS) ||
- (Flags & RPMSENSE_LESS && flags[len] & RPMSENSE_GREATER)))
+ (Flags & RPMSENSE_LESS && flags[len] & RPMSENSE_GREATER)) &&
+ /* do not merge script dependencies with non-script dependencies */
+ !(((Flags & RPMSENSE_SCRIPTS) && !(flags[len] & RPMSENSE_SCRIPTS)) ||
+ ((flags[len] & RPMSENSE_SCRIPTS) && !(Flags & RPMSENSE_SCRIPTS))))
overlap = rpmdsCompare(new, old);
+#undef RPMSENSE_SCRIPTS
if (overlap) {
EVR_t lEVR = rpmEVRnew(RPMSENSE_ANY, 0),
--- rpm-5.4.5/lib/rpmfc.c.script_overlap~ 2012-03-06 21:09:05.870560101 +0100
+++ rpm-5.4.5/lib/rpmfc.c 2012-03-06 21:09:29.342585059 +0100
@@ -524,9 +524,14 @@ assert(EVR != NULL);
/* do not consider dependency ranges like R: foo > 1, R: foo < 3
* as overlapping (mdvbz#65269)
*/
+#define RPMSENSE_SCRIPTS (RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN|RPMSENSE_SCRIPT_VERIFY)
if (!((Flags & RPMSENSE_GREATER && (*depsp)->Flags[(*depsp)->i] & RPMSENSE_LESS) ||
- (Flags & RPMSENSE_LESS &&(*depsp)->Flags[(*depsp)->i] & RPMSENSE_GREATER)))
+ (Flags & RPMSENSE_LESS && (*depsp)->Flags[(*depsp)->i] & RPMSENSE_GREATER)) &&
+ /* do not merge script dependencies with non-script dependencies */
+ !(((Flags & RPMSENSE_SCRIPTS) && !((*depsp)->Flags[(*depsp)->i] & RPMSENSE_SCRIPTS)) ||
+ (((*depsp)->Flags[(*depsp)->i] & RPMSENSE_SCRIPTS) && !(Flags & RPMSENSE_SCRIPTS))))
overlap = rpmdsCompare(*depsp, ds);
+#undef RPMSENSE_SCRIPTS
if (overlap) {
EVR_t lEVR = rpmEVRnew(RPMSENSE_ANY, 0),

View file

@ -1,12 +0,0 @@
--- rpm-5.4.5/lib/rpmfc.c.php_dep_gen~ 2012-02-24 13:41:47.442140908 +0100
+++ rpm-5.4.5/lib/rpmfc.c 2012-02-24 13:41:49.933142149 +0100
@@ -919,7 +919,9 @@ static int rpmfcSCRIPT(rpmfc fc)
} else
if (fc->fcolor->vals[fc->ix] & RPMFC_PHP) {
xx = rpmfcHelper(fc, 'P', "php");
+#ifdef NOTYET
if (is_executable)
+#endif
xx = rpmfcHelper(fc, 'R', "php");
} else
if (fc->fcolor->vals[fc->ix] & RPMFC_MONO) {

View file

@ -1,32 +0,0 @@
--- rpm-5.4.5/lib/rpmfc.c.interpret_deps~ 2012-02-29 21:36:46.309581229 +0100
+++ rpm-5.4.5/lib/rpmfc.c 2012-02-29 21:52:44.099058625 +0100
@@ -843,10 +843,19 @@ static int rpmfcSCRIPT(rpmfc fc)
*se = '\0';
se++;
+/*@-moduncon@*/
+ bn = basename(s);
+
if (!_filter_values
|| (!fc->skipReq
&& !rpmfcMatchRegexps(fc->Rmires, fc->Rnmire, s, 'R')))
- if (is_executable) {
+ if (is_executable &&
+ strncmp(bn, "bash", sizeof("bash")-1) &&
+ strcmp(bn, "env") &&
+ strncmp(bn, "perl", sizeof("perl")-1) &&
+ strncmp(bn, "python", sizeof("python")-1) &&
+ strncmp(bn, "ruby", sizeof("ruby")-1) &&
+ strcmp(bn, "sh")) {
/* Add to package requires. */
ds = rpmdsSingle(RPMTAG_REQUIRENAME, s, "", RPMSENSE_FIND_REQUIRES);
xx = rpmdsMerge(&fc->requires, ds);
@@ -860,8 +869,6 @@ static int rpmfcSCRIPT(rpmfc fc)
/* Set color based on interpreter name. */
/* XXX magic token should have already done this?!? */
-/*@-moduncon@*/
- bn = basename(s);
/*@=moduncon@*/
if (!strcmp(bn, "perl"))
fc->fcolor->vals[fc->ix] |= RPMFC_PERL;

View file

@ -1,58 +0,0 @@
--- rpm-5.4.5/lib/rpmds.c.uclibc~ 2012-03-01 15:13:53.758195733 +0100
+++ rpm-5.4.5/lib/rpmds.c 2012-03-01 15:15:13.648235553 +0100
@@ -3016,31 +3016,28 @@ foo:
data = NULL;
while ((data = elf_getdata (scn, data)) != NULL) {
int dynsize = (int)(shdr->sh_size / shdr->sh_entsize)-1;
+ for (cnt = dynsize; cnt >= 0; --cnt) {
+ dyn = gelf_getdyn (data, cnt, &dyn_mem);
+
+ if (dyn->d_tag == DT_RPATH || dyn->d_tag == DT_RUNPATH) {
+ rpath = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
+ break;
+ }
+ }
for (cnt = 0; cnt <= dynsize; ++cnt) {
dyn = gelf_getdyn (data, cnt, &dyn_mem);
/* if this an elf interpeter, the only thing we want is to find SONAME
* and return it
*/
- if (phdr) {
- if (dyn->d_tag != DT_SONAME)
- continue;
+ if (phdr && dyn->d_tag == DT_SONAME) {
interp_name = strdup(elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val));
goto end;
}
- if (rpath == NULL) {
- if (dyn->d_tag == DT_RPATH)
- rpath = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
- else if (cnt == dynsize)
- rpath = "";
- if (rpath != NULL)
- cnt = -1;
- continue;
- }
- else if (rpath && dyn->d_tag == DT_NEEDED) {
+ if (dyn->d_tag == DT_NEEDED) {
char *tmp, *tmp2;
- char buf[1024];
- char path[1024] = "";
+ char buf[MAXPATHLEN];
+ char path[MAXPATHLEN] = "";
libpath = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
@@ -3106,10 +3103,10 @@ foo:
*tmp = '\0';
}
libpath = buf;
+ break;
}
}
}
- break;
}
}

View file

@ -1,11 +0,0 @@
--- rpm-5.4.5/lib/rpmds.c.uclibc_nolib64~ 2012-03-07 16:45:18.844313010 +0100
+++ rpm-5.4.5/lib/rpmds.c 2012-03-07 16:45:26.711321576 +0100
@@ -3131,7 +3131,7 @@ static int checkuClibc(GElf_Ehdr *ehdr,
if (tmp[0] == 'l' && tmp[1] == 'd') {
tmp += ((tmp[2] == '3' && tmp[3] == '2') ||
(tmp[2] == '6' && tmp[3] == '4')) ?
- 5 : 7;
+ 5 : 3;
if (!strncasecmp(tmp, "uClibc.so", sizeof("uClibc.so")-1))
ret = 1;
}

View file

@ -1,84 +0,0 @@
--- rpm-5.4.5/lib/rpmfc.c.int_gen_overlap~ 2012-02-23 22:12:39.924314353 +0100
+++ rpm-5.4.5/lib/rpmfc.c 2012-02-23 22:12:49.006318880 +0100
@@ -514,27 +514,57 @@ assert(EVR != NULL);
ds = rpmdsSingle(tagN, N, EVR, Flags);
#if defined(RPM_VENDOR_MANDRIVA) /* filter-overlapping-dependencies */
- int overlap = 0;
+ /* XXX: should really share same code path as with what's in
+ * build/reqprov.c:addReqProv()
+ */
+ int overlap = 0, res = 0;
if (*depsp) {
int ix = rpmdsSearch(*depsp, ds);
if (ix >= 0) {
- EVR_t lEVR = rpmEVRnew(RPMSENSE_ANY, 0),
- rEVR = rpmEVRnew(RPMSENSE_ANY, 0);
+ /* do not consider dependency ranges like R: foo > 1, R: foo < 3
+ * as overlapping (mdvbz#65269)
+ */
+ if (!((Flags & RPMSENSE_GREATER && (*depsp)->Flags[(*depsp)->i] & RPMSENSE_LESS) ||
+ (Flags & RPMSENSE_LESS &&(*depsp)->Flags[(*depsp)->i] & RPMSENSE_GREATER)))
+ overlap = rpmdsCompare(*depsp, ds);
+
+ if (overlap) {
+ EVR_t lEVR = rpmEVRnew(RPMSENSE_ANY, 0),
+ rEVR = rpmEVRnew(RPMSENSE_ANY, 0);
+ rpmuint32_t newflags;
+
+ /* if we have both a requires and suggests, we turn it into a requires */
+ if (!(Flags & RPMSENSE_MISSINGOK) || !((*depsp)->Flags[(*depsp)->i] & RPMSENSE_MISSINGOK)) {
+ (*depsp)->Flags[(*depsp)->i] &= ~RPMSENSE_MISSINGOK;
+ Flags &= ~RPMSENSE_MISSINGOK;
+ }
+
+ /* merge all flags about dependency type */
+ newflags = (((*depsp)->Flags[(*depsp)->i]| Flags) & _ALL_REQUIRES_MASK);
+
+ rpmdsSetIx(*depsp, ix);
+
+ rpmEVRparse(EVR, lEVR);
+ rpmEVRparse(rpmdsEVR(*depsp), rEVR);
+ lEVR->Flags = Flags;
+ rEVR->Flags = (*depsp)->Flags[(*depsp)->i];
+
+ res = rpmEVRcompare(lEVR, rEVR);
+ if (res > 0) {
+ (*depsp)->Flags[(*depsp)->i] = Flags;
+ (*depsp)->EVR[(*depsp)->i] = EVR;
+ rpmlog(RPMLOG_WARNING, "%s overlaps %s, removing %s\n", rpmdsDNEVR(*depsp), rpmdsDNEVR(ds), rpmdsDNEVR(*depsp));
+ } else if (res < 0) {
+ rpmlog(RPMLOG_WARNING, "%s overlaps %s, removing %s\n", rpmdsDNEVR(ds), rpmdsDNEVR(*depsp), rpmdsDNEVR(ds));
+ } else {
+ rpmlog(RPMLOG_DEBUG, "%s overlaps %s, removing %s and merging flags\n", rpmdsDNEVR(ds), rpmdsDNEVR(*depsp), rpmdsDNEVR(ds));
+ }
- rpmdsSetIx(*depsp, ix);
+ (*depsp)->Flags[(*depsp)->i] |= newflags;
- rpmEVRparse(rpmdsEVR(*depsp), lEVR);
- rpmEVRparse(EVR, rEVR);
- lEVR->Flags = rpmdsFlags(*depsp) | RPMSENSE_EQUAL;
- rEVR->Flags = Flags | RPMSENSE_EQUAL;
-
- if (rpmEVRcompare(lEVR, rEVR) < 0) {
- (*depsp)->EVR[(*depsp)->i] = EVR;
- (*depsp)->Flags[(*depsp)->i] = Flags;
- overlap = 1;
+ lEVR = rpmEVRfree(lEVR);
+ rEVR = rpmEVRfree(rEVR);
}
- lEVR = rpmEVRfree(lEVR);
- rEVR = rpmEVRfree(rEVR);
}
}
if (!overlap)
@@ -1183,7 +1213,7 @@ assert(se != NULL);
switch (deptype) {
default:
/*@switchbreak@*/ break;
- case 'P':
+ case 'P':
skipping = fc->skipProv;
ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags);
dix = rpmdsFind(fc->provides, ds);

View file

@ -1,405 +0,0 @@
--- rpm-5.4.5/lib/rpmds.c.16004~ 2012-02-24 14:13:37.649093023 +0100
+++ rpm-5.4.5/lib/rpmds.c 2012-02-24 14:13:40.677094532 +0100
@@ -2901,7 +2901,234 @@ rpmds rpmdsFromPRCO(rpmPRCO PRCO, rpmTag
* @param isElf64 is this an ELF64 symbol?
*/
#if defined(HAVE_GELF_H) && defined(HAVE_LIBELF) && !defined(__FreeBSD__)
-static char * sonameDep(/*@returned@*/ char * t, const char * s, int isElf64)
+#if defined(RPM_VENDOR_MANDRIVA)
+static char * sonameDep(/*@returned@*/ char * t, const char * s, int isElf64, int devel, int uClibc)
+ /*@modifies t @*/
+{
+ char *tmp = t;
+ *t = '\0';
+ if (uClibc)
+ tmp = stpcpy(tmp, "uClibc(");
+ if (devel) {
+ tmp = stpcpy(tmp, "devel(");
+ }
+#if !defined(__alpha__) && !defined(__sun)
+ if (!isElf64) {
+ /* XXX: eehhk, would've been nice with consistency, mandriva legacy... :| */
+ if (!devel && s[strlen(s)-1] != ')')
+ (void) stpcpy( stpcpy(tmp, s), "()(64bit)");
+ else {
+ tmp = stpcpy(tmp, s);
+ if (devel)
+ tmp = strstr(t, ".so");
+ tmp = stpcpy(tmp, "(64bit)");
+ }
+ }else
+#endif
+ tmp = stpcpy(tmp, s);
+ if (devel) {
+ char *suffix = strstr(t, ".so");
+ if (suffix)
+ tmp = suffix;
+ tmp = stpcpy(tmp, ")");
+ }
+ if (uClibc)
+ tmp = stpcpy(tmp, ")");
+
+ return t;
+}
+
+static char *find_elf_interpreter(GElf_Ehdr *ehdr, Elf *elf, char *filename)
+{
+ FILE *fp = NULL;
+ struct stat statbuf;
+ GElf_Ehdr ehdr_mem;
+ GElf_Shdr shdr_mem, *shdr;
+ GElf_Phdr phdr_mem, *phdr;
+ GElf_Dyn dyn_mem, *dyn;
+ Elf_Data * data;
+ Elf_Scn *scn = NULL;
+ int fdno;
+ char *interp_name = NULL;
+ char *libpath = NULL;
+ int cnt;
+ int class;
+ size_t shstrndx;
+
+ if (filename) {
+ if (!(fp = fopen(filename, "r"))) {
+ perror(filename);
+ return NULL;
+ }
+ if (fstat((fdno = fileno(fp)), &statbuf) < 0) {
+ perror(filename);
+ goto end;
+ }
+ if ((size_t) statbuf.st_size < sizeof(Elf64_Ehdr) || !S_ISREG(statbuf.st_mode))
+ goto foo;
+
+ (void) elf_version(EV_CURRENT);
+ elf = NULL;
+ if ((elf = elf_begin (fdno, ELF_C_READ, NULL)) == NULL
+ || elf_kind(elf) != ELF_K_ELF
+ || (ehdr = gelf_getehdr(elf, &ehdr_mem)) == NULL
+ || !(ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC))
+ goto end;
+ }
+foo:
+
+ if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN) {
+ fprintf(stderr, "%s: not a dynamic executable\n", filename);
+ goto end;
+ }
+ class = gelf_getclass(elf);
+
+ for (cnt = 0; cnt < ehdr->e_phnum; cnt++) {
+ phdr = gelf_getphdr (elf, cnt, &phdr_mem);
+ if (phdr->p_type == PT_INTERP)
+ break;
+ phdr = NULL;
+ }
+ if (phdr) {
+ Elf_Data *data = NULL;
+
+ scn = gelf_offscn (elf, phdr->p_offset);
+ shdr = gelf_getshdr(scn, &shdr_mem);
+ data = elf_getdata (scn, data);
+ interp_name = strdup(data->d_buf);
+ goto end;
+ }
+
+ if (elf_getshdrstrndx (elf, &shstrndx) >= 0)
+ while ((scn = elf_nextscn(elf, scn)) != NULL) {
+ shdr = gelf_getshdr(scn, &shdr_mem);
+ if (shdr->sh_type == SHT_DYNAMIC) {
+ char *rpath = NULL;
+ for (cnt = 0; cnt < ehdr->e_phnum; cnt++) {
+ phdr = gelf_getphdr (elf, cnt, &phdr_mem);
+ if (phdr->p_type == PT_LOAD)
+ break;
+ }
+
+ data = NULL;
+ while ((data = elf_getdata (scn, data)) != NULL) {
+ int dynsize = (int)(shdr->sh_size / shdr->sh_entsize)-1;
+ for (cnt = 0; cnt <= dynsize; ++cnt) {
+ dyn = gelf_getdyn (data, cnt, &dyn_mem);
+
+ if (rpath == NULL) {
+ if (dyn->d_tag == DT_RPATH)
+ rpath = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
+ else if (cnt == dynsize)
+ rpath = "";
+ if (rpath != NULL)
+ cnt = -1;
+ continue;
+ }
+ else if (rpath && DT_NEEDED == dyn->d_tag) {
+ char *tmp, *tmp2;
+ char buf[1024];
+ char path[1024] = "";
+
+ libpath = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
+
+ if (!libpath || !strlen(libpath))
+ continue;
+
+ tmp = libpath;
+ while (*tmp) {
+ if (*tmp == '/')
+ libpath = tmp + 1;
+ tmp++;
+ }
+
+ /* If this is a fully resolved name, we don't need to modify the path */
+ if (stat(libpath, &statbuf) == 0)
+ continue;
+
+ tmp2 = path;
+ if (rpath && *rpath) {
+ tmp2 = stpcpy(tmp2, rpath);
+ tmp2 = stpcpy(tmp2, ":");
+ }
+ tmp = getenv("LD_LIBRARY_PATH");
+ if (tmp)
+ tmp2 = stpcpy(tmp2, tmp);
+ if ((rpath && *rpath) || tmp)
+ tmp2 = stpcpy(tmp2, ":");
+ /* XXX: do better check to ensure libraries are all of the same class */
+ tmp2 = stpcpy(tmp2, (class == ELFCLASS64) ? "/lib64" : "/lib");
+ tmp = buf;
+ {
+ int i, count = 1;
+ char *path_n;
+
+ /* Eliminate all double //s */
+ path_n = path;
+ while ((path_n = strstr(path_n, "//"))) {
+ i = strlen(path_n);
+ memmove(path_n, path_n + 1, i - 1);
+ *(path_n + i - 1) = '\0';
+ }
+
+ /* Replace colons with zeros in path_list and count them */
+ for (i = strlen(path); i > 0; i--) {
+ if (path[i] == ':') {
+ path[i] = 0;
+ count++;
+ }
+ }
+ path_n = path;
+ for (i = 0; i < count; i++) {
+ strcpy(tmp, path_n);
+ strcat(tmp, "/");
+ strcat(tmp, libpath);
+ if (stat(tmp, &statbuf) == 0 && statbuf.st_mode & S_IRUSR) {
+ path[0] = '\0';
+ break;
+ }
+ path_n += (strlen(path_n) + 1);
+ }
+ if(path[0])
+ *tmp = '\0';
+ }
+ libpath = buf;
+ }
+ }
+ }
+ break;
+ }
+ }
+
+end:
+ if (fp) {
+ if (elf) (void) elf_end(elf);
+ fclose(fp);
+ }
+ if (!interp_name && libpath)
+ return find_elf_interpreter(NULL, NULL, libpath);
+ return interp_name;
+}
+
+static int checkuClibc(GElf_Ehdr *ehdr, Elf *elf) {
+ int ret = 0;
+ char *interp = find_elf_interpreter(ehdr, elf, NULL);
+
+ if (interp) {
+ char *tmp = basename(interp);
+ if (tmp[0] == 'l' && tmp[1] == 'd') {
+ tmp += ((tmp[2] == '3' && tmp[3] == '2') ||
+ (tmp[2] == '6' && tmp[3] == '4')) ?
+ 5 : 7;
+ if (!strncasecmp(tmp, "uClibc.so", sizeof("uClibc.so")-1))
+ ret = 1;
+ }
+ free(interp);
+ }
+ return ret;
+}
+#else
+static char * sonameDep(/*@returned@*/ char * t, const char * s, int isElf64, int devel, int uClibc)
/*@modifies t @*/
{
*t = '\0';
@@ -2917,6 +3144,7 @@ static char * sonameDep(/*@returned@*/ c
return t;
}
#endif
+#endif
/*@-moduncon -noeffectuncon @*/
int rpmdsELF(const char * fn, int flags,
@@ -2945,6 +3173,7 @@ int rpmdsELF(const char * fn, int flags,
int xx;
int isElf64;
int isDSO;
+ int isuClibc;
int gotSONAME = 0;
int gotDEBUG = 0;
int gotHASH = 0;
@@ -2987,6 +3216,11 @@ fprintf(stderr, "*** rpmdsELF(%s, %d, %p
isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64;
isDSO = ehdr->e_type == ET_DYN;
+#if defined(RPM_VENDOR_MANDRIVA)
+ isuClibc = checkuClibc(ehdr, elf);
+#else
+ isuClibc = 0;
+#endif
/*@-uniondef @*/
scn = NULL;
@@ -3085,7 +3319,7 @@ fprintf(stderr, "*** rpmdsELF(%s, %d, %p
/* Add next provide dependency. */
ds = rpmdsSingle(RPMTAG_PROVIDES,
- sonameDep(t, buf, isElf64),
+ sonameDep(t, buf, isElf64, 0, isuClibc),
"", RPMSENSE_FIND_PROVIDES);
xx = add(context, ds);
(void)rpmdsFree(ds);
@@ -3138,7 +3372,7 @@ fprintf(stderr, "*** rpmdsELF(%s, %d, %p
/* Add next require dependency. */
ds = rpmdsSingle(RPMTAG_REQUIRENAME,
- sonameDep(t, buf, isElf64),
+ sonameDep(t, buf, isElf64, 0, isuClibc),
"", RPMSENSE_FIND_REQUIRES);
xx = add(context, ds);
(void)rpmdsFree(ds);
@@ -3180,7 +3414,7 @@ fprintf(stderr, "*** rpmdsELF(%s, %d, %p
assert(s != NULL);
buf[0] = '\0';
ds = rpmdsSingle(RPMTAG_REQUIRENAME,
- sonameDep(buf, s, isElf64),
+ sonameDep(buf, s, isElf64, 0, isuClibc),
"", RPMSENSE_FIND_REQUIRES);
xx = add(context, ds);
(void)rpmdsFree(ds);
@@ -3195,7 +3429,7 @@ assert(s != NULL);
/* Add next provide dependency. */
buf[0] = '\0';
ds = rpmdsSingle(RPMTAG_PROVIDENAME,
- sonameDep(buf, s, isElf64),
+ sonameDep(buf, s, isElf64, 0, isuClibc),
"", RPMSENSE_FIND_PROVIDES);
xx = add(context, ds);
(void)rpmdsFree(ds);
@@ -3231,7 +3465,7 @@ assert(s != NULL);
/* Add next provide dependency. */
buf[0] = '\0';
ds = rpmdsSingle(RPMTAG_PROVIDENAME,
- sonameDep(buf, s, isElf64), "", RPMSENSE_FIND_PROVIDES);
+ sonameDep(buf, s, isElf64, 0, isuClibc), "", RPMSENSE_FIND_PROVIDES);
xx = add(context, ds);
(void)rpmdsFree(ds);
ds = NULL;
@@ -3251,46 +3485,6 @@ exit:
#if defined(RPM_VENDOR_MANDRIVA)
-/**
- * Return a soname dependency constructed from an elf string, Mandriva-style.
- * @retval t soname dependency
- * @param s elf string (NULL uses "")
- * @param isElf64 is this an ELF64 symbol?
- */
-#if defined(HAVE_GELF_H) && defined(HAVE_LIBELF) && !defined(__FreeBSD__)
-static char * mdvSonameDep(/*@returned@*/ char * t, const char * s, int isElf64, int devel)
- /*@modifies t @*/
-{
- char *tmp = t;
- *t = '\0';
- if (devel) {
- tmp = stpcpy(t, "devel(");
- }
-#if !defined(__alpha__) && !defined(__sun)
- if (!isElf64) {
- /* XXX: eehhk, would've been nice with consistency, mandriva legacy... :| */
- if (!devel && s[strlen(s)-1] != ')')
- (void) stpcpy( stpcpy(tmp, s), "()(64bit)");
- else {
- tmp = stpcpy(tmp, s);
- if (devel)
- tmp = strstr(t, ".so");
- tmp = stpcpy(tmp, "(64bit)");
- }
- }else
-#endif
- tmp = stpcpy(tmp, s);
- if (devel) {
- char *suffix = strstr(t, ".so");
- if (suffix)
- tmp = suffix;
- tmp = stpcpy(tmp, ")");
- }
-
- return t;
-}
-#endif
-
/** \ingroup rpmds
* Extract dependencies from a symlink.
* XXX Prototype added to keep GCC quiet and avoid adding a symbol.
@@ -3324,6 +3518,7 @@ int rpmdsSymlink(const char * fn, int fl
rpmds ds;
int xx;
int isElf64;
+ int isuClibc;
int gotSONAME = 0;
int skipP = (flags & RPMELF_FLAG_SKIPPROVIDES);
int skipR = (flags & RPMELF_FLAG_SKIPREQUIRES);
@@ -3378,6 +3573,11 @@ fprintf(stderr, "*** rpmdsELF(%s, %d, %p
/*@=evalorder@*/
isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64;
+#if defined(RPM_VENDOR_MANDRIVA)
+ isuClibc = checkuClibc(ehdr, elf);
+#else
+ isuClibc = 0;
+#endif
/*@-uniondef @*/
scn = NULL;
@@ -3413,7 +3613,7 @@ assert(s != NULL);
buf[0] = '\0';
for (i = 0; i < (int)(sizeof(filterRequires)/sizeof(filterRequires[0])); i++)
- if (!strncmp(s, filterRequires[i], strlen(filterRequires[i])))
+ if (!strncmp(s, filterRequires[i], strlen(filterRequires[i])) && !isuClibc)
break;
if (sizeof(filterRequires)/sizeof(filterRequires[0]) == i)
@@ -3428,7 +3628,7 @@ assert(s != NULL);
if (!skipP) {
ds = rpmdsSingle(RPMTAG_PROVIDENAME,
- mdvSonameDep(buf, s, isElf64, 1),
+ sonameDep(buf, s, isElf64, 1, isuClibc),
"", RPMSENSE_FIND_PROVIDES);
xx = add(context, ds);
(void)rpmdsFree(ds);
@@ -3447,7 +3647,7 @@ exit:
if (gotSONAME && !skipR)
for (i = 0, cnt = argvCount(deps); i < cnt; i++) {
ds = rpmdsSingle(RPMTAG_REQUIRENAME,
- mdvSonameDep(buf, deps[i], isElf64, 1),
+ sonameDep(buf, deps[i], isElf64, 1, isuClibc),
"", RPMSENSE_FIND_REQUIRES);
xx = add(context, ds);
(void)rpmdsFree(ds);

View file

@ -1,11 +0,0 @@
--- rpm-5.4.5/lib/rpmds.c.16005~ 2012-02-24 14:13:40.677094532 +0100
+++ rpm-5.4.5/lib/rpmds.c 2012-02-24 14:17:17.278202493 +0100
@@ -2913,7 +2913,7 @@ static char * sonameDep(/*@returned@*/ c
tmp = stpcpy(tmp, "devel(");
}
#if !defined(__alpha__) && !defined(__sun)
- if (!isElf64) {
+ if (isElf64) {
/* XXX: eehhk, would've been nice with consistency, mandriva legacy... :| */
if (!devel && s[strlen(s)-1] != ')')
(void) stpcpy( stpcpy(tmp, s), "()(64bit)");

View file

@ -1,222 +0,0 @@
--- rpm-5.4.5/lib/rpmds.c.16022~ 2012-02-24 14:17:17.278202493 +0100
+++ rpm-5.4.5/lib/rpmds.c 2012-02-24 14:19:52.416279821 +0100
@@ -2916,7 +2916,7 @@ static char * sonameDep(/*@returned@*/ c
if (isElf64) {
/* XXX: eehhk, would've been nice with consistency, mandriva legacy... :| */
if (!devel && s[strlen(s)-1] != ')')
- (void) stpcpy( stpcpy(tmp, s), "()(64bit)");
+ tmp = stpcpy( stpcpy(tmp, s), "()(64bit)");
else {
tmp = stpcpy(tmp, s);
if (devel)
@@ -2995,8 +2995,11 @@ foo:
scn = gelf_offscn (elf, phdr->p_offset);
shdr = gelf_getshdr(scn, &shdr_mem);
data = elf_getdata (scn, data);
- interp_name = strdup(data->d_buf);
- goto end;
+ if (data && data->d_buf) {
+ interp_name = strdup(data->d_buf);
+ goto end;
+ }
+ /* no 'data' most likely implies that this is an elf interpreter itself */
}
if (elf_getshdrstrndx (elf, &shstrndx) >= 0)
@@ -3016,6 +3019,15 @@ foo:
for (cnt = 0; cnt <= dynsize; ++cnt) {
dyn = gelf_getdyn (data, cnt, &dyn_mem);
+ /* if this an elf interpeter, the only thing we want is to find SONAME
+ * and return it
+ */
+ if (phdr) {
+ if (dyn->d_tag != DT_SONAME)
+ continue;
+ interp_name = strdup(elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val));
+ goto end;
+ }
if (rpath == NULL) {
if (dyn->d_tag == DT_RPATH)
rpath = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
@@ -3025,7 +3037,7 @@ foo:
cnt = -1;
continue;
}
- else if (rpath && DT_NEEDED == dyn->d_tag) {
+ else if (rpath && dyn->d_tag == DT_NEEDED) {
char *tmp, *tmp2;
char buf[1024];
char path[1024] = "";
@@ -3083,6 +3095,7 @@ foo:
strcpy(tmp, path_n);
strcat(tmp, "/");
strcat(tmp, libpath);
+
if (stat(tmp, &statbuf) == 0 && statbuf.st_mode & S_IRUSR) {
path[0] = '\0';
break;
@@ -3514,6 +3527,7 @@ int rpmdsSymlink(const char * fn, int fl
char buf[BUFSIZ];
const char * s;
int is_executable;
+ int is_symlink;
const char * soname = NULL;
rpmds ds;
int xx;
@@ -3539,12 +3553,6 @@ int rpmdsSymlink(const char * fn, int fl
if ((s = strrchr(fn, '.')) && strcmp(s, ".so"))
return 0;
- if ((lnklen = readlink(fn, path, MAXPATHLEN - 1)) == -1) {
- warn("%s", fn);
- return -1;
- }
- path[lnklen] = '\0';
-
/*@-castfcnptr@*/
if (_rpmds_debug < 0)
fprintf(stderr, "*** rpmdsELF(%s, %d, %p, %p)\n", fn, flags, (void *)add, context);
@@ -3555,6 +3563,62 @@ fprintf(stderr, "*** rpmdsELF(%s, %d, %p
if (lstat(fn, st) != 0)
return -1;
is_executable = (int)(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
+ is_symlink = S_ISLNK(st->st_mode);
+ }
+
+ if (is_symlink) {
+#ifdef NOT_YET
+ if ((lnklen = readlink(fn, path, MAXPATHLEN - 1)) == -1) {
+ warn("%s", fn);
+ return -1;
+ }
+ /* XXX: unused, path should expand to absolute path... */
+ path[lnklen] = '\0';
+#endif
+ } else {
+ FILE *fp = fopen(fn, "r");
+ char buf[BUFSIZ];
+ char *in;
+ stpcpy(path, fn);
+ fn = NULL;
+ if (fp == NULL || ferror(fp)) {
+ if (fp) (void) fclose(fp);
+ return -1;
+ }
+ /* try resolve ld scripts
+ * certainly *not* state of the art, but should in practice work
+ * everywhere where relevant...
+ */
+ while ((in = fgets(buf, sizeof(buf) - 1, fp))) {
+ in[sizeof(buf)-1] = '\0';
+ if ((in = strstr(in, "GROUP")) &&
+ (in = strchr(in, '(')) &&
+ (fn = strchr(in, '/')) &&
+ (in = strchr(fn, ' '))) {
+ *in = '\0';
+ break;
+ }
+ if (ferror(fp) || feof(fp))
+ break;
+ }
+ fclose(fp);
+ if (!fn)
+ return -1;
+ else {
+ /* XXX: try determine relative root */
+ struct stat sb, * st = &sb;
+
+ while((in = strrchr(path, '/'))) {
+ stpcpy(in, fn);
+ if (stat(path, st) == 0) {
+ fn = path;
+ break;
+ }
+ *in = 0;
+ }
+ if (!fn)
+ return -1;
+ }
}
fdno = open(fn, O_RDONLY);
@@ -3644,8 +3708,10 @@ assert(s != NULL);
/*@=uniondef @*/
exit:
- if (gotSONAME && !skipR)
+ if (gotSONAME && !skipR) {
for (i = 0, cnt = argvCount(deps); i < cnt; i++) {
+ if (deps[i][0] == 'l' && deps[i][1] == 'd')
+ continue;
ds = rpmdsSingle(RPMTAG_REQUIRENAME,
sonameDep(buf, deps[i], isElf64, 1, isuClibc),
"", RPMSENSE_FIND_REQUIRES);
@@ -3653,6 +3719,7 @@ exit:
(void)rpmdsFree(ds);
ds = NULL;
}
+ }
deps = argvFree(deps);
if (elf) (void) elf_end(elf);
--- rpm-5.4.5/lib/rpmfc.c.16022~ 2012-02-24 13:46:30.693282090 +0100
+++ rpm-5.4.5/lib/rpmfc.c 2012-02-24 14:20:56.062311544 +0100
@@ -518,7 +518,7 @@ assert(EVR != NULL);
* build/reqprov.c:addReqProv()
*/
int overlap = 0, res = 0;
- if (*depsp) {
+ if (*depsp && rpmExpandNumeric("%{?_use_internal_dependency_generator}")) {
int ix = rpmdsSearch(*depsp, ds);
if (ix >= 0) {
/* do not consider dependency ranges like R: foo > 1, R: foo < 3
@@ -1045,6 +1045,11 @@ static int rpmfcSYMLINK(rpmfc fc)
flags |= RPMELF_FLAG_SKIPPROVIDES;
if (fc->skipReq)
flags |= RPMELF_FLAG_SKIPREQUIRES;
+ /* XXX: Remove symlink classifier from linker scripts now that we've been
+ * able to feed it to the generator.
+ */
+ if (fc->fcolor->vals[fc->ix] == (RPMFC_WHITE|RPMFC_INCLUDE|RPMFC_TEXT|RPMFC_SYMLINK))
+ fc->fcolor->vals[fc->ix] &= ~RPMFC_SYMLINK;
return rpmdsSymlink(fn, flags, rpmfcMergePR, fc);
}
@@ -1362,6 +1367,36 @@ if (_rpmfc_debug) /* XXX noisy */
/* Add (filtered) entry to sorted class dictionary. */
fcolor = rpmfcColoring(se);
+
+ /* Quick&dirty hack for linker scripts replacing regular
+ * symlinks. Better *really* needs to be done ASAP.
+ */
+#if defined(RPM_VENDOR_MANDRIVA)
+ if (fcolor == (RPMFC_WHITE|RPMFC_INCLUDE|RPMFC_TEXT)) {
+ char * fn;
+
+ if ((fn = strrchr(s, '.')) && !strcmp(fn, ".so")) {
+ FILE * fp = fopen(s, "r");
+ char buf[BUFSIZ];
+ char * in;
+ if (fp == NULL || ferror(fp)) {
+ if (fp) (void) fclose(fp);
+ }
+ while ((in = fgets(buf, sizeof(buf) - 1, fp))) {
+ in[sizeof(buf)-1] = '\0';
+ if (ferror(fp) || feof(fp))
+ break;
+ if ((fn = strstr(in, "GROUP")) &&
+ (fn = strchr(fn, '(')) && (fn = strchr(in, '/'))) {
+ fcolor |= RPMFC_SYMLINK;
+ break;
+ }
+ }
+ if (fp)
+ fclose(fp);
+ }
+ }
+#endif
xx = argiAdd(&fc->fcolor, (int)fc->ix, fcolor);
if (fcolor != RPMFC_WHITE && (fcolor & RPMFC_INCLUDE))

Some files were not shown because too many files have changed in this diff Show more