X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-update;h=fcfb81668887476ce4aa872a051cb262dd312d92;hb=ab31dd7aa855abd018af75b1256b6dac89c1c51c;hp=44529783408c1c195c4524ae071d53e574c3622a;hpb=556cd1f04308ff45196f9422f1568cdd493171a7;p=zpackage diff --git a/zpm-update b/zpm-update index 4452978..fcfb816 100755 --- a/zpm-update +++ b/zpm-update @@ -102,13 +102,14 @@ install_for_libs='' backup=0 ignorelibdeps=0 justlist=0 +pullrepos=1 # treat un-adorned packages as uninstalls uninstall=0 # TODO option to attempt to resume an ongoing install # zpm-install [-SCn] [ -d localdb ] [ -f pkgfile ] [ -R installroot ] pkgstr ... -while getopts f:d:R:nSCvAObBLU opt; do +while getopts f:d:R:nSCvAObBLUz opt; do case $opt in f) pkgfile="$OPTARG" ;; d) localdb="$OPTARG" ;; @@ -126,6 +127,7 @@ while getopts f:d:R:nSCvAObBLU opt; do L) ignorelibdeps=1 ;; l) justlist=1 ;; U) uninstall=1 ;; + z) pullrepos=0 ;; *) die "usage ..." ;; esac done @@ -180,6 +182,11 @@ search=$(echo $search) ebail=0 +if [ $pullrepos -eq 1 ]; then + echo pulling repos + zpm repo pull +fi + if [ $ignorelibdeps -eq 1 ]; then merge=$(zpm search -iIO $search) else @@ -238,6 +245,12 @@ if [ -n "$baddl" ]; then die fi +for package in $merge; do + pkgid=${package%:*} + installlist="$installlist $pkgid" +done +installlist=${installlist#' '} + if [ $justlist -eq 1 ]; then for package in $merge; do pkgid=${package%:*} @@ -246,6 +259,7 @@ if [ $justlist -eq 1 ]; then for pkgid in $to_remove; do printf 'remove %s\n' $pkgid done + exit 0 fi if [ -z "$merge" ] && [ -z "$to_remove" ]; then @@ -253,7 +267,8 @@ if [ -z "$merge" ] && [ -z "$to_remove" ]; then exit 0 fi -echo "merge: $merge" +test -n "$merge" && echo "install: $installlist" +test -n "$to_remove" && echo "remove: $to_remove" # finally, merge everything for mergepkg in $merge; do @@ -266,6 +281,9 @@ for mergepkg in $merge; do if [ $pkgfile != $ZPMDB ]; then echo merging $pkgfile $pkgid zpm merge -Fuv -f "$pkgfile" $pkgid + if [ $? -ne 0 ]; then + die "unable to merge $pkgfile" + fi fi to_install="$to_install $pkgid" done