summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2022-04-29 23:43:18 +0100
committerBertrand Jacquin <bertrand@jacquin.bzh>2022-04-29 23:43:59 +0100
commit3ccd8fc3d78ce9dd6176e037b8e982164adc1583 (patch)
treea0b31a60620b726287bece4c28b8235746336226 /profiles
parentsys-kernel/stable-sources: version bump (diff)
downloadportage-3ccd8fc3d78ce9dd6176e037b8e982164adc1583.tar.xz
profiles/common: remove files not required from systemd profiles
Diffstat (limited to 'profiles')
-rw-r--r--profiles/common/profile.bashrc31
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