summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2020-03-26 13:48:20 -0400
committerFrank Ch. Eigler <fche@redhat.com>2020-03-26 14:35:06 -0400
commitb77ac36a0810692bd847c935f147b0e3f66abf9c (patch)
treea2264dc00a9cc4348f935d27c8aae0eab0ae0e86
parent12305ff528ad9365b4d4e5ebcd307373cdd5bf83 (diff)
downloadelfutils-fche/zstd.tar.gz
debuginfod: document and workaround fedora31 zstd compressionfche/zstd
Old enough (RHEL7 era) rpm/libarchive tools cannot grok fedora31 zstd-compressed rpms. Disable those tests if necessary. Document -Z based workaround for debuginfod users. https://fedoraproject.org/wiki/Changes/Switch_RPMs_to_zstd_compression Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/debuginfod.85
-rw-r--r--tests/ChangeLog5
-rwxr-xr-xtests/run-debuginfod-find.sh14
4 files changed, 26 insertions, 3 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 564644f4..cfb03b38 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 64795c24..d8fbbea0 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 b7390a57..5bedd089 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 a6958fad..e9398e97 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