patch: debuginfod rhel7 vs. zstd rpms

Frank Ch. Eigler fche@redhat.com
Thu Mar 26 19:01:42 GMT 2020


Hi -

Committing this version after testing on rhel8.


Author: Frank Ch. Eigler <fche@redhat.com>
Date:   Thu Mar 26 13:48:20 2020 -0400

    debuginfod: document and workaround fedora31 zstd compression
    
    Old enough (even RHEL8 era) rpm/libarchive tools cannot grok fedora31
    zstd-compressed rpms.  Disable those tests if necessary.  Document -Z
    based workaround for these debuginfod users.
    
    https://fedoraproject.org/wiki/Changes/Switch_RPMs_to_zstd_compression
    
    Signed-off-by: Frank Ch. Eigler <fche@redhat.com>

diff --git a/doc/ChangeLog b/doc/ChangeLog
index 564644f41907..cfb03b380ca0 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-26  Frank Ch. Eigler  <fche@redhat.com>
+
+	* debuginfod.8 (-R): Note zstd compression complications
+	and workaround.
+
 2020-03-24  Frank Ch. Eigler  <fche@redhat.com>
 
 	* debuginfod-find.1, debuginfod_find_debuginfo.3: Document
diff --git a/doc/debuginfod.8 b/doc/debuginfod.8
index 64795c245f27..d8fbbea09ee9 100644
--- a/doc/debuginfod.8
+++ b/doc/debuginfod.8
@@ -100,7 +100,10 @@ additional patterns.  This option may be repeated.
 .B "\-R"
 Activate RPM patterns in archive scanning.  The default is off.
 Equivalent to \fB\%\-Z\~.rpm=cat\fP, since libarchive can natively
-process RPM archives.
+process RPM archives.  If your version of libarchive is much older
+than 2020, be aware that some distributions have switched to an
+incompatible zstd compression for their payload.  You may experiment
+with \fB\%\-Z\ .rpm='(rpm2cpio|zstdcat)<'\fP instead of \fB\-R\fP.
 
 .TP
 .B "\-U"
diff --git a/tests/ChangeLog b/tests/ChangeLog
index b7390a575d6a..5bedd0893cf5 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-26  Frank Ch. Eigler  <fche@redhat.com>
+
+	* run-debuginfod-find.sh: Check for bsdtar zstd capability
+	for running tests against zstd-compressed fedora31 rpms.
+
 2020-03-26  Mark Wielaard  <mark@klomp.org>
 
 	* Makefile.am (EXTRA_DIST): Add
diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh
index a6958fad758c..4d8d45e8b6d2 100755
--- a/tests/run-debuginfod-find.sh
+++ b/tests/run-debuginfod-find.sh
@@ -21,6 +21,8 @@
 type curl 2>/dev/null || (echo "need curl"; exit 77)
 type rpm2cpio 2>/dev/null || (echo "need rpm2cpio"; exit 77)
 type bzcat 2>/dev/null || (echo "need bzcat"; exit 77)
+bsdtar --version | grep -q zstd && zstd=true || zstd=false
+echo "zstd=$zstd bsdtar=`bsdtar --version`"
 
 # for test case debugging, uncomment:
 #set -x
@@ -231,6 +233,10 @@ filename=`testrun ${abs_top_builddir}/debuginfod/debuginfod-find source $BUILDID
 cmp $filename ${PWD}/prog2.c
 
 cp -rvp ${abs_srcdir}/debuginfod-rpms R
+if [ "$zstd" = "false" ]; then  # nuke the zstd fedora 31 ones
+    rm -vrf R/debuginfod-rpms/fedora31
+fi
+
 cp -rvp ${abs_srcdir}/debuginfod-tars Z
 kill -USR1 $PID1
 # All rpms need to be in the index
@@ -300,8 +306,12 @@ archive_test() {
 # common source file sha1
 SHA=f4a1a8062be998ae93b8f1cd744a398c6de6dbb1
 # fedora31
-archive_test 420e9e3308971f4b817cc5bf83928b41a6909d88 /usr/src/debug/hello3-1.0-2.x86_64/foobar////./../hello.c $SHA
-archive_test 87c08d12c78174f1082b7c888b3238219b0eb265 /usr/src/debug/hello3-1.0-2.x86_64///foobar/./..//hello.c $SHA
+if [ $zstd = true ]; then
+    # fedora31 uses zstd compression on rpms, older rpm2cpio/libarchive can't handle it
+    # and we're not using the fancy -Z '.rpm=(rpm2cpio|zstdcat)<' workaround in this testsuite
+    archive_test 420e9e3308971f4b817cc5bf83928b41a6909d88 /usr/src/debug/hello3-1.0-2.x86_64/foobar////./../hello.c $SHA
+    archive_test 87c08d12c78174f1082b7c888b3238219b0eb265 /usr/src/debug/hello3-1.0-2.x86_64///foobar/./..//hello.c $SHA
+fi
 # fedora30
 archive_test c36708a78618d597dee15d0dc989f093ca5f9120 /usr/src/debug/hello2-1.0-2.x86_64/hello.c $SHA
 archive_test 41a236eb667c362a1c4196018cc4581e09722b1b /usr/src/debug/hello2-1.0-2.x86_64/hello.c $SHA



More information about the Elfutils-devel mailing list