2004-04-21 17:54:05 +03:00
|
|
|
#! @shell@ -e
|
|
|
|
|
2010-02-02 19:01:16 +02:00
|
|
|
# Cygwin compatibility hack: bunzip2 expects cygwin.dll in $PATH.
|
|
|
|
export PATH=@coreutils@
|
|
|
|
|
2005-03-15 14:03:15 +02:00
|
|
|
@coreutils@/mkdir $out
|
|
|
|
@coreutils@/mkdir $out/tmp
|
2004-04-21 17:54:05 +03:00
|
|
|
cd $out/tmp
|
|
|
|
|
2007-05-02 02:16:38 +03:00
|
|
|
inputs=($inputs)
|
|
|
|
for ((n = 0; n < ${#inputs[*]}; n += 2)); do
|
|
|
|
channelName=${inputs[n]}
|
|
|
|
channelTarball=${inputs[n+1]}
|
2009-03-03 16:47:39 +02:00
|
|
|
|
2007-05-02 02:16:38 +03:00
|
|
|
echo "unpacking channel $channelName"
|
2009-03-03 16:47:39 +02:00
|
|
|
|
2007-05-02 02:16:38 +03:00
|
|
|
@bunzip2@ < $channelTarball | @tar@ xf -
|
|
|
|
|
2009-03-03 16:47:39 +02:00
|
|
|
if test -e */channel-name; then
|
|
|
|
channelName="$(@coreutils@/cat */channel-name)"
|
|
|
|
fi
|
|
|
|
|
2007-05-02 02:16:38 +03:00
|
|
|
nr=1
|
2007-09-17 19:08:24 +03:00
|
|
|
attrName=$(echo $channelName | @tr@ -- '- ' '__')
|
|
|
|
dirName=$attrName
|
2007-05-02 02:16:38 +03:00
|
|
|
while test -e ../$dirName; do
|
|
|
|
nr=$((nr+1))
|
2007-09-17 19:08:24 +03:00
|
|
|
dirName=$attrName-$nr
|
2007-05-02 02:16:38 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
@coreutils@/mv * ../$dirName # !!! hacky
|
2004-04-21 17:54:05 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
cd ..
|
2005-03-15 14:03:15 +02:00
|
|
|
@coreutils@/rmdir tmp
|