X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-update;h=39c111a2f17f6e7274bac7f298f09834b8e427ea;hb=6d870f79b078509b8c8c3d4625db35b35feaae0f;hp=80258b8308a34835fb5ccda80062f28aca6db74d;hpb=4ee9eb3faab6f30a89d07d9f80aeca456af05d80;p=zpackage diff --git a/zpm-update b/zpm-update index 80258b8..39c111a 100755 --- a/zpm-update +++ b/zpm-update @@ -109,7 +109,7 @@ 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:nSCvAObBLUz opt; do +while getopts f:d:R:nSCvAObBLUzp opt; do case $opt in f) pkgfile="$OPTARG" ;; d) localdb="$OPTARG" ;; @@ -128,13 +128,26 @@ while getopts f:d:R:nSCvAObBLUz opt; do l) justlist=1 ;; U) uninstall=1 ;; z) pullrepos=0 ;; + p) syncopts="$syncopts -p" ;; *) die "usage ..." ;; esac done -shift $(( OPTIND - 1)) +shift $(( OPTIND - 1 )) + +if [ -n "$rootdir" ]; then + : rootdir=${rootdir%%/} + ZPM_ROOT_DIR=$rootdir + export ZPM_ROOT_DIR +fi + +if [ -n "$localdb" ]; then + ZPMDB=$localdb +elif [ -z "$ZPMDB" ]; then + ZPMDB="$ZPM_ROOT_DIR/var/lib/zpm/local.db" +fi -ZPMDB=${localdb:-${ZPMDB:-/var/lib/zpm/local.db}} export ZPMDB + # create the localdb if needed zpm init $ZPMDB @@ -245,6 +258,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%:*} @@ -261,7 +280,7 @@ if [ -z "$merge" ] && [ -z "$to_remove" ]; then exit 0 fi -test -n "$merge" && echo "install: $merge" +test -n "$merge" && echo "install: $installlist" test -n "$to_remove" && echo "remove: $to_remove" # finally, merge everything @@ -284,7 +303,9 @@ done to_install=${to_install#' '} -echo "installing: $to_install" +if [ -n "$to_install" ]; then + echo "installing: $to_install" +fi # absorb anything we're updating or removing, if absorb flag set @@ -314,12 +335,6 @@ if [ -n "$to_remove" ]; then done fi -if [ -n "$rootdir" ]; then - ZPM_ROOT_DIR=$rootdir - export ZPM_ROOT_DIR - : rootdir=${rootdir%%/} -fi - if [ $dryrun -gt 0 ]; then runscripts=0 # we don't want to run post scripts on a dry-run syncopts="$syncopts -n"