diff mbox series

[5/5] build: remove shell.sh

Message ID a248c05a79ff4c8602e9050e08cbb8c9397969ba.1701746457.git.ehem+openwrt@m5p.com
State New
Headers show
Series Scripting tweaks | expand

Commit Message

Elliott Mitchell Dec. 1, 2023, 9:33 p.m. UTC
Handling common shell usage may have been valuable in the past.  Yet now
this is almost unused, so inline the single remaining use.  Then delete
the old file.

Signed-off-by: Elliott Mitchell <ehem+openwrt@m5p.com>
---
I've tried to test the removal.  I'm unsure I actually achieved
coverage, so a careful look at package/kernel/mac80211/Makefile by
someone else would be good.
---
 include/shell.sh                 | 15 ---------------
 include/unpack.mk                |  4 ++--
 package/kernel/mac80211/Makefile |  2 +-
 rules.mk                         |  1 -
 4 files changed, 3 insertions(+), 19 deletions(-)
 delete mode 100644 include/shell.sh
diff mbox series

Patch

diff --git a/include/shell.sh b/include/shell.sh
deleted file mode 100644
index 6ee0cf6030..0000000000
--- a/include/shell.sh
+++ /dev/null
@@ -1,15 +0,0 @@ 
-getvar() {
-	eval "echo \"\${$1}\""
-}
-
-var2file() {
-	local var
-	eval "var=\"\${$1}\""
-	if [ -n "$var" ]; then echo "$var" > "$2"; fi
-}
-
-isset() {
-	local var
-	eval "var=\"\${$1}\""
-	[ -n "$var" ]
-}
diff --git a/include/unpack.mk b/include/unpack.mk
index 5959d55f4b..a120a6093d 100644
--- a/include/unpack.mk
+++ b/include/unpack.mk
@@ -62,10 +62,10 @@  ifeq ($(strip $(UNPACK_CMD)),)
 endif
 
 ifdef PKG_BUILD_DIR
-  PKG_UNPACK ?= $(SH_FUNC) $(call UNPACK_CMD,$(PKG_BUILD_DIR))
+  PKG_UNPACK ?= $(call UNPACK_CMD,$(PKG_BUILD_DIR))
 endif
 ifdef HOST_BUILD_DIR
-  HOST_UNPACK ?= $(SH_FUNC) $(call UNPACK_CMD,$(HOST_BUILD_DIR))
+  HOST_UNPACK ?= $(call UNPACK_CMD,$(HOST_BUILD_DIR))
 endif
 
 endif # PKG_SOURCE
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 9016e2a525..8aef63d868 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -365,7 +365,7 @@  define Quilt/Refresh/Package
 endef
 
 define Build/Compile
-	$(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
+	[ -z "$$$${$(call shvar,mac80211_config)}" ] || echo "$$$${$(call shvar,mac80211_config)}" > "$(PKG_BUILD_DIR)/.config"
 	$(MAKE) $(MAKE_OPTS) allnoconfig
 	$(call Build/Compile/kmod)
 endef
diff --git a/rules.mk b/rules.mk
index 6f05047f26..f09ea1ecc4 100644
--- a/rules.mk
+++ b/rules.mk
@@ -234,7 +234,6 @@  endif
 export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
 export PATH:=$(TARGET_PATH)
 export STAGING_DIR STAGING_DIR_HOST STAGING_DIR_HOSTPKG
-export SH_FUNC:=. $(INCLUDE_DIR)/shell.sh;
 
 PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config