sys-apps/busybox: migrate to /run
authorMike Frysinger <vapier@gentoo.org>
Sun, 12 Mar 2017 04:37:01 +0000 (20:37 -0800)
committerMike Frysinger <vapier@gentoo.org>
Sun, 12 Mar 2017 04:37:01 +0000 (20:37 -0800)
sys-apps/busybox/busybox-1.26.2.ebuild
sys-apps/busybox/busybox-9999.ebuild
sys-apps/busybox/files/klogd.initd
sys-apps/busybox/files/ntpd.initd
sys-apps/busybox/files/syslogd.initd
sys-apps/busybox/files/watchdog.initd

index 3d4a6cee55394bc222984b35a0964d94b20804c4..af2ec1b08efa384dcf3178268ca58001764d790f 100644 (file)
@@ -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
index 3d4a6cee55394bc222984b35a0964d94b20804c4..af2ec1b08efa384dcf3178268ca58001764d790f 100644 (file)
@@ -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
index 5c816e69ad73e0f8df1f1075eb0935927ebf4e62..95d5eb030d51740caeddabad184d939942136c40 100644 (file)
@@ -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
index 4bc2011f4bbdef5ae51eef637151988543caee19..dffea3bcde393eefcabacab60de102252b99d277 100644 (file)
@@ -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
index a4a7c99374dff1f7782a7d0b9ad3906f325fb350..b2ac5ac172218b81bd9fe3f2caf5fbef727ac000 100644 (file)
@@ -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
index 6f71e26cfc36b1272379d0667218b413daaea786..89043738a7e26db5e1e7f8a44d6357723d33ab04 100644 (file)
@@ -4,4 +4,4 @@
 
 command="/bin/busybox watchdog"
 command_args="${WATCHDOG_OPTS}"
-pidfile="/var/run/watchdog.pid"
+pidfile="/run/watchdog.pid"