X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=stretch%2Fsetup_scripts%2Finstall_for_target.sh;fp=stretch%2Fsetup_scripts%2Finstall_for_target.sh;h=3a42c4d5cbbf8d3e5fbf93db5f5daa00e0096fb9;hb=01de6e555d9675370c4314c4c51cee67ee554f49;hp=0000000000000000000000000000000000000000;hpb=bb8855ebe057c54a110d4f22eb8cc312220c80ff;p=config diff --git a/stretch/setup_scripts/install_for_target.sh b/stretch/setup_scripts/install_for_target.sh new file mode 100755 index 0000000..3a42c4d --- /dev/null +++ b/stretch/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/stretch" +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