summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2014-03-02 16:12:01 +0000
committerMike Gilbert <floppym@gentoo.org>2014-03-02 16:12:01 +0000
commit8f182d3736f5dd8ccc80e8df5b2358ee8463c00b (patch)
tree3774825344448a987d8efe91ec5faeb748716a0b /sys-apps
parentFix manifest (diff)
downloadgentoo-2-8f182d3736f5dd8ccc80e8df5b2358ee8463c00b.tar.gz
gentoo-2-8f182d3736f5dd8ccc80e8df5b2358ee8463c00b.tar.bz2
gentoo-2-8f182d3736f5dd8ccc80e8df5b2358ee8463c00b.zip
Copy 80-net-name-slot.rules migration code from sys-fs/udev.
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/systemd/ChangeLog6
-rw-r--r--sys-apps/systemd/systemd-210.ebuild33
-rw-r--r--sys-apps/systemd/systemd-9999.ebuild33
3 files changed, 69 insertions, 3 deletions
diff --git a/sys-apps/systemd/ChangeLog b/sys-apps/systemd/ChangeLog
index e61533814bb4..d232a8c297cf 100644
--- a/sys-apps/systemd/ChangeLog
+++ b/sys-apps/systemd/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-apps/systemd
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/ChangeLog,v 1.231 2014/03/01 22:37:05 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/ChangeLog,v 1.232 2014/03/02 16:12:01 floppym Exp $
+
+ 02 Mar 2014; Mike Gilbert <floppym@gentoo.org> systemd-210.ebuild,
+ systemd-9999.ebuild:
+ Copy 80-net-name-slot.rules migration code from sys-fs/udev.
01 Mar 2014; Michał Górny <mgorny@gentoo.org> systemd-204-r1.ebuild,
systemd-208-r2.ebuild, systemd-208-r3.ebuild:
diff --git a/sys-apps/systemd/systemd-210.ebuild b/sys-apps/systemd/systemd-210.ebuild
index 348fb82c51f2..3a9df6ef2e35 100644
--- a/sys-apps/systemd/systemd-210.ebuild
+++ b/sys-apps/systemd/systemd-210.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-210.ebuild,v 1.3 2014/02/26 03:36:44 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-210.ebuild,v 1.4 2014/03/02 16:12:01 floppym Exp $
EAPI=5
@@ -352,6 +352,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
@@ -375,6 +403,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"
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"