2004-04-21 14:54:05 +00:00
|
|
|
#! @shell@ -e
|
|
|
|
|
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
|
|
|
|
|
|
|
|
expr=$out/default.nix
|
2007-05-01 23:16:38 +00:00
|
|
|
echo '{' > $expr
|
2004-04-21 14:54:05 +00:00
|
|
|
|
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]}
|
|
|
|
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 16:17:04 +00:00
|
|
|
echo "$attrName = let e = import ./$dirName; in if builtins.isFunction e then e {} else e;" >> $expr
|
2004-04-21 14:54:05 +00:00
|
|
|
done
|
|
|
|
|
2007-05-01 23:16:38 +00:00
|
|
|
echo '} // {_combineChannels = true;}' >> $expr
|
2004-04-21 14:54:05 +00:00
|
|
|
|
|
|
|
cd ..
|
2005-03-15 12:03:15 +00:00
|
|
|
@coreutils@/rmdir tmp
|