Commit ad9093f6 authored by Vitaly Lipatov's avatar Vitaly Lipatov

move string functions to strings module

parent 153e9cb8
...@@ -97,7 +97,7 @@ load_mod() ...@@ -97,7 +97,7 @@ load_mod()
done done
} }
load_mod config gettext alt spec load_mod config gettext alt spec strings
# check for needed version # check for needed version
if [ -n "$NEEDETERBUILD" ] ; then if [ -n "$NEEDETERBUILD" ] ; then
...@@ -107,29 +107,6 @@ if [ -n "$NEEDETERBUILD" ] ; then ...@@ -107,29 +107,6 @@ if [ -n "$NEEDETERBUILD" ] ; then
fi fi
fi fi
filter_strip_spaces()
{
sed -e "s|^ ||" | sed -e "s| \$||"
}
strip_spaces()
{
echo $@ | filter_strip_spaces
}
# drop listed options
# FIXME: do not handle args like -Uh, only -U -h separately
drop_args()
{
local ARGS="$1"
shift
local LISTIGNORE="$@"
echo "$ARGS" | sed -e "s|-[${LISTIGNORE/ /}]||g" | sed -e "s| \+| |g" | filter_strip_spaces
#echo "$ARGS" | \
# ( for i in $LISTIGNORE ; do sed -e "s|-$i||g" ; done ) #| sed -e "s| +| |g"
}
# Internal # Internal
detect_target_env() detect_target_env()
{ {
......
filter_strip_spaces()
{
sed -e "s| \+| |g" | \
sed -e "s|^ ||" | sed -e "s| \$||"
}
strip_spaces()
{
echo $@ | filter_strip_spaces
}
# Args: LIST1 LIST2 # Args: LIST1 LIST2
# do_exclude_list print LIST2 with field contains in LIST1 # do_exclude_list print LIST2 with field contains in LIST1
do_exclude_list() do_exclude_list()
...@@ -8,5 +19,17 @@ do_exclude_list() ...@@ -8,5 +19,17 @@ do_exclude_list()
for i in $2 ; do for i in $2 ; do
echo "$1" | grep -q -w $i || RES="$RES $i" echo "$1" | grep -q -w $i || RES="$RES $i"
done done
echo $RES echo $RES | filter_strip_spaces
}
# drop listed options
# FIXME: do not handle args like -Uh, only -U -h separately
drop_args()
{
local ARGS="$1"
shift
local LISTIGNORE="$@"
echo "$ARGS" | sed -e "s|-[${LISTIGNORE/ /}]||g" | sed -e "s| \+| |g" | filter_strip_spaces
#echo "$ARGS" | \
# ( for i in $LISTIGNORE ; do sed -e "s|-$i||g" ; done ) #| sed -e "s| +| |g"
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment