summaryrefslogtreecommitdiffstats
path: root/include/shell.sh
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-10-10 15:30:50 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-10-10 15:30:50 +0000
commit34dbf787c3fa13541abc9aadcf53c23016895382 (patch)
tree6156097aa76c3eb354e5af3e97c1857f2acf998a /include/shell.sh
parentbd97e26b6af3a3e3571b0e7164ab46380b8a03e6 (diff)
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/<pkgname>/config for adding config.in data
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@5014 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include/shell.sh')
-rw-r--r--include/shell.sh15
1 files changed, 15 insertions, 0 deletions
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" ]
+}