From 05af716e5b8de8d9b093e7db197e1514b3fbeff3 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sun, 11 Sep 2022 11:54:12 +0200 Subject: [PATCH] Linking package's files in ROOT (and rebuilding directory tree). --- nixdeb.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/nixdeb.sh b/nixdeb.sh index 9c3f18c..323355c 100755 --- 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 -- 2.49.0