Rebase to rpm 4.17.0 beta1

Drop upstreamed / unnecessary patches, drop debugedit conditionals
as it's now a hard external dependency. Add back
/usr/lib/rpm/find-debuginfo.sh as a compat symlink for now, this
is referred to from quite a few packages directly.

Pull couple of late upstream patches to avoid build dependency on
pandoc.
This commit is contained in:
Panu Matilainen 2021-06-23 08:12:20 +03:00
parent 0c2b0cd02a
commit 161b1ca16a
6 changed files with 75 additions and 260 deletions

View File

@ -0,0 +1,25 @@
From 9772abc058ae7183dbfb2356ec0af0a3d610c2c9 Mon Sep 17 00:00:00 2001
Message-Id: <9772abc058ae7183dbfb2356ec0af0a3d610c2c9.1624424665.git.pmatilai@redhat.com>
From: Florian Festi <ffesti@redhat.com>
Date: Tue, 22 Jun 2021 16:52:35 +0200
Subject: [PATCH 1/2] Also add rendered Japanese man pages
---
docs/man/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am
index 124a94d94..595444ad5 100644
--- a/docs/man/Makefile.am
+++ b/docs/man/Makefile.am
@@ -63,6 +63,7 @@ EXTRA_DIST += fr/rpm.8
man_ja_man8dir = $(mandir)/ja/man8
man_ja_man8_DATA = ja/rpm.8 ja/rpm2cpio.8 ja/rpmbuild.8 ja/rpmgraph.8
EXTRA_DIST += ja/rpm.8.md ja/rpm2cpio.8.md ja/rpmbuild.8.md ja/rpmgraph.8.md
+EXTRA_DIST += ja/rpm.8 ja/rpm2cpio.8 ja/rpmbuild.8 ja/rpmgraph.8
man_ko_man8dir = $(mandir)/ko/man8
man_ko_man8_DATA = ko/rpm.8 ko/rpm2cpio.8
--
2.31.1

View File

@ -1,111 +0,0 @@
From 13c96b26978953aff17bd642328d249820214b12 Mon Sep 17 00:00:00 2001
Message-Id: <13c96b26978953aff17bd642328d249820214b12.1620391180.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Fri, 7 May 2021 15:10:13 +0300
Subject: [PATCH] Fix regression wrt Lua reinitialization (RhBug:1958095)
Commit 2579d3e5ad5d713f2c161b9fb4835366ea4ea291 started storing the Lua
context in the spec, but this leads to problems as what is actually a
global context is now stored in two places, and can get out of sync.
So if you parse a spec, and then reset the global context, you get a
fancy segfault when the freeing the spec because it's pointing to
la-la-lua land.
Revert back to always using the global Lua handle.
---
build/parsePreamble.c | 3 ++-
build/rpmbuild_internal.h | 1 -
build/spec.c | 4 ++--
build/speclua.c | 2 +-
tests/rpmpython.at | 7 ++++++-
5 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index fc4a2994d..ac3d9159e 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -321,7 +321,8 @@ int addSource(rpmSpec spec, int specline, const char *srcname, rpmTagVal tag)
rpmPushMacro(spec->macros, buf, NULL, p->fullSource, RMIL_SPEC);
free(buf);
- addLuaSource(spec->lua, p);
+ rpmlua lua = rpmluaGetGlobalState();
+ addLuaSource(lua, p);
if (!nofetch && tryDownload(p))
return RPMRC_FAIL;
diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
index 2bac303c7..39a9c916f 100644
--- a/build/rpmbuild_internal.h
+++ b/build/rpmbuild_internal.h
@@ -138,7 +138,6 @@ struct rpmSpec_s {
Package sourcePackage;
rpmMacroContext macros;
- rpmlua lua;
rpmstrPool pool;
StringBuf prep; /*!< %prep scriptlet. */
diff --git a/build/spec.c b/build/spec.c
index 365ce6d32..6a13afda2 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -249,7 +249,7 @@ rpmSpec newSpec(void)
spec->macros = rpmGlobalMacroContext;
spec->pool = rpmstrPoolCreate();
- spec->lua = specLuaInit(spec);
+ specLuaInit(spec);
return spec;
}
@@ -298,7 +298,7 @@ rpmSpec rpmSpecFree(rpmSpec spec)
// only destroy lua tables if there are no BASpecs left
if (spec->recursing || spec->BACount == 0) {
- spec->lua = specLuaFini(spec);
+ specLuaFini(spec);
}
spec->sources = freeSources(spec->sources);
diff --git a/build/speclua.c b/build/speclua.c
index 595d71f14..abf2a4886 100644
--- a/build/speclua.c
+++ b/build/speclua.c
@@ -25,7 +25,7 @@ void * specLuaInit(rpmSpec spec)
void * specLuaFini(rpmSpec spec)
{
- rpmlua lua = spec->lua;
+ rpmlua lua = rpmluaGetGlobalState();
lua_State *L = rpmluaGetLua(lua);
for (const char **vp = luavars; vp && *vp; vp++) {
lua_pushnil(L);
diff --git a/tests/rpmpython.at b/tests/rpmpython.at
index 14c6a75dc..8128263e3 100644
--- a/tests/rpmpython.at
+++ b/tests/rpmpython.at
@@ -67,7 +67,7 @@ for iot in [ 'fpio', 'fdio', 'ufdio', 'gzdio' ]:
],
[])
-RPMPY_TEST([spec parse],[
+RPMPY_TEST([spec parse 1],[
# TODO: add a better test spec with sub-packages etc
spec = rpm.spec('${RPMDATA}/SPECS/hello.spec')
for (name, num, flags) in spec.sources:
@@ -82,6 +82,11 @@ hello-1.0-1
hello-1.0-1
])
+RPMPY_TEST([spec parse 2],[
+spec = rpm.spec('${RPMDATA}/SPECS/mini.spec')
+rpm.reloadConfig()
+])
+
RPMPY_TEST([basic header manipulation],[
h = rpm.hdr()
h['name'] = 'testpkg'
--
2.30.2

View File

@ -1,92 +0,0 @@
From 847c6f062c267c4be643be9c202141bd330a7891 Mon Sep 17 00:00:00 2001
Message-Id: <847c6f062c267c4be643be9c202141bd330a7891.1619695949.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Wed, 28 Apr 2021 10:20:55 +0300
Subject: [PATCH] Ignore comment line contents in macro files (#1659)
Previously %{ and similar in macro file comment line would cause the
line continuation logic to trigger and silently eat macro definitions
up to the next empty line. Since 75275a87cff04da65d3557f2c40ea2b526528c4c
we permit empty lines inside macro definitions, which would cause the
whole remaining file to be silently skipped (RhBug:1953910)
Only ever parse macro file lines starting with %, and add a test for
the case.
Actual patch by Michael Schroeder, testcase by undersigned.
Fixes: #1659
---
rpmio/macro.c | 8 ++++++++
tests/data/macros.testfile | 7 +++++++
tests/rpmmacro.at | 17 +++++++++++++++++
3 files changed, 32 insertions(+)
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 6dfc73336..94ff5187d 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -226,6 +226,14 @@ rdcl(char * buf, size_t size, FILE *f)
nb--;
if (*q == 0)
break; /* no newline found, EOF */
+ if (p == buf) {
+ while (*p && isblank(*p))
+ p++;
+ if (*p != '%') { /* only parse actual macro */
+ *q = '\0'; /* trim trailing \r, \n */
+ break;
+ }
+ }
for (; p < q; p++) {
switch (*p) {
case '\\':
diff --git a/tests/data/macros.testfile b/tests/data/macros.testfile
index 86fd883fc..f56c80578 100644
--- a/tests/data/macros.testfile
+++ b/tests/data/macros.testfile
@@ -5,6 +5,13 @@
}
%second %{?def:macro_2}
+# empty lines inside a %{ block
+%empty0 %{expand:
+some
+
+thing
+}
+
%comment1 %{expand:
read
%dnl comment
diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at
index 072b986be..c0f114087 100644
--- a/tests/rpmmacro.at
+++ b/tests/rpmmacro.at
@@ -945,6 +945,23 @@ read
[])
AT_CLEANUP
+AT_SETUP([macro file empty lines])
+AT_KEYWORDS([macros])
+AT_CHECK([
+runroot rpm \
+ --macros /data/macros.testfile \
+ --eval "%{empty0}"
+],
+[0],
+[
+some
+
+thing
+
+],
+[])
+AT_CLEANUP
+
AT_SETUP([macro traceback])
AT_KEYWORDS([macros])
AT_CHECK([
--
2.30.2

View File

@ -1,30 +0,0 @@
From f2bc669cd0a080792522dd1bb7f50ef7025f16f0 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sat, 21 Jul 2018 10:13:04 +0200
Subject: [PATCH] find-debuginfo.sh: decompress DWARF compressed ELF sections
debugedit and dwz do not support DWARF compressed ELF sections, let's
just decompress those before extracting debuginfo.
Tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
scripts/find-debuginfo.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 90a44942d..7b01bc036 100755
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -357,6 +357,9 @@ do_file()
get_debugfn "$f"
[ -f "${debugfn}" ] && return
+ echo "explicitly decompress any DWARF compressed ELF sections in $f"
+ eu-elfcompress -q -p -t none "$f"
+
echo "extracting debug info from $f"
# See also cpio SOURCEFILE copy. Directories must match up.
debug_base_name="$RPM_BUILD_DIR"
--
2.18.0

View File

@ -0,0 +1,33 @@
From 89eb448b6c5941921acdc7e8b5e18050900e9f20 Mon Sep 17 00:00:00 2001
Message-Id: <89eb448b6c5941921acdc7e8b5e18050900e9f20.1624424665.git.pmatilai@redhat.com>
In-Reply-To: <9772abc058ae7183dbfb2356ec0af0a3d610c2c9.1624424665.git.pmatilai@redhat.com>
References: <9772abc058ae7183dbfb2356ec0af0a3d610c2c9.1624424665.git.pmatilai@redhat.com>
From: Florian Festi <ffesti@redhat.com>
Date: Tue, 22 Jun 2021 16:53:13 +0200
Subject: [PATCH 2/2] Don't depend on translation sub directories
just create them. Otherwise their date messes up the man page
genenration and triggers a rebuild when on wanted (e.g. when building
form the tar ball)
Resolves: #1729
---
docs/man/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am
index 595444ad5..e10959255 100644
--- a/docs/man/Makefile.am
+++ b/docs/man/Makefile.am
@@ -87,7 +87,7 @@ man_sk_man8_DATA = sk/rpm.8
EXTRA_DIST += sk/rpm.8.md
EXTRA_DIST += sk/rpm.8
-%: $(srcdir)/%.md fr ja ko pl ru sk
+%: $(srcdir)/%.md
@$(MKDIR_P) `dirname $@`
${PANDOC} -s -t man $(srcdir)/$@.md -o $@
--
2.31.1

View File

@ -25,14 +25,12 @@
%bcond_without sqlite
# build with bdb_ro support?
%bcond_without bdb_ro
# build with external debugedit?
%bcond_without debugedit
%define rpmhome /usr/lib/rpm
%global rpmver 4.16.90
%global snapver git15395
%global rel 8
%global rpmver 4.17.0
%global snapver beta1
%global rel 0
%global sover 9
%global srcver %{rpmver}%{?snapver:-%{snapver}}
@ -51,12 +49,10 @@ Source10: rpmdb-rebuild.service
Patch1: rpm-4.17.x-siteconfig.patch
# In current Fedora, man-pages pkg owns all the localized man directories
Patch3: rpm-4.9.90-no-man-dirs.patch
# https://github.com/rpm-software-management/rpm/pull/473
Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch
# Patches already upstream:
Patch100: 0001-Ignore-comment-line-contents-in-macro-files-1659.patch
Patch101: 0001-Fix-regression-wrt-Lua-reinitialization-RhBug-195809.patch
Patch100: 0001-Also-add-rendered-Japanese-man-pages.patch
Patch101: 0002-Don-t-depend-on-translation-sub-directories.patch
# These are not yet upstream
Patch906: rpm-4.7.1-geode-i686.patch
@ -74,6 +70,7 @@ Obsoletes: python2-rpm < %{version}-%{release}
%if %{with check}
BuildRequires: fakechroot gnupg2
BuildRequires: debugedit >= 0.3
%endif
# XXX generally assumed to be installed but make it explicit as rpm
@ -185,9 +182,7 @@ Requires: tar unzip gzip bzip2 cpio xz
%if %{with zstd}
Requires: zstd
%endif
%if %{with debugedit}
Requires: debugedit
%endif
Requires: debugedit >= 0.3
Requires: pkgconfig >= 1:0.24
Requires: /usr/bin/gdb-add-index
# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
@ -314,10 +309,6 @@ the fapolicyd daemon.
%prep
%autosetup -n rpm-%{srcver} -p1
%if %{with debugedit}
sed -i -e "s:%%{_rpmconfigdir}/find-debuginfo.sh:%%{_bindir}/find-debuginfo.sh:g" macros.in
%endif
%build
%set_build_flags
@ -389,6 +380,9 @@ for be in %{?with_ndb:ndb} %{?with_sqlite:sqlite}; do
cp -va ${be}/. $RPM_BUILD_ROOT/var/lib/rpm/
done
# some packages invoke find-debuginfo directly, preserve compat for now
ln -s ../../bin/find-debuginfo $RPM_BUILD_ROOT/usr/lib/rpm/find-debuginfo.sh
%find_lang rpm
find $RPM_BUILD_ROOT -name "*.la"|xargs rm -f
@ -398,10 +392,6 @@ rm -f $RPM_BUILD_ROOT/%{rpmhome}/{perldeps.pl,perl.*,pythond*}
rm -f $RPM_BUILD_ROOT/%{_fileattrsdir}/{perl*,python*}
rm -rf $RPM_BUILD_ROOT/var/tmp
%if %{with debugedit}
rm -f $RPM_BUILD_ROOT/%{rpmhome}/{debugedit,sepdebugcrcfix,find-debuginfo.sh}
%endif
%if %{with check}
%check
make check TESTSUITEFLAGS=-j%{_smp_build_ncpus} || (cat tests/rpmtests.log; exit 1)
@ -423,7 +413,7 @@ fi
%files -f rpm.lang
%license COPYING
%doc CREDITS doc/manual/[a-z]*
%doc CREDITS docs/manual/[a-z]*
%{_unitdir}/rpmdb-rebuild.service
@ -544,12 +534,7 @@ fi
%{rpmhome}/*.req
%{rpmhome}/mkinstalldirs
%{rpmhome}/fileattrs/*
%if !%{with debugedit}
%{rpmhome}/debugedit
%{rpmhome}/sepdebugcrcfix
%{rpmhome}/find-debuginfo.sh
%endif
%files sign
%{_bindir}/rpmsign
@ -572,9 +557,14 @@ fi
%files apidocs
%license COPYING
%doc doc/librpm/html/*
%doc docs/librpm/html/*
%changelog
* Tue Jun 22 2021 Panu Matilainen <pmatilai@redhat.com> - 4.17.0-0.beta1.1
- Rebase to 4.17.0 beta1
- Pull additional upstream patches to avoid pandoc dependency
- Add back /usr/lib/rpm/find-debuginfo.sh as a compat symlink
* Wed Jun 02 2021 Python Maint <python-maint@redhat.com> - 4.16.90-0.git15395.8.1
- Rebuilt for Python 3.10