From 34dbf787c3fa13541abc9aadcf53c23016895382 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 10 Oct 2006 15:30:50 +0000 Subject: add support for a common shell include file, which is evaluated for every make shell call, simplify variable passing to the shell with shvar and shexport templates, use Package//config for adding config.in data git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@5014 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/shell.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/shell.sh (limited to 'include/shell.sh') diff --git a/include/shell.sh b/include/shell.sh new file mode 100644 index 000000000..6ee0cf603 --- /dev/null +++ b/include/shell.sh @@ -0,0 +1,15 @@ +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" ] +} -- cgit v1.2.3