Newer
Older
local p="/usr/share/base-seblu/${1##*/}"
[[ -n "$2" ]] && p="/usr/share/base-seblu/$2"
if [[ ! -e "$1" ]] || ! diff "$1" "$p" >/dev/null; then
cp -f -v "$p" "$1"
fi
}
# $1: the link target
# $2: the link himself
check_link() {
_ct="$(readlink "$2")"
if (( $? != 0 )) || [[ "$_ct" != "$1" ]]; then
ln -vsnf "$1" "$2"
fi
# arg 1: the new package version
post_install() {
check_file /etc/motd
check_file /etc/issue
check_file /etc/vconsole.conf
check_file /etc/locale.conf
check_file /etc/ntp.conf
check_file /etc/e2fsk.conf
check_file /etc/sysctl.d/seblu.net.conf
check_file /etc/zsh/zshrc etc.zshrc
# localtime
check_link '/usr/share/zoneinfo/Europe/Paris' /etc/localtime
# locales
_md5="$(md5sum /etc/locale.gen)"
sed -ri 's/#(en_US|fr_FR)/\1/' /etc/locale.gen
[[ "$_md5" != "$(md5sum /etc/locale.gen)" ]] && locale-gen
# check full hostname
grep -q \. /etc/hostname || echo '!! /etc/hostname without FQDN'
# sbin must be a symlink
if [[ ! -L /usr/local/sbin ]]; then
echo '!! /usr/local/sbin is not a symlink'
rmdir '/usr/local/sbin' && ln -sn bin /usr/local/sbin
fi
# display depency info
echo '-- Unused dependencies:'; pacman -Qdt
echo '-- Local-only packages'; pacman -Qm