Prefer /usr/bin/dpkg-deb if installed, as normal on a debian system.
Suggested-by: Mark Wielaard <mark@klomp.org>
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
+2020-03-26 Frank Ch. Eigler <fche@redhat.com>
+
+ * debuginfod.cxx (parse_opt): For -U, prefer dpkg-deb
+ after all if access(3)-able, fallback to bsdtar.
+
2020-03-25 Frank Ch. Eigler <fche@redhat.com>
* debuginfod.cxx (parse_opt): Associate a bsdtar subshell with
scan_archives[".rpm"]="cat"; // libarchive groks rpm natively
break;
case 'U':
- scan_archives[".deb"]="(bsdtar -O -x -f - data.tar.xz)<";
- scan_archives[".ddeb"]="(bsdtar -O -x -f - data.tar.xz)<";
+ if (access("/usr/bin/dpkg-deb", X_OK) == 0)
+ {
+ scan_archives[".deb"]="dpkg-deb --fsys-tarfile";
+ scan_archives[".ddeb"]="dpkg-deb --fsys-tarfile";
+ }
+ else
+ {
+ 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':