[source] treewide: remove bad local shell variable declarations

LEDE Commits lede-commits at lists.infradead.org
Sat Sep 24 05:43:09 PDT 2016


jow pushed a commit to source.git, branch master:
https://git.lede-project.org/1c09849f6cf1b8bd94819ca11910ce444c3d3019

commit 1c09849f6cf1b8bd94819ca11910ce444c3d3019
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Sat Sep 24 14:30:24 2016 +0200

    treewide: remove bad local shell variable declarations
    
    Local variable declarations outside of functions are illegal since the Busybox
    update to v1.25.0, therfore remove them from the appropriate places.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/base-files/files/etc/rc.button/rfkill                |  2 +-
 package/base-files/files/etc/uci-defaults/10_migrate-shadow  |  4 ++--
 .../base-files/etc/uci-defaults/03_network-vlan-migration    |  4 ++--
 target/linux/brcm47xx/base-files/etc/board.d/01_detect       |  6 +++---
 .../base-files/etc/uci-defaults/03_network_migration         | 12 ++++++------
 target/linux/lantiq/base-files/sbin/dsl_notify.sh            |  7 +------
 .../orion/generic/base-files/etc/uci-defaults/09_hardware    |  2 +-
 7 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/package/base-files/files/etc/rc.button/rfkill b/package/base-files/files/etc/rc.button/rfkill
index 9e2c12f..fbdda40 100755
--- a/package/base-files/files/etc/rc.button/rfkill
+++ b/package/base-files/files/etc/rc.button/rfkill
@@ -4,7 +4,7 @@
 
 . /lib/functions.sh
 
-local rfkill_state=0
+rfkill_state=0
 
 wifi_rfkill_set() {
 	uci set wireless.$1.disabled=$rfkill_state
diff --git a/package/base-files/files/etc/uci-defaults/10_migrate-shadow b/package/base-files/files/etc/uci-defaults/10_migrate-shadow
index b7ea571..a354844 100644
--- a/package/base-files/files/etc/uci-defaults/10_migrate-shadow
+++ b/package/base-files/files/etc/uci-defaults/10_migrate-shadow
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-local ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
-local spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
+ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
+spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
 
 if [ -n "${ppwd#[\!x]}" ] && [ -z "${spwd#[\!x]}" ]; then
 	logger -t migrate-shadow "Moving root password hash into shadow database"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-vlan-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-vlan-migration
index bea9493..259d240 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-vlan-migration
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-vlan-migration
@@ -3,8 +3,8 @@
 # Copyright (C) 2010 OpenWrt.org
 #
 
-local dev="$(uci -q get network. at switch_vlan[0].device)"
-local vlan="$(uci -q get network. at switch_vlan[0].vlan)"
+dev="$(uci -q get network. at switch_vlan[0].device)"
+vlan="$(uci -q get network. at switch_vlan[0].vlan)"
 
 if [ "$dev" = "rtl8366s" ] && [ "$vlan" = 0 ]; then
 	logger -t vlan-migration "VLAN 0 is invalid for RTL8366s, changing to 1"
diff --git a/target/linux/brcm47xx/base-files/etc/board.d/01_detect b/target/linux/brcm47xx/base-files/etc/board.d/01_detect
index 16b81d4..357cc7f 100755
--- a/target/linux/brcm47xx/base-files/etc/board.d/01_detect
+++ b/target/linux/brcm47xx/base-files/etc/board.d/01_detect
@@ -175,9 +175,9 @@ detect_by_model() {
 }
 
 
-local model="$(sed -ne 's/^machine[ \t]*: //p' /proc/cpuinfo)"
-local boardtype="$(nvram get boardtype)"
-local boardnum="$(nvram get boardnum)"
+model="$(sed -ne 's/^machine[ \t]*: //p' /proc/cpuinfo)"
+boardtype="$(nvram get boardtype)"
+boardnum="$(nvram get boardnum)"
 
 board_config_update
 
diff --git a/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration b/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration
index 912fe96..e430b41 100644
--- a/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration
+++ b/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration
@@ -8,12 +8,12 @@ uci show network | grep "\.vlan=0"
 
 logger -t network "network config is invalid, creating new one"
 
-local lan_proto="$(uci -q get network.lan.proto)"
-local lan_ipaddr="$(uci -q get network.lan.ipaddr)"
-local lan_netmask="$(uci -q get network.lan.netmask)"
-local wan_proto="$(uci -q get network.wan.proto)"
-local wan_ipaddr="$(uci -q get network.wan.ipaddr)"
-local wan_netmask="$(uci -q get network.wan.netmask)"
+lan_proto="$(uci -q get network.lan.proto)"
+lan_ipaddr="$(uci -q get network.lan.ipaddr)"
+lan_netmask="$(uci -q get network.lan.netmask)"
+wan_proto="$(uci -q get network.wan.proto)"
+wan_ipaddr="$(uci -q get network.wan.ipaddr)"
+wan_netmask="$(uci -q get network.wan.netmask)"
 
 echo "" > /etc/config/network
 config_generate
diff --git a/target/linux/lantiq/base-files/sbin/dsl_notify.sh b/target/linux/lantiq/base-files/sbin/dsl_notify.sh
index 01d0488..ba197f1 100755
--- a/target/linux/lantiq/base-files/sbin/dsl_notify.sh
+++ b/target/linux/lantiq/base-files/sbin/dsl_notify.sh
@@ -16,7 +16,6 @@
 include /lib/network
 scan_interfaces
 
-local led
 config_load system
 config_get led led_dsl sysfs
 if [ -n "$led" ]; then
@@ -28,18 +27,14 @@ if [ -n "$led" ]; then
 	esac
 fi
 
-local interfaces=`ubus list network.interface.\* | cut -d"." -f3`
-local ifc
+interfaces=`ubus list network.interface.\* | cut -d"." -f3`
 for ifc in $interfaces; do
 
-	local up
 	json_load "$(ifstatus $ifc)"
 	json_get_var up up
 
-	local auto
 	config_get_bool auto "$ifc" auto 1
 
-	local proto
 	json_get_var proto proto
 
 	if [ "$DSL_INTERFACE_STATUS" = "UP" ]; then
diff --git a/target/linux/orion/generic/base-files/etc/uci-defaults/09_hardware b/target/linux/orion/generic/base-files/etc/uci-defaults/09_hardware
index 7f727eb..5b30f27 100644
--- a/target/linux/orion/generic/base-files/etc/uci-defaults/09_hardware
+++ b/target/linux/orion/generic/base-files/etc/uci-defaults/09_hardware
@@ -10,7 +10,7 @@
 # This script sets system defaults for the hardware on firstboot
 #
 
-local hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
+hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
 
 wrt350nv2_default() {
 # leds



More information about the lede-commits mailing list