Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-08 Thread Ulrich Mueller
 On Sun, 07 Dec 2014, Zac Medico wrote:

 On 12/07/2014 07:06 PM, Christoph Junghans wrote:
 I know, I am late to the party, I just wanted to say that in
 unpacker.eclass I implemented a variant which uses neither deb2tags
 nor ar on prefix, but just bash's read and head.

The code uses head -c which is a GNU extension:

   $ man 1p head
   HEAD(1P)POSIX Programmer's ManualHEAD(1P)
   [...]
   SYNOPSIS
  head [−n number] [file...]
   [...]

For example, on OpenBSD and HPUX there is no -c option, or it is used
differently. Also Busybox doesn't have it.

Are we better off by requiring GNU head instead of GNU ar?

 Very nice. We should borrow that code and use it to eliminate the
 need for deb2targz in portage.

In PMS, this would have to go into EAPI 6, I suppose?

Ulrich


pgpfesq0ME4CD.pgp
Description: PGP signature


Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-08 Thread Michał Górny
Dnia 2014-12-07, o godz. 19:50:24
Zac Medico zmed...@gentoo.org napisał(a):

 On 12/07/2014 07:06 PM, Christoph Junghans wrote:
  I know, I am late to the party, I just wanted to say that in
  unpacker.eclass I implemented a variant which uses neither deb2tags
  nor ar on prefix, but just bash's read and head.
 
 Very nice. We should borrow that code and use it to eliminate the need
 for deb2targz in portage.

You shouldn't borrow code written by vapier. Ever. We have enough work
on our shoulders having to fix it in one location.

-- 
Best regards,
Michał Górny


pgpFIoLYEHMy3.pgp
Description: OpenPGP digital signature


Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-08 Thread Zac Medico
On 12/08/2014 12:45 AM, Ulrich Mueller wrote:
 On Sun, 07 Dec 2014, Zac Medico wrote:
 
 On 12/07/2014 07:06 PM, Christoph Junghans wrote:
 I know, I am late to the party, I just wanted to say that in
 unpacker.eclass I implemented a variant which uses neither deb2tags
 nor ar on prefix, but just bash's read and head.
 
 The code uses head -c which is a GNU extension:
 
$ man 1p head
HEAD(1P)POSIX Programmer's ManualHEAD(1P)
[...]
SYNOPSIS
   head [−n number] [file...]
[...]
 
 For example, on OpenBSD and HPUX there is no -c option, or it is used
 differently. Also Busybox doesn't have it.
 
 Are we better off by requiring GNU head instead of GNU ar?

That's a good question. We might use dd instead of head, or port the
shell code to python.

 Very nice. We should borrow that code and use it to eliminate the
 need for deb2targz in portage.
 
 In PMS, this would have to go into EAPI 6, I suppose?

Yes, I suppose so, since PMS currently says deb2targz is required when
ar is not compatible with GNU ar. However, earlier you said that other
package managers currently use ar unconditionally. Also, I have to
wonder if any of the other package managers are used on AIX. So, maybe a
retroactive change to PMS would be acceptable?

Maybe it's not worth the trouble, and we should simply keep the
deb2targz usage for AIX.
-- 
Thanks,
Zac



Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-07 Thread Zac Medico
On 12/07/2014 11:23 AM, Fabian Groffen wrote:
 On 07-12-2014 10:49:30 -0800, Zac Medico wrote:
 On 12/07/2014 10:47 AM, Ulrich Mueller wrote:
 On Sun, 07 Dec 2014, Zac Medico wrote:

 On 12/07/2014 10:37 AM, Ulrich Mueller wrote:
 It's sort of trivial, but here is a patch:

 From c53e7057f94728d6e0c7d16c675702ca831b9a5a Mon Sep 17 00:00:00 2001
 From: Ulrich Müller u...@gentoo.org
 Date: Sun, 7 Dec 2014 19:33:52 +0100
 Subject: [PATCH] Prefer GNU ar when unpacking .deb packages.

 [...]

 LGTM.

 So shall I push it?

 Yes, please do.
 
 FYI:
 
 % portageq envvar CHOST
 x86_64-apple-darwin13
 % ar --version
 ar: illegal option -- -
 usage:  ar -d [-TLsv] archive file ...
 ar -m [-TLsv] archive file ...
 ar -m [-abiTLsv] position archive file ...
 ar -p [-TLsv] archive [file ...]
 ar -q [-cTLsv] archive file ...
 ar -r [-cuTLsv] archive file ...
 ar -r [-abciuTLsv] position archive file ...
 ar -t [-TLsv] archive [file ...]
 ar -x [-ouTLsv] archive [file ...]
 % ar x $EPREFIX/usr/portage/distfiles/realpath_1.16_i386.deb
 % ls
 control.tar.gz  data.tar.gz  debian-binary
 
 deb2targz should work (but I don't have it installed, so not sure if tested).
 
 Fabian
 

It's hard to whitelist it if doesn't support --version, so it seems
reasonable to require deb2targz whenever ar is not GNU ar.
-- 
Thanks,
Zac



Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-07 Thread Ulrich Mueller
 On Sun, 07 Dec 2014, Zac Medico wrote:

 On 12/07/2014 11:23 AM, Fabian Groffen wrote:
 FYI:
 
 % portageq envvar CHOST
 x86_64-apple-darwin13
 % ar --version
 ar: illegal option -- -
 usage:  ar -d [-TLsv] archive file ...
 [...]

 It's hard to whitelist it if doesn't support --version, so it seems
 reasonable to require deb2targz whenever ar is not GNU ar.

unpack will still use ar if deb2targz is not installed. So on Darwin,
behaviour should be the same as before.

Ulrich


pgpPQEfcOLwSJ.pgp
Description: PGP signature


Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-07 Thread Zac Medico
On 12/07/2014 11:41 AM, Ulrich Mueller wrote:
 On Sun, 07 Dec 2014, Zac Medico wrote:
 
 On 12/07/2014 11:23 AM, Fabian Groffen wrote:
 FYI:

 % portageq envvar CHOST
 x86_64-apple-darwin13
 % ar --version
 ar: illegal option -- -
 usage:  ar -d [-TLsv] archive file ...
 [...]
 
 It's hard to whitelist it if doesn't support --version, so it seems
 reasonable to require deb2targz whenever ar is not GNU ar.
 
 unpack will still use ar if deb2targz is not installed. So on Darwin,
 behaviour should be the same as before.
 
 Ulrich
 

Ah, that's a nice feature. That way, we can just leave it to platforms
like AIX to pull in deb2targz when necessary.
-- 
Thanks,
Zac