diff options
author | Bertrand Jacquin <bertrand@jacquin.bzh> | 2022-04-29 23:43:18 +0100 |
---|---|---|
committer | Bertrand Jacquin <bertrand@jacquin.bzh> | 2022-04-29 23:43:59 +0100 |
commit | 3ccd8fc3d78ce9dd6176e037b8e982164adc1583 (patch) | |
tree | a0b31a60620b726287bece4c28b8235746336226 | |
parent | sys-kernel/stable-sources: version bump (diff) | |
download | portage-3ccd8fc3d78ce9dd6176e037b8e982164adc1583.tar.xz |
profiles/common: remove files not required from systemd profiles
-rw-r--r-- | profiles/common/profile.bashrc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/profiles/common/profile.bashrc b/profiles/common/profile.bashrc index 8f5e5765..13648d5c 100644 --- a/profiles/common/profile.bashrc +++ b/profiles/common/profile.bashrc @@ -54,6 +54,36 @@ function __load_make_conf () { return $? } +function __drop-non-systemd () { + local _opt + + case "${EAPI:-0}" in + [5-6]) ;; + [7-8]) _opt="-r" ;; + *) die "Unsupported EAPI ${EAPI}" ;; + esac + + if ! has_version ${_opt} sys-apps/systemd ; then + return 0 + fi + + local -a _DIRS=( + /etc/conf.d + /etc/init.d + /etc/logrotate.d + /etc/syslog-ng + ) + + local _dir + for _dir in ${_DIRS[@]} ; do + _dir="${_ed}${_dir}" + if [[ -e "${_dir}" ]] ; then + einfo "Removing ${_dir#${_ed}}" + rm -rf "${_dir}" + fi + done +} + function __drop-nls-man-pages () { local -a _DIRS=( /usr/share/man @@ -360,6 +390,7 @@ function pre_pkg_preinst () { __save_bash_options set -o noglob + __drop-non-systemd __drop-nls-man-pages __drop-nls-locales __drop-doc |