Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Support different (de)compressors for binary packages
Date: Wed, 05 Jul 2017 15:59:15
Message-Id: CAMiTYSprcxi8cQKP79AVTMPpVDch1e76sU3nRQMXk7mBTNWxjQ@mail.gmail.com
In Reply to: Re: [gentoo-portage-dev] [PATCH] Support different (de)compressors for binary packages by "Michał Górny"
1 On Wed, Jul 5, 2017 at 1:03 AM, Michał Górny <mgorny@g.o> wrote:
2 > On wto, 2017-07-04 at 23:33 +0200, Manuel Rüger wrote:
3 >> On 04.07.2017 21:29, Zac Medico wrote:
4 >> > On Fri, Jun 30, 2017 at 2:49 AM, Manuel Rüger <mrueg@g.o> wrote:
5 >> > > +
6 >> > > COMPRESSION_COMMAND=$(PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}}
7 >> > > \
8 >> > > + "${PORTAGE_PYTHON:-/usr/bin/python}"
9 >> > > "$PORTAGE_BIN_PATH"/binpkg-helper.py \
10 >> > > + compressioncmd ${CATEGORY}/${P})
11 >> > > + [ -z "${COMPRESSION_COMMAND}" ] && \
12 >> > > + die "Failed to get COMPRESSION_COMMAND"
13 >> > > tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${PROOT}" . | \
14 >> > > - $PORTAGE_BZIP2_COMMAND -c > "$PORTAGE_BINPKG_TMPFILE"
15 >> > > + $COMPRESSION_COMMAND -c > "$PORTAGE_BINPKG_TMPFILE"
16 >> > > assert "failed to pack binary package: '$PORTAGE_BINPKG_TMPFILE'"
17 >> > > PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
18 >> > > "${PORTAGE_PYTHON:-/usr/bin/python}"
19 >> >
20 >> > If all that we really need is COMPRESSION_COMMAND, then the helper
21 >> > script is overkill. We should just pass a variable from
22 >> > doebuild_environment function. The variable name must be prefixed with
23 >> > PORTAGE_.
24 >> >
25 >> > Also, note that your mail client wrapped lines in this patch.
26 >> >
27 >>
28 >> Thanks for the review Zac!
29 >>
30 >> We'd need a bit more as the COMPRESSION_COMMAND depends on
31 >> ${CATEGORY}/${P} here in order to avoid a catch22 when using a
32 >> decompressor that is set to something a standard install doesn't include.
33 >>
34 >> Assume all binpkgs are set to be compressed with zstd, the patch makes
35 >> sure an app-arch/zstd binpkg will still be compressed with bzip2.
36 >
37 > And app-arch/bzip2 binpackage?
38 >
39 > In other words, that's the wrong approach. If I set binpackages to use
40 > X, I want them to use X, not 'use X if someone thought it correct to use
41 > X'. Just do what the user says to do. If you try to outsmart him, you're
42 > building another Windows.
43
44 Yeah, people can use package.env if they want per-package compression settings.
45 --
46 Thanks,
47 Zac