CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Added README-cross file (contains the old README before merge from upstream)
[pkgutils-cross.git] / pkgadd-cross
index d780311818e27a9481724d7d495bd6c4f70a7dd9..c3dd96e47ae3906c31752a0cb5fd3a09ad5c1f7e 100755 (executable)
@@ -3,6 +3,7 @@
 TOPDIR="$(cd $(dirname $(which $0)); pwd)"
 
 PKGADD=$TOPDIR/src/pkgadd
+PKGADD_CONF=$TOPDIR/src/pkgadd.conf
 PKGMK_CONF=$TOPDIR/src/pkgmk.conf
 . $PKGMK_CONF
 
@@ -17,10 +18,25 @@ if [ ! -f $CLFS/var/lib/pkg/db ]; then
   touch $CLFS/var/lib/pkg/db
 fi
 
-$PKGADD -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
 
-# we shoudl avoid .la files when crosscompiling, these files
-# contains the libdir variable hardcoded which is used by libtool
-[ $? -eq 0 ] && find $CLFS -type f -name '*.la' -delete
+$PKGADD -c $PKGADD_CONF -r $CLFS $ARGS
 
 # End of file