X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-update;h=e1accc87393faf4acf73923aa0e8d2b9399c6c6f;hb=2ac486ab18adbbb84563eafc0d67fa8da6ca7822;hp=dbec8b0ecf13f6fd94c219b4b03f68f5e9e5ee7c;hpb=562d7c77072b14a4db68926ce6c8ac3753a1bad0;p=zpackage diff --git a/zpm-update b/zpm-update index dbec8b0..e1accc8 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:nSCvAObBLUzp opt; do +while getopts f:d:R:nSCvAObBLUzpl opt; do case $opt in f) pkgfile="$OPTARG" ;; d) localdb="$OPTARG" ;; @@ -132,10 +132,22 @@ while getopts f:d:R:nSCvAObBLUzp opt; do *) 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 @@ -190,6 +202,8 @@ fi if [ $ignorelibdeps -eq 1 ]; then merge=$(zpm search -iIO $search) + # TODO search for libs anyway and put a note for non-installed + # library deps else merge=$(zpm search -iIO -l $search) fi @@ -225,7 +239,6 @@ for mergepkg in $merge; do nlist="$nlist $pkgid:$zpmfile" continue else - echo downloading $zpmfile zpm repo fetch $reponame $pkgid if [ -f "$zpmfile" ]; then nlist="$nlist $pkgid:$zpmfile" @@ -281,7 +294,7 @@ for mergepkg in $merge; do # TODO check for symlinks? if [ $pkgfile != $ZPMDB ]; then echo merging $pkgfile $pkgid - zpm merge -Fuv -f "$pkgfile" $pkgid + zpm merge -Fu -f "$pkgfile" $pkgid if [ $? -ne 0 ]; then die "unable to merge $pkgfile" fi @@ -323,12 +336,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" @@ -336,10 +343,11 @@ fi if [ $verbose -gt 0 ]; then syncopts="${syncopts} -v" -else - # force -v during development - syncopts="${syncopts} -v" fi +#else + # force -v during development + #syncopts="${syncopts} -v" +#fi if [ $dryrun -eq 0 ] && [ $backup -eq 1 ]; then true