hackage update

This commit is contained in:
bigeagle 2015-11-26 18:13:27 +08:00
parent 7d6cd5eed3
commit 0445d956e9

View File

@ -54,7 +54,7 @@ function hackage_mirror() {
echo "building download list" echo "building download list"
# substract local list from remote list # substract local list from remote list
comm <(sort $remote_pklist) <(sort $local_pklist) -3 | while read pk; do comm <(sort $remote_pklist) <(sort $local_pklist) -23 | while read pk; do
# limit concurrent level # limit concurrent level
bgcount=`jobs | wc -l` bgcount=`jobs | wc -l`
while [[ $bgcount -ge 5 ]]; do while [[ $bgcount -ge 5 ]]; do
@ -63,13 +63,20 @@ function hackage_mirror() {
done done
name="$pk.tar.gz" name="$pk.tar.gz"
if [[ ! -a package/$name ]]; then if [ ! -a package/$name ]; then
must_download "http://hackage.haskell.org/package/$pk/$name" "package/$name" & must_download "http://hackage.haskell.org/package/$pk/$name" "package/$name" &
else else
echo "skip existed: $name" echo "skip existed: $name"
fi fi
done done
# delete redundanty files
comm <(sort $remote_pklist) <(sort $local_pklist) -13 | while read pk; do
name="$pk.tar.gz"
echo "deleting ${name}"
rm "package/$name"
done
cp index.tar.gz 00-index.tar.gz cp index.tar.gz 00-index.tar.gz
} }