2004-04-21 16:54:05 +02:00
|
|
|
#! @shell@ -e
|
|
|
|
|
2005-03-15 13:03:15 +01:00
|
|
|
@coreutils@/mkdir $out
|
|
|
|
@coreutils@/mkdir $out/tmp
|
2004-04-21 16:54:05 +02:00
|
|
|
cd $out/tmp
|
|
|
|
|
|
|
|
expr=$out/default.nix
|
2007-05-02 01:16:38 +02:00
|
|
|
echo '{' > $expr
|
2004-04-21 16:54:05 +02:00
|
|
|
|
2007-05-02 01:16:38 +02:00
|
|
|
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
|
|
|
|
dirName=$channelName
|
|
|
|
while test -e ../$dirName; do
|
|
|
|
nr=$((nr+1))
|
|
|
|
dirName=$channelName-$nr
|
|
|
|
done
|
|
|
|
|
|
|
|
@coreutils@/mv * ../$dirName # !!! hacky
|
|
|
|
|
|
|
|
attrName=$(echo $dirName | @tr@ -- '- ' '__')
|
2007-05-16 18:17:04 +02:00
|
|
|
echo "$attrName = let e = import ./$dirName; in if builtins.isFunction e then e {} else e;" >> $expr
|
2004-04-21 16:54:05 +02:00
|
|
|
done
|
|
|
|
|
2007-05-02 01:16:38 +02:00
|
|
|
echo '} // {_combineChannels = true;}' >> $expr
|
2004-04-21 16:54:05 +02:00
|
|
|
|
|
|
|
cd ..
|
2005-03-15 13:03:15 +01:00
|
|
|
@coreutils@/rmdir tmp
|