fi
if [ -f "$rf" ]; then
# TODO merge in so packages aren't deleted
- curl -f '-#' -z "$rf" -o "$rf.tmp" "$url"
+ zpm fetchurl -fpn -z "$rf" -o "$rf.tmp" "$url"
rv=$?
else
- curl -f '-#' -o "$rf" "$url" && refresh "$repo"
+ zpm fetchurl -fpn -o "$rf.tmp" "$url" && refresh "$repo"
rv=$?
fi
if [ $rv -eq 0 ]; then
- test -f "$rf.tmp" && mv "$rf.tmp" "$rf"
+ test -f "$rf.tmp" &&
+ zpm test "$rf.tmp" &&
+ mv "$rf.tmp" "$rf"
refresh "$repo"
fi
done
}
-# response=$(curl --write-out %{http_code} --silent --output /dev/null servername)
-# --head
-
head_response_code() {
- curl --write-out '%{http_code}' --silent --output /dev/null -z $2 $1
+ zpm fetchurl -S -z "$2" "$1"
}
download() {
continue
fi
echo downloading $pkgid
- curl -f '-#' -z "$dest" -o "$dest.tmp" $fetch
+ zpm fetchurl -f '-#' -z "$dest" -o "$dest.tmp" $fetch
mv "$dest.tmp" "$dest"
else
echo downloading $pkgid
- curl -f '-#' -o "$dest.tmp" $fetch
+ zpm fetchurl -f '-#' -o "$dest.tmp" $fetch
mv "$dest.tmp" "$dest"
fi
fi
name=$(zpm quote "$1")
zpm shell $ZPMDB "delete from repository where name = '$name'"
rm -f $repodir/$1.repo
- # TODO delete caches
+ test -d "$repodir/$repo" && rm -r "$repodir/$repo"
;;
url)
if [ -n "$2" ]; then