summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/systemd/systemd-9999.ebuild')
-rw-r--r--sys-apps/systemd/systemd-9999.ebuild33
1 files changed, 32 insertions, 1 deletions
diff --git a/sys-apps/systemd/systemd-9999.ebuild b/sys-apps/systemd/systemd-9999.ebuild
index 766b5be16df4..93f689b04a3d 100644
--- a/sys-apps/systemd/systemd-9999.ebuild
+++ b/sys-apps/systemd/systemd-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-9999.ebuild,v 1.95 2014/02/26 03:36:44 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-9999.ebuild,v 1.96 2014/03/02 16:12:01 floppym Exp $
EAPI=5
@@ -373,6 +373,34 @@ migrate_locale() {
fi
}
+migrate_net_name_slot() {
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${EROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ -e ${net_setup_link} ]]; then
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $? || FAIL=1
+ fi
+}
+
pkg_postinst() {
enewgroup systemd-journal
if use http; then
@@ -396,6 +424,9 @@ pkg_postinst() {
# between OpenRC & systemd
migrate_locale
+ # Migrage 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
if [[ ${FAIL} ]]; then
eerror "One of the postinst commands failed. Please check the postinst output"
eerror "for errors. You may need to clean up your system and/or try installing"