X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-repo;h=4fe8845b65707434be197d20b79370b2623e109e;hb=6defaa81cc4390343fec861557c20bd87fbad86a;hp=0477952a6a4d17465066d5ced34bad920f533e79;hpb=fabeca432bfe4cdc427caec1aa57a91b07b63f3c;p=zpackage diff --git a/zpm-repo b/zpm-repo index 0477952..4fe8845 100755 --- a/zpm-repo +++ b/zpm-repo @@ -105,24 +105,23 @@ update_info() { fi if [ -f "$rf" ]; then # TODO merge in so packages aren't deleted - curl -f '-#' -z "$rf" -o "$rf.tmp" "$url" + zpm fetchurl -f '-#' -z "$rf" -o "$rf.tmp" "$url" rv=$? else - curl -f '-#' -o "$rf" "$url" && refresh "$repo" + zpm fetchurl -f '-#' -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() { @@ -146,11 +145,11 @@ 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 @@ -199,7 +198,7 @@ case $action in 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