Prefer deb2tgz over ar for unpacking .deb files when installed (patch by
authorZac Medico <zmedico@gentoo.org>
Tue, 13 May 2008 23:09:03 +0000 (23:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 13 May 2008 23:09:03 +0000 (23:09 -0000)
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

index b58962343140245d3a328389048de530b7c27cb7..ecc825464058e63f60d4e343d1efc193ecc03a37 100755 (executable)
@@ -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}