+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 syncfs $syncopts
+
+syncrv=$?
+
+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
+ die 'zpm-syncfs failed';
+fi