Index: systemd-207.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-207.ebuild,v retrieving revision 1.2 diff -u -r1.2 systemd-207.ebuild --- systemd-207.ebuild 14 Sep 2013 18:44:05 -0000 1.2 +++ systemd-207.ebuild 16 Sep 2013 01:20:25 -0000 @@ -262,6 +262,45 @@ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf } +migrate_locale() { + local envd_locale="${EROOT%/}/etc/env.d/02locale" + local locale_conf="${EROOT%/}/etc/locale.conf" + + if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then + if [[ -e ${envd_locale} ]]; then + # 02locale exists, but locale.conf does not; move it. + ebegin "Moving ${envd_locale} to ${locale_conf}" + mv "${envd_locale}" "${locale_conf}" + eend $? + else + # Otherwise, create a dummy file + ebegin "Creating ${locale_conf}" + cat > "${locale_conf}" <<-EOF + # This file has been generated by the sys-apps/systemd ebuild. + # See locale.conf(5) and localectl(1). + EOF + eend $? + fi + fi + + if [[ ! -L ${envd_locale} ]]; then + if [[ -e ${envd_locale} ]]; then + # 02locale exists, but is not a symlink; warn the user. + # This should only happen if locale.conf also exists, or if the mv command failed. + ewarn "To ensure consistent behavior, you should replace ${envd_locale}" + ewarn "with a symlink to ${locale_conf}. Please migrate your settings" + ewarn "and create the symlink with the following command:" + ewarn "ln -snf ../locale.conf ${envd_locale}" + else + # Otherwise, create the symlink. + ebegin "Creating ${envd_locale} -> ../locale.conf symlink" + ln -s ../locale.conf "${envd_locale}" + eend $? + fi + + fi +} + pkg_postinst() { # for udev rules enewgroup dialout @@ -286,6 +325,9 @@ # Bug 468876 fcaps cap_dac_override,cap_sys_ptrace=ep usr/bin/systemd-detect-virt + # Bug 465468 + migrate_locale + if [[ ! -L "${ROOT}"/etc/mtab ]]; then ewarn "Upstream mandates the /etc/mtab file should be a symlink to /proc/mounts." ewarn "Not having it is not supported by upstream and will cause tools like 'df'"