aboutsummaryrefslogtreecommitdiffstats
path: root/include/shell.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-10 15:30:50 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-10-10 15:30:50 +0000
commit77acae652fa5607fc76b07ce3ce558e8a845de30 (patch)
tree6156097aa76c3eb354e5af3e97c1857f2acf998a /include/shell.sh
parent443d4b872619902bb2457c5e2dbdb9e9786a9b14 (diff)
downloadmaster-187ad058-77acae652fa5607fc76b07ce3ce558e8a845de30.tar.gz
master-187ad058-77acae652fa5607fc76b07ce3ce558e8a845de30.tar.bz2
master-187ad058-77acae652fa5607fc76b07ce3ce558e8a845de30.zip
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 0000000000..6ee0cf6030
--- /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" ]
+}