Commit 265e8e5f authored by Vitaly Lipatov's avatar Vitaly Lipatov

save used repl files and do pretty output

parent 8d5a3dd3
...@@ -101,12 +101,12 @@ if [ "$PKGVENDOR" = "alt" ] ; then ...@@ -101,12 +101,12 @@ if [ "$PKGVENDOR" = "alt" ] ; then
# FIXME: use separate macro list # FIXME: use separate macro list
# FIXME: check for all rpm-build-compat macro list # FIXME: check for all rpm-build-compat macro list
if grep -q "\(_cupslibdir\|_sudoers\)" $SPECNAME ; then if grep -q configure32 $SPECNAME ; then
BUILDREQ="BuildRequires: rpm-build-compat >= 1.9.0"
elif grep -q "\(_cupslibdir\|_sudoers\)" $SPECNAME ; then
BUILDREQ="BuildRequires: rpm-build-compat >= 1.7.25" BUILDREQ="BuildRequires: rpm-build-compat >= 1.7.25"
elif grep -q _sharedstatedir $SPECNAME ; then elif grep -q _sharedstatedir $SPECNAME ; then
BUILDREQ="BuildRequires: rpm-build-compat >= 1.7.24" BUILDREQ="BuildRequires: rpm-build-compat >= 1.7.24"
elif grep -q configure32 $SPECNAME ; then
BUILDREQ="BuildRequires: rpm-build-compat >= 1.9.0"
fi fi
# drop unsuported technologies # drop unsuported technologies
...@@ -234,33 +234,36 @@ LISTGROUP=`eval_spec $SPECNAME | grep "^Group" | sed -e "s|^.*:||g" | xargs -n1 ...@@ -234,33 +234,36 @@ LISTGROUP=`eval_spec $SPECNAME | grep "^Group" | sed -e "s|^.*:||g" | xargs -n1
ALLREPLRULES="" ALLREPLRULES=""
if [ -n "$VERBOSE" ] ; then if [ -n "$VERBOSE" ] ; then
echo
echo "Checking req names for" echo "Checking req names for"
echo "$LISTDEP" echo "$LISTDEP"
echo -n "Use replacement file: "
print_pkgrepl_list
echo echo
echo "Used replacement files: "
print_pkgrepl_list
fi fi
[ -n "$VERBOSE" ] && echo && echo "Used rules:"
pkgrepl_list=$(print_pkgrepl_list) pkgrepl_list=$(print_pkgrepl_list)
for i in $LISTDEP ; do for i in $LISTDEP ; do
tolocal_anyrepl $i $pkgrepl_list || continue tolocal_anyrepl $i $pkgrepl_list || continue
#NRL="s!\(.*Req.*\)$REPLRULE1\( |,|\$\)!\1$REPLRULE2\2!g" #NRL="s!\(.*Req.*\)$REPLRULE1\( |,|\$\)!\1$REPLRULE2\2!g"
NRL="s!(.*Req.*)$ALTPKGNAME( |,|}|\$)!\1$TARGETPKGNAME\2!g" NRL="s!(.*Req.*)$ALTPKGNAME( |,|}|\$)!\1$TARGETPKGNAME\2!g"
[ -n "$VERBOSE" ] && echo "Use req rule $NRL" [ -n "$VERBOSE" ] && echo " $NRL from $USEDPKGREPL"
ALLREPLRULES="$ALLREPLRULES $NRL;" ALLREPLRULES="$ALLREPLRULES $NRL;"
done done
# Build replacement rules for spec # Build replacement rules for spec
[ -n "$VERBOSE" ] && echo "Checking group names for $LISTGROUP" [ -n "$VERBOSE" ] && echo && echo -e "Checking group names for\n$LISTGROUP"
ALLGRPREPLRULES="" ALLGRPREPLRULES=""
grprepl_list=$(print_grprepl_list) grprepl_list=$(print_grprepl_list)
for i in $LISTGROUP ; do for i in $LISTGROUP ; do
tolocal_anyrepl $i $grprepl_list || continue tolocal_anyrepl $i $grprepl_list || continue
#NRL="s!\(Group.*\)$REPLRULE1\( |,|\$\)!\1$REPLRULE2\2!g" #NRL="s!\(Group.*\)$REPLRULE1\( |,|\$\)!\1$REPLRULE2\2!g"
NRL="s!(Group.*)$ALTPKGNAME( |,|}|\$)!\1$TARGETPKGNAME\2!g" NRL="s!(Group.*)$ALTPKGNAME( |,|}|\$)!\1$TARGETPKGNAME\2!g"
[ -n "$VERBOSE" ] && echo "Use group name rule $NRL" [ -n "$VERBOSE" ] && echo && echo "Use group name rule $NRL from $USEDPKGREPL"
ALLGRPREPLRULES="$ALLGRPREPLRULES $NRL;" ALLGRPREPLRULES="$ALLGRPREPLRULES $NRL;"
done done
echo
#echo GRP: $LISTGROUP, ALLGRPREPLRULES: $ALLGRPREPLRULES #echo GRP: $LISTGROUP, ALLGRPREPLRULES: $ALLGRPREPLRULES
# add %defattr to files sections # add %defattr to files sections
...@@ -305,8 +308,7 @@ repl_groups() ...@@ -305,8 +308,7 @@ repl_groups()
} }
if [ -n "$VERBOSE" ] ; then if [ -n "$VERBOSE" ] ; then
echo "Requires rules: $ALLREPLRULES" echo "Replacing..."
echo "Group rules: $ALLGRPREPLRULES"
fi fi
# apply all rules, awk excludes, remove empty tag lines # apply all rules, awk excludes, remove empty tag lines
......
...@@ -112,7 +112,7 @@ tolocal_anyrepl() ...@@ -112,7 +112,7 @@ tolocal_anyrepl()
s/ *\$//g s/ *\$//g
s/ *|/|/g s/ *|/|/g
s/| */|/g" s/| */|/g"
USEDPKGREPL='scripted rules'
for i in $@ ; do for i in $@ ; do
REPLRULE=`grep -v "^#" "$i" 2>/dev/null | grep -- "^ *$GREP *|" | sed -e "$WARULES" | head -n1` REPLRULE=`grep -v "^#" "$i" 2>/dev/null | grep -- "^ *$GREP *|" | sed -e "$WARULES" | head -n1`
# For broken rule # For broken rule
...@@ -120,7 +120,7 @@ tolocal_anyrepl() ...@@ -120,7 +120,7 @@ tolocal_anyrepl()
#REPLRULE=`echo $REPLRULE | sed -r -e 's,|,!,g'` #REPLRULE=`echo $REPLRULE | sed -r -e 's,|,!,g'`
ALTPKGNAME=`echo $REPLRULE | cut -d"|" -f1 | sed -e "s|\+|\\\\\+|g"` ALTPKGNAME=`echo $REPLRULE | cut -d"|" -f1 | sed -e "s|\+|\\\\\+|g"`
TARGETPKGNAME=`echo $REPLRULE | cut -d"|" -f2 | sed -e "s|\+|\\\\\+|g"` TARGETPKGNAME=`echo $REPLRULE | cut -d"|" -f2 | sed -e "s|\+|\\\\\+|g"`
test -n "$REPLRULE" && TARGETPKGNAME=$(add_32bit_requires "$GREP" "$TARGETPKGNAME") && return 0 test -n "$REPLRULE" && TARGETPKGNAME=$(add_32bit_requires "$GREP" "$TARGETPKGNAME") && USEDPKGREPL="$(basename $i)" && return 0
done done
local NEWRESULT=$(hack_distr_requires "$GREP") local NEWRESULT=$(hack_distr_requires "$GREP")
...@@ -230,10 +230,11 @@ convert_pkgreqs_to_target() ...@@ -230,10 +230,11 @@ convert_pkgreqs_to_target()
assert_var DISTRVENDOR BUILDARCH PKGFORMAT assert_var DISTRVENDOR BUILDARCH PKGFORMAT
local repl_list local repl_list
repl_list=$(print_pkgrepl_list) repl_list=$(print_pkgrepl_list)
LISTUSEDPKGREPL=''
local j local j
for j in "$@" ; do for j in "$@" ; do
tolocal_anyrepl $j $repl_list && estrlist list "$TARGETPKGNAME" || echo $j tolocal_anyrepl $j $repl_list && estrlist list "$TARGETPKGNAME" && LISTUSEDPKGREPL="$LISTUSEDPKGREPL\nUSEDPKGREPL" || echo $j
done | sort -u | sed -e "s|\\\\+|\+|g" done | sort -u | 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