exit 1
}
+changeall() {
+ for pkgid in $(zpm list -s $1); do
+ zpm pkg $pkgid status=$2
+ done
+}
+
dryrun=0
verbose=0
runscripts=1
fi
else
if zpm script -f $pkgfile -Fql -p pre-install $pkgid; then
- zpm note -p $pkgid -m 'pre-install script not run'
+ zpm note -e -p $pkgid -m 'pre-install script not run'
fi
fi
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
syncopts="$syncopts -f $pkgfile"
fi
+#zpm shell $ZPMDB 'select * from syncinfo'
+#zpm list -v
zpm syncfs $syncopts
syncrv=$?
-for pkgid in $pkglist; do
- zpm pkg $pkgid status=dryrun
-done
+if [ $dryrun -gt 0 ]; then
+ for pkgid in $pkglist; do
+ zpm pkg $pkgid status=dryrun
+ done
+fi
if [ $syncrv -ne 0 ]; then
zpm pkg $pkgid status=failed
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
- zpm note -p $pkgid -m 'post-install script not run'
+ if zpm script -Fql -p post-install $pkgid; then
+ zpm note -e -p $pkgid -m 'post-install script not run'
fi
fi
# 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
- zpm note -p $pkgid -m 'configure script not run'
+ if zpm script -Fql -p configure $pkgid; then
+ zpm note -e -p $pkgid -m 'configure script not run'
fi
fi
done
+
+changeall updating updated