# 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
}
--- /dev/null
+# ~/.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"
+
--- /dev/null
+# ~/.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"
--- /dev/null
+../../.plomlib
+lib
--- /dev/null
+file_dot_variants() {
+ for FILE in ${1}\.*; do
+ if [ -f "${FILE}" ]; then
+ . "${FILE}"
+ fi
+ done
+}
--- /dev/null
+# ~/.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"
--- /dev/null
+../home/plom/.bash_profile
\ No newline at end of file
--- /dev/null
+../home/plom/.bashrc
\ No newline at end of file
--- /dev/null
+../home/plom/.local
\ No newline at end of file
--- /dev/null
+../home/plom/.plomlib
\ No newline at end of file
--- /dev/null
+../home/plom/.profile
\ No newline at end of file
#!/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