touch $CLFS/var/lib/pkg/db
fi
-$PKGADD -c $PKGADD_CONF -r $CLFS $@
+# be sure that the path to package file exists
+# and if not prepend the package dir variable
+ARGS=""
+while [ "$1" ]; do
+ case $1 in
+ *.pkg.tar.*)
+ PATH_TO_PACKAGE="$1"
+ if [ ! -f "$PATH_TO_PACKAGE" ]; then
+ PATH_TO_PACKAGE="$PKGMK_PACKAGE_DIR/$PATH_TO_PACKAGE"
+ fi
+ ARGS="$ARGS $PATH_TO_PACKAGE"
+ ;;
+ *)
+ ARGS="$ARGS $1"
+ ;;
+ esac
+ shift
+done
+
+$PKGADD -c $PKGADD_CONF -r $CLFS $ARGS
# End of file