]> pd.if.org Git - zpackage/blobdiff - zpm-repo
let newpackage set additional fields
[zpackage] / zpm-repo
index 0477952a6a4d17465066d5ced34bad920f533e79..76359b8e2f6679ae2f80b01ea3779d1acf6a3b30 100755 (executable)
--- 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