Commit 88821c56 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmcs: fix replace Requires

rpmcs: use last rules for repl.
parent c3bbfdae
......@@ -33,10 +33,10 @@ toalt_pkgrepl()
s/ \$//g
s/ |/|/g
s/| /|/g"
for i in $PKGREPLBASE/pkgrepl.fedora $PKGREPLBASE/pkgrepl.* ; do
for i in $PKGREPLBASE/pkgrepl.fedora $PKGREPLBASE/pkgrepl.rpm $PKGREPLBASE/pkgrepl.* ; do
#echo $i - $1
test -r "$i" || continue
REPLRULE=`grep -v "^#" "$i" 2>/dev/null | grep -- "$1\$" | sed -e "$WARULES" | sed -e "s/^\(.*\)|\(.*\)\$/\2|\1/g" | head -n1`
REPLRULE=`grep -v "^#" "$i" 2>/dev/null | grep -- "$1\$" | sed -e "$WARULES" | sed -e "s/^\(.*\)|\(.*\)\$/\2|\1/g" | tail -n1`
# For broken rule
echo $REPLRULE | grep "^|" >/dev/null && REPLRULE=""
echo $REPLRULE | grep "|\$" >/dev/null && REPLRULE=""
......@@ -366,7 +366,7 @@ do
echog "DONE"
# TODO use perl -pe
echog -n "fix requires..."
echog -n "fix build requires..."
ALLREPLRULES=""
for n in `print_buildreq $i` ; do
toalt_pkgrepl $n && ALLREPLRULES="$ALLREPLRULES
......@@ -374,6 +374,14 @@ do
#echo REPLRULE: $REPLRULE
done
echog -n "fix package requires..."
ALLREPLRULES=""
for n in `print_pkgreq $i` ; do
toalt_pkgrepl $n && ALLREPLRULES="$ALLREPLRULES
s|(.*Req.*)$REPLRULE1|\1$REPLRULE2|g" && test -n "$VERBOSE" && echo "Replace '$REPLRULE1' with '$REPLRULE2'"
#echo REPLRULE: $REPLRULE
done
echog -n "fix groups..."
for n in `print_grpreq $i` ; do
toalt_grprepl $n && ALLREPLRULES="$ALLREPLRULES
......
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