>>>>> On Sun, 07 Dec 2014, Zac Medico wrote:

> Okay, I guess we can default to ar if [[ $(ar --version 2>&1) == "GNU
> ar"* ]] and otherwise fall back to deb2targz.

It's sort of trivial, but here is a patch:

>From c53e7057f94728d6e0c7d16c675702ca831b9a5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <u...@gentoo.org>
Date: Sun, 7 Dec 2014 19:33:52 +0100
Subject: [PATCH] Prefer GNU ar when unpacking .deb packages.

PMS reference:
deb packages (*.deb). Ebuilds must ensure that the deb2targz program
is installed on those platforms where the GNU binutils ar program is
not available and the installed ar program is incompatible with GNU
archives. Otherwise, ebuilds must ensure that GNU binutils is
installed.
---
 bin/phase-helpers.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6e437da..afad2e9 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -448,11 +448,13 @@ unpack() {
                                                "with EAPI '${EAPI}'. Instead 
use 'deb'."
                                fi
                                # 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
+                               # `ar`.  For instance on AIX this doesn't work 
out.
+                               # If `ar` is not the GNU binutils version and 
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
+                               if [[ $(ar --version 2>/dev/null) != "GNU ar"* 
]] && \
+                                       type -P deb2targz > /dev/null; then
                                        y=${x##*/}
                                        local created_symlink=0
                                        if [ ! "$srcdir$x" -ef "$y" ] ; then
-- 
2.2.0


Reply via email to