]> saetta.ns0.it Git - nixdeb/commitdiff
Script started.
authorAndrea Zagli <azagli@libero.it>
Sun, 11 Sep 2022 09:04:04 +0000 (11:04 +0200)
committerAndrea Zagli <azagli@libero.it>
Sun, 11 Sep 2022 09:04:04 +0000 (11:04 +0200)
nixdeb.sh [new file with mode: 0755]

diff --git a/nixdeb.sh b/nixdeb.sh
new file mode 100755 (executable)
index 0000000..9c3f18c
--- /dev/null
+++ b/nixdeb.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -x
+
+ADMIN_DIR=./nixdeb/admindir
+INSTALL_DIR=./nixdeb/store
+ROOT_DIR=./nixdeb/root
+
+mkdir -p $ADMIN_DIR
+mkdir -p $ROOT_DIR
+
+filename=$(apt-get download --print-uris $1 | awk '{print $2}')
+
+INSTALL_DIR_PKG=$INSTALL_DIR/$filename
+mkdir -p $INSTALL_DIR_PKG
+
+apt-get download $1
+dpkg --unpack --admindir=$ADMIN_DIR --instdir=$INSTALL_DIR_PKG $filename
+
+links () {
+       dir=$1
+
+       echo $dir
+}
+
+for i in $INSTALL_DIR_PKG/*
+do
+       if [ -d $i ]
+       then
+               links $(basename $i)
+       fi
+done