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:
3380590
)
functions.sh: add a function for removing an item from a list in a shell variable
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 30 Jul 2008 20:35:22 +0000
(20:35 +0000)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 30 Jul 2008 20:35:22 +0000
(20:35 +0000)
SVN-Revision: 12024
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 af4eae23f59c229afce7ae88c10b366e6a6847a3..f4af4a857391a2f59175c5c9390f0f75bfec0378 100755
(executable)
--- a/
package/base-files/files/etc/functions.sh
+++ b/
package/base-files/files/etc/functions.sh
@@
-24,6
+24,20
@@
append() {
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
}
+list_remove() {
+ local var="$1"
+ local remove="$2"
+ local val
+
+ eval "val=\" \${$var} \""
+ val1="${val%% $remove *}"
+ [ "$val1" = "$val" ] && return
+ val2="${val##* $remove }"
+ [ "$val2" = "$val" ] && return
+ val="${val1## } ${val2%% }"
+ eval "export ${NO_EXPORT:+-n} -- \"$var=\$val\""
+}
+
config_load() {
[ -n "$IPKG_INSTROOT" ] && return 0
uci_load "$@"