- #zpm shell $ZPMDB 'select * from install_status' 1>&2
- if [ $dryrun -gt 0 ]; then
- #zpm list -v
- #zpm shell $ZPMDB 'select * from install_status'
- zpm pkgfiles -nv -f $pkgfile
+ 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
+
+#zpm shell $ZPMDB 'select * from install_status' 1>&2
+if [ $dryrun -gt 0 ]; then
+ syncopts="$syncopts -n"
+fi
+
+if [ $verbose -gt 0 ]; then
+ syncopts="$syncopts -v"
+fi
+
+if [ "$pkgfile" != "$ZPMDB" ]; then
+ syncopts="$syncopts -f $pkgfile"
+fi
+
+#zpm shell $ZPMDB 'select * from syncinfo'
+#zpm list -v
+zpm syncfs $syncopts
+
+syncrv=$?
+
+if [ $dryrun -gt 0 ]; then
+ for pkgid in $pkglist; do