commit:     7c558088fc8b3e4bf28ded33509ad971e72c8a4e
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 12 04:37:01 2017 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 12 04:37:01 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c558088

sys-apps/busybox: migrate to /run

 sys-apps/busybox/busybox-1.26.2.ebuild | 19 ++++++++++++-------
 sys-apps/busybox/busybox-9999.ebuild   | 19 ++++++++++++-------
 sys-apps/busybox/files/klogd.initd     |  2 +-
 sys-apps/busybox/files/ntpd.initd      |  2 +-
 sys-apps/busybox/files/syslogd.initd   |  2 +-
 sys-apps/busybox/files/watchdog.initd  |  2 +-
 6 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/sys-apps/busybox/busybox-1.26.2.ebuild 
b/sys-apps/busybox/busybox-1.26.2.ebuild
index 3d4a6cee553..af2ec1b08ef 100644
--- a/sys-apps/busybox/busybox-1.26.2.ebuild
+++ b/sys-apps/busybox/busybox-1.26.2.ebuild
@@ -36,17 +36,19 @@ S=${WORKDIR}/${MY_P}
 
 busybox_config_option() {
        local flag=$1 ; shift
-       if [[ ${flag} != [yn] ]] ; then
+       if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
                busybox_config_option $(usex ${flag} y n) "$@"
                return
        fi
+       local expr
        while [[ $# -gt 0 ]] ; do
-               if [[ ${flag} == "y" ]] ; then
-                       sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
-               else
-                       sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" 
.config
-               fi
-               einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find 
CONFIG_$1 ...)
+               case ${flag} in
+               y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
+               n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
+               *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
+               esac
+               sed -i -e "${expr}" .config || die
+               einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find 
CONFIG_$1 ...")"
                shift
        done
 }
@@ -125,6 +127,9 @@ src_configure() {
        busybox_config_option y ASH
        busybox_config_option n HUSH
 
+       busybox_config_option '"/run"' PID_FILE_PATH
+       busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
+
        # disable ipv6 applets
        if ! use ipv6; then
                busybox_config_option n FEATURE_IPV6

diff --git a/sys-apps/busybox/busybox-9999.ebuild 
b/sys-apps/busybox/busybox-9999.ebuild
index 3d4a6cee553..af2ec1b08ef 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-9999.ebuild
@@ -36,17 +36,19 @@ S=${WORKDIR}/${MY_P}
 
 busybox_config_option() {
        local flag=$1 ; shift
-       if [[ ${flag} != [yn] ]] ; then
+       if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
                busybox_config_option $(usex ${flag} y n) "$@"
                return
        fi
+       local expr
        while [[ $# -gt 0 ]] ; do
-               if [[ ${flag} == "y" ]] ; then
-                       sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
-               else
-                       sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" 
.config
-               fi
-               einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find 
CONFIG_$1 ...)
+               case ${flag} in
+               y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
+               n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
+               *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
+               esac
+               sed -i -e "${expr}" .config || die
+               einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find 
CONFIG_$1 ...")"
                shift
        done
 }
@@ -125,6 +127,9 @@ src_configure() {
        busybox_config_option y ASH
        busybox_config_option n HUSH
 
+       busybox_config_option '"/run"' PID_FILE_PATH
+       busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
+
        # disable ipv6 applets
        if ! use ipv6; then
                busybox_config_option n FEATURE_IPV6

diff --git a/sys-apps/busybox/files/klogd.initd 
b/sys-apps/busybox/files/klogd.initd
index 5c816e69ad7..95d5eb030d5 100644
--- a/sys-apps/busybox/files/klogd.initd
+++ b/sys-apps/busybox/files/klogd.initd
@@ -4,7 +4,7 @@
 
 command="/bin/busybox klogd"
 command_args="${KLOGD_OPTS}"
-pidfile="/var/run/klogd.pid"
+pidfile="/run/klogd.pid"
 
 depend() {
        need clock hostname

diff --git a/sys-apps/busybox/files/ntpd.initd 
b/sys-apps/busybox/files/ntpd.initd
index 4bc2011f4bb..dffea3bcde3 100644
--- a/sys-apps/busybox/files/ntpd.initd
+++ b/sys-apps/busybox/files/ntpd.initd
@@ -4,7 +4,7 @@
 
 command="/bin/busybox ntpd"
 command_args="${NTPD_OPTS}"
-pidfile="/var/run/ntpd.pid"
+pidfile="/run/ntpd.pid"
 
 depend() {
        use net dns logger

diff --git a/sys-apps/busybox/files/syslogd.initd 
b/sys-apps/busybox/files/syslogd.initd
index a4a7c99374d..b2ac5ac1722 100644
--- a/sys-apps/busybox/files/syslogd.initd
+++ b/sys-apps/busybox/files/syslogd.initd
@@ -4,7 +4,7 @@
 
 command="/bin/busybox syslogd"
 command_args="${SYSLOGD_OPTS}"
-pidfile="/var/run/syslogd.pid"
+pidfile="/run/syslogd.pid"
 
 depend() {
        need clock hostname

diff --git a/sys-apps/busybox/files/watchdog.initd 
b/sys-apps/busybox/files/watchdog.initd
index 6f71e26cfc3..89043738a7e 100644
--- a/sys-apps/busybox/files/watchdog.initd
+++ b/sys-apps/busybox/files/watchdog.initd
@@ -4,4 +4,4 @@
 
 command="/bin/busybox watchdog"
 command_args="${WATCHDOG_OPTS}"
-pidfile="/var/run/watchdog.pid"
+pidfile="/run/watchdog.pid"

Reply via email to