]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
PR25583: debuginfod: prefer bsdtar to dpkg for .deb handling
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 25 Mar 2020 14:55:53 +0000 (10:55 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Thu, 26 Mar 2020 19:50:53 +0000 (15:50 -0400)
It turns out a bsdtar subshell can do the job of dpkg-deb.
bsdtar comes from/with libarchive so it should be available
everywhere.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
config/ChangeLog
config/elfutils.spec.in
debuginfod/ChangeLog
debuginfod/debuginfod.cxx
tests/ChangeLog
tests/run-debuginfod-find.sh

index d1050e2c084a6c87f365c705e795f1146e27409b..368f959ee0befc330329b93f2a7b727a63f58f32 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-25  Frank Ch. Eigler <fche@redhat.com>
+
+       * elfutils.spec.in: *Require: bsdtar instead of dpkg.
+
 2020-03-04  Mark Wielaard  <mark@klomp.org>
 
        * elfutils.spec.in (package debuginfod): Remove Requires: rpm.
index ef7fe31fe1bdd47e55a04c1c05b21e6bab73f92a..6e2436506b376ef356157f9213a26c3eaad0364f 100644 (file)
@@ -35,9 +35,7 @@ BuildRequires: pkgconfig(libarchive) >= 3.1.2
 BuildRequires: bzip2
 # For the run-debuginfod-find.sh test case in %check for /usr/sbin/ss
 BuildRequires: iproute
-%if 0%{?fedora} >= 20
-BuildRequires: dpkg
-%endif
+BuildRequires: bsdtar
 BuildRequires: curl
 
 %define _gnu %{nil}
@@ -157,9 +155,8 @@ Requires(post):   systemd
 Requires(preun):  systemd
 Requires(postun): systemd
 Requires(pre): shadow-utils
-# To extract .deb files with dpkg-deb --fsys-tarfile
-# Can be Recommends if rpm supports that
-Requires: dpkg
+# To extract .deb files with a bsdtar (= libarchive) subshell
+Requires: bsdtar
 
 %description debuginfod-client
 The elfutils-debuginfod-client package contains shared libraries
index 60d912a37c477869d61e0164eca0e66dfba2a0f4..5e19db5174727c27a406ef773d162a2e46a448a8 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-25  Frank Ch. Eigler <fche@redhat.com>
+
+       * debuginfod.cxx (parse_opt): Associate a bsdtar subshell with
+       the .deb & .ddeb extensions, instead of dpkg-deb.
+
 2020-03-26  Frank Ch. Eigler  <fche@redhat.com>
 
        * debuginfod-client.c (debuginfod_query_server): Don't
index 2f28a877faa8bb2a07671349ed6032de9cd4f5e4..c03bbf922f5936aed4db0267057b80045ee74c69 100644 (file)
@@ -429,8 +429,9 @@ parse_opt (int key, char *arg,
       scan_archives[".rpm"]="cat"; // libarchive groks rpm natively
       break;
     case 'U':
-      scan_archives[".deb"]="dpkg-deb --fsys-tarfile";
-      scan_archives[".ddeb"]="dpkg-deb --fsys-tarfile";
+      scan_archives[".deb"]="(bsdtar -O -x -f - data.tar.xz)<";
+      scan_archives[".ddeb"]="(bsdtar -O -x -f - data.tar.xz)<";
+      // .udeb too?
       break;
     case 'Z':
       {
index 5bedd0893cf566849530a5fc4e0308dee201ce0c..c06d892440a0da186ae9237575f11f663be2dfee 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-26  Frank Ch. Eigler <fche@redhat.com>
+
+       * run-debuginfod-find.sh: Look for bsdtar instead of dpkg.
+
 2020-03-26  Frank Ch. Eigler  <fche@redhat.com>
 
        * run-debuginfod-find.sh: Check for bsdtar zstd capability
index 4d8d45e8b6d2c0e0a97f3834717ceb37d97c900b..cc826f9607a4798ff364631d6c46e34c9dc8152b 100755 (executable)
@@ -371,7 +371,7 @@ wait_ready $PORT2 'thread_busy{role="scan"}' 0
 # have clients contact the new server
 export DEBUGINFOD_URLS=http://127.0.0.1:$PORT2
 
-if type dpkg-deb 2>/dev/null; then
+if type bsdtar 2>/dev/null; then
     # copy in the deb files
     cp -rvp ${abs_srcdir}/debuginfod-debs/*deb D
     kill -USR1 $PID2