From 3ccd8fc3d78ce9dd6176e037b8e982164adc1583 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Fri, 29 Apr 2022 23:43:18 +0100 Subject: profiles/common: remove files not required from systemd profiles --- profiles/common/profile.bashrc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'profiles') 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 -- cgit v1.2.3