projects
/
openwrt
/
staging
/
mans0n.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d883da
)
functions.sh: add list_contains function for checking whether a list contains a speci...
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 30 Jul 2008 22:39:43 +0000
(22:39 +0000)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 30 Jul 2008 22:39:43 +0000
(22:39 +0000)
SVN-Revision: 12025
package/base-files/files/etc/functions.sh
patch
|
blob
|
history
diff --git
a/package/base-files/files/etc/functions.sh
b/package/base-files/files/etc/functions.sh
index f4af4a857391a2f59175c5c9390f0f75bfec0378..01db77ce39559ed38599c429a7ac1e9a025cb7a6 100755
(executable)
--- a/
package/base-files/files/etc/functions.sh
+++ b/
package/base-files/files/etc/functions.sh
@@
-24,6
+24,15
@@
append() {
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
}
+list_contains() {
+ local var="$1"
+ local str="$2"
+ local val
+
+ eval "val=\" \${$var} \""
+ [ "${val%% $str *}" != "$val" ]
+}
+
list_remove() {
local var="$1"
local remove="$2"