X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;ds=sidebyside;f=bookworm%2Fsetup_scripts%2Finstall_for_target.sh;fp=bookworm%2Fsetup_scripts%2Finstall_for_target.sh;h=6f42b5619d2a3a17ccff12bf1a13387c777c4cef;hb=f50c2ff925fb389818dcb23a684acc0275821a36;hp=0000000000000000000000000000000000000000;hpb=be700ff9e26fbe05a6e70d50ca636c22b0f741fe;p=config diff --git a/bookworm/setup_scripts/install_for_target.sh b/bookworm/setup_scripts/install_for_target.sh new file mode 100755 index 0000000..6f42b56 --- /dev/null +++ b/bookworm/setup_scripts/install_for_target.sh @@ -0,0 +1,20 @@ +#!/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/bullseye" +aptmark_dir="${config_tree_prefix}/apt-mark" + +for target in "$@"; do + path="${aptmark_dir}/${target}" + # TODO: continue if file at $path not found, to get rid of dummy files + cat "${path}" | while read line; do + echo "$line" + if [ ! $(echo "${line}" | cut -c1) = "#" ]; then + DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::=--force-confold install "${line}" + fi + done +done