Commit 1ca09e66 authored by Vitaly Lipatov's avatar Vitaly Lipatov

introduce strip_spaces, filter_strip_spaces and use it

parent 7ef2344f
...@@ -170,8 +170,7 @@ do ...@@ -170,8 +170,7 @@ do
fi fi
done done
# remove extra space before list LISTBUILT=$(strip_spaces "$LISTBUILT")
LISTBUILT=$(echo "$LISTBUILT" | sed -e "s|^ ||")
test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is exist." test -z "$LISTBUILT" && fatal "Error: List for build is empty. Check if file is exist."
#LISTRPMARGS=`echo ${LISTRPMARGS} | sed -e "s/--nodeps//g"` #LISTRPMARGS=`echo ${LISTRPMARGS} | sed -e "s/--nodeps//g"`
} }
......
...@@ -107,6 +107,16 @@ if [ -n "$NEEDETERBUILD" ] ; then ...@@ -107,6 +107,16 @@ 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 # drop listed options
# FIXME: do not handle args like -Uh, only -U -h separately # FIXME: do not handle args like -Uh, only -U -h separately
drop_args() drop_args()
...@@ -171,12 +181,12 @@ do ...@@ -171,12 +181,12 @@ do
# echo is workaround for missed readlink # echo is workaround for missed readlink
LISTNAMES="$LISTNAMES $(readlink -f "$i" 2>/dev/null || realpath "$i" || echo "$i")" LISTNAMES="$LISTNAMES $(readlink -f "$i" 2>/dev/null || realpath "$i" || echo "$i")"
else else
# set target type if -M?? in param
set_target_type ${i/-/} || LISTARGS="$LISTARGS $i" set_target_type ${i/-/} || LISTARGS="$LISTARGS $i"
fi fi
done done
# remove extra space before list LISTNAMES=$(strip_spaces "$LISTNAMES")
LISTNAMES=$(echo "$LISTNAMES" | sed -e "s|^ ||") LISTARGS=$(strip_spaces "$LISTARGS")
LISTARGS=$(echo "$LISTARGS" | sed -e "s|^ ||")
# parse MENV # parse MENV
detect_target_env detect_target_env
[ -n "$VERBOSE" ] && echo "LISTNAMES=$LISTNAMES LISTARGS=$LISTARGS" || : [ -n "$VERBOSE" ] && echo "LISTNAMES=$LISTNAMES LISTARGS=$LISTARGS" || :
......
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