+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
+
+if [ $(id -u) -eq 0 ]; then
+ if [ ! -d $rootdir/etc ]; then
+ warn "no etc directory in $rootdir, skipping ldconfig"
+ elif [ -f $rootdir/sbin/ldconfig ]; then
+ $rootdir/sbin/ldconfig -r ${rootdir:-/}
+ elif [ -f /sbin/ldconfig ]; then
+ /sbin/ldconfig -r ${rootdir:-/}
+ else
+ true