X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=zpm-install;h=0a7cf3ed2a8335fe2d2ebede5c095ad264255fca;hp=0d2055af5b0ff82ae726f9a67e7af8c6c19695d4;hb=77544f57c8617cf232cdf21e02924ae03d4da685;hpb=d5ca5d7feac6f51e5ef1a968eda7ca2896c11d95 diff --git a/zpm-install b/zpm-install index 0d2055a..0a7cf3e 100755 --- a/zpm-install +++ b/zpm-install @@ -10,6 +10,12 @@ die() { exit 1 } +changeall() { + for pkgid in $(zpm list -s $1); do + zpm pkg $pkgid status=$2 + done +} + dryrun=0 verbose=0 runscripts=1 @@ -167,6 +173,8 @@ for pkgid in $pkglist; do else zpm pkg $pkgid status=installing fi + + zpm shell "$ZPMDB" "update packages set status='updating' where status='installed' and package in (select package from packages where status = 'installing')" done # do the sync @@ -184,6 +192,8 @@ if [ "$pkgfile" != "$ZPMDB" ]; then syncopts="$syncopts -f $pkgfile" fi +#zpm shell $ZPMDB 'select * from syncinfo' +#zpm list -v zpm syncfs $syncopts syncrv=$? @@ -213,12 +223,12 @@ fi for pkgid in $pkglist; do package=$(zpm parse -n $pkgid) - current=$(zpm list -s installed "$package") + current=$(zpm list -s updating "$package") if [ $runscripts -gt 0 ]; then - zpm script -f $pkgfile -p post-install $pkgid $current + zpm script -p post-install $pkgid $current else - if zpm script -f $pkgfile -Fql -p post-install $pkgid; then + if zpm script -Fql -p post-install $pkgid; then zpm note -e -p $pkgid -m 'post-install script not run' fi fi @@ -232,11 +242,13 @@ for pkgid in $pkglist; do # TODO skip configure if not on a terminal, regardless of settings # TODO will need force option if [ $runconfigure -gt 0 ]; then - zpm script -f $pkgfile -p configure $pkgid + zpm script -p configure $pkgid else - if zpm script -f $pkgfile -Fql -p configure $pkgid; then + if zpm script -Fql -p configure $pkgid; then zpm note -e -p $pkgid -m 'configure script not run' fi fi done + +changeall updating updated