CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
fixed db usage for pkgadd-cross
[pkgutils-cross.git] / pkgadd-cross
index e4828165411ba713fc20f960a0f37f10cfb2cccc..d780311818e27a9481724d7d495bd6c4f70a7dd9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-TOPDIR="$(cd $(dirname $0); pwd)"
+TOPDIR="$(cd $(dirname $(which $0)); pwd)"
 
 PKGADD=$TOPDIR/src/pkgadd
 PKGMK_CONF=$TOPDIR/src/pkgmk.conf
@@ -12,6 +12,11 @@ if [ -z "$CLFS" ]; then
   exit 1
 fi
 
+if [ ! -f $CLFS/var/lib/pkg/db ]; then
+  install -d -m 0755 $CLFS/var/lib/pkg
+  touch $CLFS/var/lib/pkg/db
+fi
+
 $PKGADD -r $CLFS $@
 
 # we shoudl avoid .la files when crosscompiling, these files