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