Gentoo Archives: gentoo-portage-dev

From: Jason Pepas <cell@×××××××××××.edu>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] handling config stuff in portage (for package compression, etc)
Date: Mon, 07 Nov 2005 14:49:57
Message-Id: 20051107144917.GA5759@ices.utexas.edu
In Reply to: Re: [gentoo-portage-dev] handling config stuff in portage (for package compression, etc) by Marius Mauch
1 On Mon, Nov 07, 2005 at 12:11:55AM +0100, Marius Mauch wrote:
2 > > For example, if Z="bzip2", a file would be sourced ("bzip2.sh"), which
3 > > would contain the these settings:
4 > >
5 > > ZEXT="bz2"
6 > > TZEXT="tbz2"
7 > > ZCOMPRESS="bzip2"
8 > > ZDECOMPRESS="bunzip2"
9 > > ZFILTER="bzip2"
10 > > ZUNFILTER="bunzip2"
11 > > ZRECOMPRESS="no"
12 >
13 > Why this indirection? Just for convienience or are there technical
14 > reasons? If it's just convienience then you don't need this, just
15 > utilize the "source" command in make.conf. Anyway, there is no place for
16 > one-letter vars in make.*
17
18 I see no way of avoiding making things hard coded without making a
19 sepparate file for each compression method.
20
21 > > The following subsystems would "source" one of these files to get
22 > > their settings:
23 > >
24 > > PKG_
25 > > DOC_
26 > > MAN_
27 > > INFO_
28 > >
29 > > possibly others.
30 > >
31 > > So, if PKG_Z="bzip2", bzip2.sh would be read to set PKG_ZEXT,
32 > > PKG_TZEXT, PKG_ZCOMPRESS, etc.
33 >
34 > Why are those vars needed? Can't they be directly derived from the
35 > global ones?
36
37 Without these vars, how would you use bzip2 for packages but use gzip
38 for man pages (as the current gentoo does)? The global ones would all
39 be specific to one method of compression...
40
41 > > As these module files are sourced, individual config options could be
42 > > overridden via values in the environment. For example, if I wanted
43 > > gzip used across the board, but I wanted different levels of
44 > > compression for man pages and packages, I could do this in make.conf:
45 > >
46 > > Z="gzip"
47 > > PKG_ZCOMPRESS="gzip --best"
48 > > MAN_ZCOMPRESS="gzip --fast"
49 >
50 > Somehow this part looks like overengineering to me. Doesn't seem worth
51 > to introduce 7*4=28 new vars just for this.
52
53 Yeah, this is the problem I am stuck at: adding 28 new vars is
54 ridiculous, but I am having trouble seeing another way of doing this, so
55 I asked the mailing list.
56
57 I thought about it some more and perhaps a better way of doing this
58 would be to only specify the method of compression for each subsystem
59 using env vars. So, you would only have:
60
61 PORTAGE_COMPRESS_PKG
62 PORTAGE_COMPRESS_MAN
63 PORTAGE_COMPRESS_DOC
64 PORTAGE_COMPRESS_INFO
65
66 Then, something internal to portage would take the value of that var and
67 lookup the rest of what was needed somewhere else.
68
69 -jason pepas
70 --
71 gentoo-portage-dev@g.o mailing list