From: Christian Heller Date: Thu, 21 Aug 2025 11:41:14 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/blog?a=commitdiff_plain;h=9268f975884e937797c46029503ca74f76fc4a2c;p=config Fix. --- diff --git a/bookworm/scripts/lib/copy_dirtrees_of_tags.sh b/bookworm/scripts/lib/copy_dirtrees_of_tags.sh index 575adcc..21cb548 100644 --- a/bookworm/scripts/lib/copy_dirtrees_of_tags.sh +++ b/bookworm/scripts/lib/copy_dirtrees_of_tags.sh @@ -38,7 +38,7 @@ copy_dirtrees_of_tags() { # actual file copying CREATION_SUMMARY=$(cp -avL "${PATH_REL}" "${PATH_TARGET_PARENT}") - _CREATED_PATHS=$(echo "${CREATION_SUMMARY}" | grep -v -E '^removed ' | sed -E "s/'\$//g" | sed "s/.*' -> '//g") + CREATED_PATHS=$(echo "${CREATION_SUMMARY}" | grep -v -E '^removed ' | sed -E "s/'\$//g" | sed "s/.*' -> '//g") PATHS_WRITTEN="${CREATED_PATHS}\n${PATHS_WRITTEN}" done } diff --git a/trixie/copy/all/home/plom/.bash_profile b/trixie/copy/all/home/plom/.bash_profile new file mode 100644 index 0000000..316cf19 --- /dev/null +++ b/trixie/copy/all/home/plom/.bash_profile @@ -0,0 +1,8 @@ +# ~/.bash_profile, if it exists, is sourced by Bash for all login shells, +# instead of ~/.profile +# +# While I prefer using ~/.profile, I provide ~/.bash_profile because some +# applications write to it even if it does not previously exist, which +# deactivates ~/.profile if not explicitly sourced from within here. +. "${HOME}/.profile" + diff --git a/trixie/copy/all/home/plom/.bashrc b/trixie/copy/all/home/plom/.bashrc new file mode 100644 index 0000000..d3279cd --- /dev/null +++ b/trixie/copy/all/home/plom/.bashrc @@ -0,0 +1,28 @@ +# ~/.bashrc is sourced by Bash for any interactive shells. + +# Use vim as default editor for anything. +export VISUAL=vim +export EDITOR="${VISUAL}" + +# Some helpful aliases. +alias ls="ls --color=auto" + +# Colored prompt with username, hostname, date/time, directory. +COLOR_NUMBER=7 # default to white +COLOR_NUMBER_FILE="${HOME}/.shell_prompt_color" +[ -f "${COLOR_NUMBER_FILE}" ] && COLOR_NUMBER=`cat "${COLOR_NUMBER_FILE}"` +tput_color="$(tput setaf "${COLOR_NUMBER}")$(tput bold)" +tput_reset="$(tput sgr0)" +# Bash confuses the line length when not told to not count escape sequences. +if [ -n "${BASH}" ]; then + tput_color="\[$tput_color\]" + tput_reset="\[$tput_reset\]" +fi +PS1="${tput_color}["\$\(date\ +%Y-%m-%d/%H:%M:%S/%Z\)" $(whoami)@$(hostname):"\$\(pwd\)"]$ ${tput_reset}" +PS2="${tput_color}> ${tput_reset}" +PS3="${tput_color}select: ${tput_reset}" +PS4="${tput_color}+ ${tput_reset}" + +# include others +. "${HOME}/.plomlib/file_dot_variants.sh" +file_dot_variants "${HOME}/\.bashrc" diff --git a/trixie/copy/all/home/plom/.local/bin/LINK_ME b/trixie/copy/all/home/plom/.local/bin/LINK_ME new file mode 100644 index 0000000..6750cfc --- /dev/null +++ b/trixie/copy/all/home/plom/.local/bin/LINK_ME @@ -0,0 +1,2 @@ +../../.plomlib +lib diff --git a/trixie/copy/all/home/plom/.plomlib/file_dot_variants.sh b/trixie/copy/all/home/plom/.plomlib/file_dot_variants.sh new file mode 100644 index 0000000..1c1bf69 --- /dev/null +++ b/trixie/copy/all/home/plom/.plomlib/file_dot_variants.sh @@ -0,0 +1,7 @@ +file_dot_variants() { + for FILE in ${1}\.*; do + if [ -f "${FILE}" ]; then + . "${FILE}" + fi + done +} diff --git a/trixie/copy/all/home/plom/.profile b/trixie/copy/all/home/plom/.profile new file mode 100644 index 0000000..91bd8b1 --- /dev/null +++ b/trixie/copy/all/home/plom/.profile @@ -0,0 +1,20 @@ +# ~/.profile is sourced on login, with its exports inherited by all processes +# started below it under the same login, i.e. it has a very deep effect, but +# changes to it only apply to new login sessions (compare to e.g. ~/.bashrc +# which by is sourced anew for every new interactive Bash, login or not). +# +# Notably this makes ~/.profile (outside its optional sourcing of ~/.bashrc) +# useful for providing environment variables to non-shell applications started +# within a login session. +PATH_BASHRC="${HOME}/.bashrc" +[ -n "${BASH_VERSION}" -a -f "${PATH_BASHRC}" ] && . "${PATH_BASHRC}" + +PATH_LOCAL_BIN="${HOME}/.local/bin" +[ -d "${PATH_LOCAL_BIN}" ] && PATH="${PATH_LOCAL_BIN}:${PATH}" + +# local changes to this shell variable otherwise will get lost +export PATH + +# include others +. "${HOME}/.plomlib/file_dot_variants.sh" +file_dot_variants "${HOME}/\.profile" diff --git a/trixie/copy/all/root/.bash_profile b/trixie/copy/all/root/.bash_profile new file mode 120000 index 0000000..ecf4029 --- /dev/null +++ b/trixie/copy/all/root/.bash_profile @@ -0,0 +1 @@ +../home/plom/.bash_profile \ No newline at end of file diff --git a/trixie/copy/all/root/.bashrc b/trixie/copy/all/root/.bashrc new file mode 120000 index 0000000..9ebea20 --- /dev/null +++ b/trixie/copy/all/root/.bashrc @@ -0,0 +1 @@ +../home/plom/.bashrc \ No newline at end of file diff --git a/trixie/copy/all/root/.local b/trixie/copy/all/root/.local new file mode 120000 index 0000000..bad616a --- /dev/null +++ b/trixie/copy/all/root/.local @@ -0,0 +1 @@ +../home/plom/.local \ No newline at end of file diff --git a/trixie/copy/all/root/.plomlib b/trixie/copy/all/root/.plomlib new file mode 120000 index 0000000..76e877f --- /dev/null +++ b/trixie/copy/all/root/.plomlib @@ -0,0 +1 @@ +../home/plom/.plomlib \ No newline at end of file diff --git a/trixie/copy/all/root/.profile b/trixie/copy/all/root/.profile new file mode 120000 index 0000000..edcf39c --- /dev/null +++ b/trixie/copy/all/root/.profile @@ -0,0 +1 @@ +../home/plom/.profile \ No newline at end of file diff --git a/trixie/copy/all/root/.shell_prompt_color b/trixie/copy/all/root/.shell_prompt_color new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/trixie/copy/all/root/.shell_prompt_color @@ -0,0 +1 @@ +1 diff --git a/trixie/scripts/minimize_installation.sh b/trixie/scripts/minimize_installation.sh index e46f0c9..082217c 100755 --- a/trixie/scripts/minimize_installation.sh +++ b/trixie/scripts/minimize_installation.sh @@ -1,37 +1,43 @@ #!/bin/sh set -e -cd $(dirname "$0") +ROOT=$(dirname "$0") +cd "${ROOT}" . lib/apt_digested.sh +. lib/constants_etc.sh # PATH_ETC . lib/ensure_packages_of_tags.sh . lib/prefixed_msg.sh prefixed_msg_init -_INSTALL_TAGS="$@" -prefixed_msg "narrow system to what is required explicitly by Debian and by us, as per these INSTALL_TAGS: ${_INSTALL_TAGS}" +INSTALL_TAGS="$@" +prefixed_msg "narrow system to what is required explicitly by Debian and by us, as per these INSTALL_TAGS: ${INSTALL_TAGS}" -_TOK_REQ='required' -_PATH_LIST_PREFIX=/tmp/list_ -_PATH_LIST_UNSORTED="${_PATH_LIST_PREFIX}unsorted" -_PATH_LIST_WHITE="${_PATH_LIST_PREFIX}white" -_PATH_LIST_ALL_PACKAGES="${_PATH_LIST_PREFIX}all_packages" -_PATH_LIST_BLACK="${_PATH_LIST_PREFIX}black" +PATH_ETC_APT_MINIMIZE=${PATH_ETC}/apt/apt.conf.d/99_minimize_dependencies +prefixed_msg "Copying over ${PATH_ETC_APT_MINIMIZE} …" +cp "../copy/all${PATH_ETC_APT_MINIMIZE}" "${PATH_ETC_APT_MINIMIZE}" -prefixed_msg_no_nl "collect packages deemed '${_TOK_REQ}' by Debian: " -dpkg-query -Wf '${Package} ${Priority}\n' | grep " ${_TOK_REQ}" | cut -d' ' -f1 > "${_PATH_LIST_UNSORTED}" -sort "${_PATH_LIST_UNSORTED}" > "${_PATH_LIST_WHITE}" -echo $(cat "${_PATH_LIST_WHITE}") +TOK_REQ='required' +PATH_LIST_PREFIX=/tmp/list_ +PATH_LIST_UNSORTED="${PATH_LIST_PREFIX}unsorted" +PATH_LIST_WHITE="${PATH_LIST_PREFIX}white" +PATH_LIST_ALL_PACKAGES="${PATH_LIST_PREFIX}all_packages" +PATH_LIST_BLACK="${PATH_LIST_PREFIX}black" + +prefixed_msg_no_nl "collect packages deemed '${TOK_REQ}' by Debian: " +dpkg-query -Wf '${Package} ${Priority}\n' | grep " ${TOK_REQ}" | cut -d' ' -f1 > "${PATH_LIST_UNSORTED}" +sort "${PATH_LIST_UNSORTED}" > "${PATH_LIST_WHITE}" +echo $(cat "${PATH_LIST_WHITE}") prefixed_msg 'collect installed packages outside this selection …' -dpkg-query -Wf '${Package}\n' > "${_PATH_LIST_UNSORTED}" -sort "${_PATH_LIST_UNSORTED}" > "${_PATH_LIST_ALL_PACKAGES}" -comm -3 "${_PATH_LIST_ALL_PACKAGES}" "${_PATH_LIST_WHITE}" > "${_PATH_LIST_BLACK}" +dpkg-query -Wf '${Package}\n' > "${PATH_LIST_UNSORTED}" +sort "${PATH_LIST_UNSORTED}" > "${PATH_LIST_ALL_PACKAGES}" +comm -3 "${PATH_LIST_ALL_PACKAGES}" "${PATH_LIST_WHITE}" > "${PATH_LIST_BLACK}" prefixed_msg 'apt-mark auto from diff …' -apt-mark auto `cat "${_PATH_LIST_BLACK}"` > /dev/null -rm "${_PATH_LIST_UNSORTED}" "${_PATH_LIST_ALL_PACKAGES}" "${_PATH_LIST_WHITE}" "${_PATH_LIST_BLACK}" +apt-mark auto `cat "${PATH_LIST_BLACK}"` > /dev/null +rm "${PATH_LIST_UNSORTED}" "${PATH_LIST_ALL_PACKAGES}" "${PATH_LIST_WHITE}" "${PATH_LIST_BLACK}" prefixed_msg 'install or mark as manually installed packages from our own selections …' -ensure_packages_of_tags ${_INSTALL_TAGS} +ensure_packages_of_tags ${INSTALL_TAGS} prefixed_msg 'run autopurge to get rid of all unwanted packages …' apt_digested -q -q autopurge