From 7376b33e8610fe082dcd9de8f47b2acf4bda9f13 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 13 May 2008 23:09:03 +0000 Subject: [PATCH] Prefer deb2tgz over ar for unpacking .deb files when installed (patch by Fabian Groffen, http://archives.gentoo.org/gentoo-portage-dev/msg_2f9c8543016f1a96f9122aca0ec35ded.xml) (trunk r10327) svn path=/main/branches/2.1.2/; revision=10330 --- bin/ebuild.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index b58962343..ecc825464 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -372,9 +372,22 @@ unpack() { LHa|LHA|lha|lzh) lha xfq "${srcdir}${x}" || die "$myfail" ;; - a|deb) + a) ar x "${srcdir}${x}" || die "$myfail" ;; + deb) + # Unpacking .deb archives can not always be done with + # `ar`. For instance on AIX this doesn't work out. If + # we have `deb2targz` installed, prefer it over `ar` for + # that reason. We just make sure on AIX `deb2targz` is + # installed. + if type -P deb2targz > /dev/null; then + deb2targz "${srcdir}/${x}" || die "$myfail" + mv "${srcdir}/${x/.deb/.tar.gz}" data.tar.gz + else + ar x "${srcdir}/${x}" || die "$myfail" + fi + ;; lzma) if [ "${y}" == "tar" ]; then lzma -dc "${srcdir}${x}" | tar xof - ${tar_opts} -- 2.26.2