Commit 74342b0f authored by Vitaly Lipatov's avatar Vitaly Lipatov

introduce drop_args function with test, use it in rpmbsh

parent 58178235
......@@ -78,7 +78,7 @@ add_changelog_helper "- new version" $LISTNAMES
# We do not not pass args for myhsh here...
# FIXME: не обрабатывает два пропускаемых вместе параметра
pack_src_rpm $COMMIT $(echo $LISTRPMARGS | sed -e "s|-[suUicl]||g")
pack_src_rpm $COMMIT $(drop_args "$LISTRPMARGS" s u U i c l)
# TODO: skip for prev. packed src.rpm
set_specdir $LISTNAMES
......
......@@ -107,6 +107,18 @@ if [ -n "$NEEDETERBUILD" ] ; then
fi
fi
# 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
# Определяет, для какой среды собирать: по ключу -M23 -M24 или по каталогу, в котором спек
......
#!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common
load_mod git
check()
{
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$3' do not match with '$2'" || echo "OK for '$1' with '$2'"
}
check 1 "-h" "$(drop_args "-h -U" U)"
check 2 "-h" "$(drop_args " -h -U " U)"
check 3 "-U" "$(drop_args " -h -U " h)"
check 4 "-U -i" "$(drop_args " -h -U -i" h)"
check 5 "" "$(drop_args " -h -U " h U)"
check 6 "" "$(drop_args " -h -U " U h)"
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