Linking package's files in ROOT (and rebuilding directory tree).
authorAndrea Zagli <azagli@libero.it>
Sun, 11 Sep 2022 09:54:12 +0000 (11:54 +0200)
committerAndrea Zagli <azagli@libero.it>
Sun, 11 Sep 2022 09:54:12 +0000 (11:54 +0200)
nixdeb.sh

index 9c3f18ce13b7cd7ef64a0092cb0646a6e8cf937c..323355cf1db51d0aaa338eea7e29ac96dde8f0b1 100755 (executable)
--- a/nixdeb.sh
+++ b/nixdeb.sh
@@ -19,14 +19,21 @@ dpkg --unpack --admindir=$ADMIN_DIR --instdir=$INSTALL_DIR_PKG $filename
 
 links () {
        dir=$1
-
        echo $dir
+
+       for i in $dir/*
+       do
+               if [ -d $i ]
+               then
+                       # directory creation in ROOT
+                       mkdir -p $ROOT_DIR${i/$INSTALL_DIR_PKG/}
+
+                       links $i
+               else
+                       # file link
+                       ln -s $(realpath $i) $ROOT_DIR${i/$INSTALL_DIR_PKG/}
+               fi
+       done
 }
 
-for i in $INSTALL_DIR_PKG/*
-do
-       if [ -d $i ]
-       then
-               links $(basename $i)
-       fi
-done
+links $INSTALL_DIR_PKG