commit:     c53e7057f94728d6e0c7d16c675702ca831b9a5a
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  7 18:33:52 2014 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Dec  7 18:39:07 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c53e7057

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

Reply via email to