about summary refs log blame commit diff
path: root/corepkgs/channels/unpack.sh.in
blob: 1be4a39a1d9ce16bbfc10e1a4350ed2b769dbe11 (plain) (tree)
1
2
3
4
5
6

             

                          

           







                                            

                                                     

                                 
                             


                                            

    
     
                     
#! @shell@ -e

@coreutils@/mkdir $out
@coreutils@/mkdir $out/tmp
cd $out/tmp

inputs=($inputs)
for ((n = 0; n < ${#inputs[*]}; n += 2)); do
    channelName=${inputs[n]}
    channelTarball=${inputs[n+1]}
    echo "unpacking channel $channelName"
    @bunzip2@ < $channelTarball | @tar@ xf -

    nr=1
    attrName=$(echo $channelName | @tr@ -- '- ' '__')
    dirName=$attrName
    while test -e ../$dirName; do
        nr=$((nr+1))
        dirName=$attrName-$nr
    done

    @coreutils@/mv * ../$dirName # !!! hacky
done

cd ..
@coreutils@/rmdir tmp