home · contact · privacy
Add new Buster setup (or at least beginnings of it).
[config] / buster / setup_scripts / install_for_target.sh
diff --git a/buster/setup_scripts/install_for_target.sh b/buster/setup_scripts/install_for_target.sh
new file mode 100755 (executable)
index 0000000..08723d5
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Walks through the package names in the argument-selected files of
+# apt-mark/ and ensures the respective packages are installed.
+#
+# Ignores anything in an apt-mark/ file after the last newline.
+set -e
+
+config_tree_prefix="${HOME}/config/buster"
+aptmark_dir="${config_tree_prefix}/apt-mark"
+
+for target in "$@"; do
+    path="${aptmark_dir}/${target}"
+    cat "${path}" | while read line; do
+        echo "$line"
+        if [ ! $(echo "${line}" | cut -c1) = "#" ]; then
+            apt-get -y install "${line}"
+        fi
+    done
+done