1 |
On 01/15/2015 07:00 PM, Brian Dolbec wrote: |
2 |
> On Thu, 15 Jan 2015 17:27:23 -0800 |
3 |
> Zac Medico <zmedico@g.o> wrote: |
4 |
>> # Add -q to bzip2 opts, in order to avoid "trailing |
5 |
>> garbage after # EOF ignored" warning messages due to xpak trailer. |
6 |
>> + if comp == "bzip2": |
7 |
>> + decomp_cmd = |
8 |
>> "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}" |
9 |
>> + elif comp == "xz": |
10 |
>> + decomp_cmd = "xz -d" |
11 |
>> + elif comp == "gzip": |
12 |
>> + decomp_cmd = "gzip -d" |
13 |
>> + else: |
14 |
>> + raise AssertionError("Unexpected |
15 |
> |
16 |
> No offense, but yuk to the if foo .... else bar... else... |
17 |
|
18 |
It's simple and it works. Why don't we just go with this simple approach |
19 |
first, and add fancy stuff later on? |
20 |
|
21 |
> I already have code that does this much better, I decided I was going |
22 |
> to release it separately from catalyst because it is generally useful |
23 |
> and in many ways more future proof. I know you were interested in it, |
24 |
> but I hadn't gotten around to establishing it in a separate repo. I |
25 |
> also didn't know you were already working on this. |
26 |
> |
27 |
> I've attached it to this email for you to look over. It needs a bit of |
28 |
> work for an independent release, but it is easily extended with |
29 |
> configuration changes. It can also be easily extended with custom |
30 |
> commands if needed. |
31 |
> |
32 |
> If you are interested, it would not take long to have it release worthy |
33 |
> and in the tree. |
34 |
|
35 |
I am interested in your library, but it does much more than is needed in |
36 |
BinpkgExtractorAsync.The requirements are: |
37 |
|
38 |
1) Map bzip2, xz, or gzip to an appropriate decompression command. The |
39 |
command should be guaranteed to support -c and -q options, since |
40 |
BinpkgExtractorAsync relies on them. |
41 |
|
42 |
2) Respect the user's PORTAGE_BUNZIP2_COMMAND and PORTAGE_BZIP2_COMMAND |
43 |
variables. |
44 |
-- |
45 |
Thanks, |
46 |
Zac |