Gentoo Archives: gentoo-alt

From: Zac Medico <zmedico@g.o>
To: Ulrich Mueller <ulm@g.o>, Zac Medico <zmedico@g.o>
Cc: prefix@g.o, gentoo-alt@l.g.o, gentoo-portage-dev@l.g.o
Subject: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types
Date: Sun, 07 Dec 2014 18:44:07
Message-Id: 54849FF0.9080606@gentoo.org
1 On 12/07/2014 10:37 AM, Ulrich Mueller wrote:
2 >>>>>> On Sun, 07 Dec 2014, Zac Medico wrote:
3 >
4 >> Okay, I guess we can default to ar if [[ $(ar --version 2>&1) == "GNU
5 >> ar"* ]] and otherwise fall back to deb2targz.
6 >
7 > It's sort of trivial, but here is a patch:
8 >
9 > From c53e7057f94728d6e0c7d16c675702ca831b9a5a Mon Sep 17 00:00:00 2001
10 > From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@g.o>
11 > Date: Sun, 7 Dec 2014 19:33:52 +0100
12 > Subject: [PATCH] Prefer GNU ar when unpacking .deb packages.
13 >
14 > PMS reference:
15 > deb packages (*.deb). Ebuilds must ensure that the deb2targz program
16 > is installed on those platforms where the GNU binutils ar program is
17 > not available and the installed ar program is incompatible with GNU
18 > archives. Otherwise, ebuilds must ensure that GNU binutils is
19 > installed.
20 > ---
21 > bin/phase-helpers.sh | 10 ++++++----
22 > 1 file changed, 6 insertions(+), 4 deletions(-)
23 >
24 > diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
25 > index 6e437da..afad2e9 100644
26 > --- a/bin/phase-helpers.sh
27 > +++ b/bin/phase-helpers.sh
28 > @@ -448,11 +448,13 @@ unpack() {
29 > "with EAPI '${EAPI}'. Instead use 'deb'."
30 > fi
31 > # Unpacking .deb archives can not always be done with
32 > - # `ar`. For instance on AIX this doesn't work out. If
33 > - # we have `deb2targz` installed, prefer it over `ar` for
34 > - # that reason. We just make sure on AIX `deb2targz` is
35 > + # `ar`. For instance on AIX this doesn't work out.
36 > + # If `ar` is not the GNU binutils version and we have
37 > + # `deb2targz` installed, prefer it over `ar` for that
38 > + # reason. We just make sure on AIX `deb2targz` is
39 > # installed.
40 > - if type -P deb2targz > /dev/null; then
41 > + if [[ $(ar --version 2>/dev/null) != "GNU ar"* ]] && \
42 > + type -P deb2targz > /dev/null; then
43 > y=${x##*/}
44 > local created_symlink=0
45 > if [ ! "$srcdir$x" -ef "$y" ] ; then
46 >
47
48 LGTM. In a separate patch we can also include Brian's deb2targz xz
49 handling for AIX, I guess.
50 --
51 Thanks,
52 Zac