Commit 552b26e4 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix remove_bashism for minimalize intrusion

parent e139fa0d
......@@ -257,6 +257,7 @@ separate_changelog()
}
# for rpm + (d)ash
# http://mywiki.wooledge.org/Bashism
remove_bashism()
{
local SPECNAME="$1"
......@@ -271,7 +272,9 @@ remove_bashism()
# FIXME: miss first spaces
while read -r n ; do
echo "$n" | grep -v "{.*}" && continue
eval echo "$n"
rs="$(echo "$n" | perl -pe "s|.*\s(.*?{.*?}.*?)\s.*|\1|g" )"
res=$(eval echo "$rs")
echo "$n" | perl -pe "s|$rs|$res|g"
done < $SPECNAME.main >$SPECNAME.tmp
[ -s "$SPECNAME.tmp" ] && mv -f $SPECNAME.tmp $SPECNAME
checkbashisms $SPECNAME
......
......@@ -21,6 +21,8 @@ License: Public License
%build
pushd txt
echo {1,2}text
%__subst "s|1|2|g" text/{1,eweew}
%__subst "s|1re er| erer2|g" text/{1,eweew} nono
popd
%description
......
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