X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=zpm-repo;h=76359b8e2f6679ae2f80b01ea3779d1acf6a3b30;hp=0477952a6a4d17465066d5ced34bad920f533e79;hb=09c80a1f8918d888063f4d1a75921a99fe5f0b5c;hpb=fabeca432bfe4cdc427caec1aa57a91b07b63f3c diff --git a/zpm-repo b/zpm-repo index 0477952..76359b8 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 -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() { @@ -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