1 |
On Monday 04 August 2003 16:28, splite-gentoo@××××××××××××××××.edu wrote: |
2 |
> Non-GNU tars don't support the "-z", "--files-from", "--no-recursion", |
3 |
> "--exclude", or "--no-same-owner" flags either. emerge-webrsync and |
4 |
> quickpkg already use the "-j" flag. |
5 |
|
6 |
ugh, quickpkg also uses 'no-recursion' ... and unpack() in ebuild.sh uses |
7 |
'no-same-owner' ... any ideas on how to get around the owner bug ? if we |
8 |
want the userpriv to be a reality we need that ... |
9 |
|
10 |
how about we just replace bsd-tar's with GNU tars ;) |
11 |
|
12 |
seriously though, the problem i have with piping into tar is that you cant |
13 |
catch errors ... (i hope someone can correct me though) |
14 |
|
15 |
for example: |
16 |
bzcat t.tbz2 | tar xf - || echo "oh no i failed" |
17 |
assume that t.tbz2 either doesnt exist, or is invalid bz2 file, or cant be |
18 |
read ... whatever, the point is bzcat fails ... |
19 |
that failure results in a pretty little msg that informs us that t.tbz2 was |
20 |
unable to be decompressed. so, bzcat returns non 0 ... but what does that |
21 |
mean for tar ? |
22 |
bzcat produced 0 bytes in its stdout pipe so tar got 0 bytes in its stdin pipe |
23 |
... tar, unfortunately, doesnt seem to mind getting 0 bytes. it'll exit |
24 |
happily with a return of 0. |
25 |
|
26 |
anyone have thoughts on how to handle this as intended ? |
27 |
|
28 |
the ugly hack that i produced (as can be found in unpack_makeself() in |
29 |
eutils.eclass) is something like this: |
30 |
out="`bzcat t.tbz2 | tar xf - 2>1`" |
31 |
[ ! -z "${out}" ] && echo "oh no i failed" |
32 |
|
33 |
-mike |