Commit e508f1cc authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix pkgrepl for packages in {}

parent c20a08a9
#!/bin/bash #!/bin/bash
# 2003-2010, 2012, 2015 (c) Etersoft www.etersoft.ru # 2003-2010, 2012, 2015, 2016 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain # Public domain
# #
...@@ -240,7 +240,7 @@ pkgrepl_list=$(print_pkgrepl_list) ...@@ -240,7 +240,7 @@ 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 "Use req rule $NRL"
ALLREPLRULES="$ALLREPLRULES $NRL;" ALLREPLRULES="$ALLREPLRULES $NRL;"
done done
...@@ -252,7 +252,7 @@ grprepl_list=$(print_grprepl_list) ...@@ -252,7 +252,7 @@ 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 "Use group name rule $NRL"
ALLGRPREPLRULES="$ALLGRPREPLRULES $NRL;" ALLGRPREPLRULES="$ALLGRPREPLRULES $NRL;"
done done
......
...@@ -150,7 +150,7 @@ clean_pkgreq() ...@@ -150,7 +150,7 @@ clean_pkgreq()
#echo "$i" | egrep "gcc\$|cpp\$|gcc-c++\$" >/dev/null && continue #echo "$i" | egrep "gcc\$|cpp\$|gcc-c++\$" >/dev/null && continue
echo "$i" | grep "[()<=>]" >/dev/null && continue echo "$i" | grep "[()<=>]" >/dev/null && continue
echo "$i" | grep "^ *[0-9]\.[0-9]" >/dev/null && continue echo "$i" | grep "^ *[0-9]\.[0-9]" >/dev/null && continue
echo -n "$i " | sed -e "s|,||g" echo -n "$i " | sed -e "s|[,}]||g"
done | filter_strip_spaces done | filter_strip_spaces
} }
......
...@@ -28,6 +28,12 @@ Requires: libstdc++ ...@@ -28,6 +28,12 @@ Requires: libstdc++
BuildPreReq: rpm-build-compat gcc4.1 gcc BuildPreReq: rpm-build-compat gcc4.1 gcc
BuildRequires: imake, xorg-cf-files gccmakedep BuildRequires: imake, xorg-cf-files gccmakedep
%def_with krb
%{?_with_krb:Requires: libkrb5-devel}
#Requires: libkrb5-devel
Source: %name.source Source: %name.source
%description %description
......
...@@ -11,7 +11,7 @@ export VERBOSE=1 ...@@ -11,7 +11,7 @@ export VERBOSE=1
export IGNOREGEAR=1 export IGNOREGEAR=1
#sh ../bin/rpmbph -n -M51 specpkgr.spec #sh ../bin/rpmbph -n -M51 specpkgr.spec
export ROOTDIR=/net/os/stable/SUSE/11.3 #export ROOTDIR=/net/os/stable/CentOS/7
#sh ../bin/rpmbph -n specpkgr.spec #sh ../bin/rpmbph -n specpkgr.spec
check() check()
...@@ -21,9 +21,12 @@ check() ...@@ -21,9 +21,12 @@ check()
'$2'" || echo "OK for '$1' with '$2'" '$2'" || echo "OK for '$1' with '$2'"
} }
#print_pkgrepl_list
LISTBUILDDEP=`print_buildreq $SPECNAME` LISTBUILDDEP=`print_buildreq $SPECNAME`
check "BuildDep" "imake xorg-cf-files gccmakedep rpm-build-compat gcc4.1 gcc" "$LISTBUILDDEP" check "BuildDep" "imake xorg-cf-files gccmakedep rpm-build-compat gcc4.1 gcc" "$LISTBUILDDEP"
echo - echo -
LISTREQDEP=`print_pkgreq $SPECNAME` LISTREQDEP=`print_pkgreq $SPECNAME`
check "Reqs" "binutils dbus-tools-gui expect foomatic-db-engine libstdc++ netcat nx openssl /usr/bin/xvt Xdialog" "$LISTREQDEP" check "Reqs" "binutils dbus-tools-gui expect foomatic-db-engine libkrb5-devel libstdc++ netcat nx openssl /usr/bin/xvt Xdialog" "$LISTREQDEP"
...@@ -5,20 +5,21 @@ ...@@ -5,20 +5,21 @@
check() check()
{ {
NRL="-e s!(.*Req.*?)$ALTPKGNAME( |,|}|\$)!\1$TARGETPKGNAME\2!g;
-e s!(.*Req.*?)$ALTPKGNAME( |,|}|\$)!\1$TARGETPKGNAME\2!g;
"
local REPL local REPL
echo echo
echo "Source line: '$TEST1'" echo "Source line: '$TEST1'"
#REPL=`echo $TEST1 | sed -r -e $NRL` #REPL=`echo $TEST1 | sed -r -e $NRL`
REPL=`echo $TEST1 | perl -pi "$NRL"` REPL=`echo $TEST1 | perl -p "$NRL"`
[ "$REPL1" != "$REPL" ] && echo "FATAL with '$NRL' with result '$REPL'" || echo "OK with '$REPL'" [ "$REPL1" != "$REPL" ] && echo "FATAL with '$NRL' with result '$REPL'" || echo "OK with '$REPL'"
} }
ALTPKGNAME="rpm-build" ALTPKGNAME="rpm-build"
TARGETPKGNAME="rpm" TARGETPKGNAME="rpm"
NRL="-e s!(.*Req.*?)$ALTPKGNAME( |,|\$)!\1$TARGETPKGNAME\2!g;
-e s!(.*Req.*?)$ALTPKGNAME( |,|\$)!\1$TARGETPKGNAME\2!g;
"
##NRL="s!\(.*Req.*\)$REPLRULE1\( |,|\$\)!\1$REPLRULE2\2! ##NRL="s!\(.*Req.*\)$REPLRULE1\( |,|\$\)!\1$REPLRULE2\2!
...@@ -41,3 +42,11 @@ check ...@@ -41,3 +42,11 @@ check
TEST1="BuildPreReq: libstdc++" TEST1="BuildPreReq: libstdc++"
REPL1="BuildPreReq: libstdc++" REPL1="BuildPreReq: libstdc++"
check check
ALTPKGNAME="libkrb5-devel"
TARGETPKGNAME="krb5-devel"
#s!(.*Req.*)libkrb5-devel( |,|$)!\1krb5-devel\2!g
TEST1="%{?_with_krb:Requires: libkrb5-devel}"
REPL1="%{?_with_krb:Requires: krb5-devel}"
check
...@@ -99,7 +99,7 @@ check_repl libX11-devel libX11 ...@@ -99,7 +99,7 @@ check_repl libX11-devel libX11
############################# Fedora ########################## ############################# Fedora ##########################
DISTRNAME=Fedora DISTRNAME=Fedora
PKGVENDOR=fedora PKGVENDOR=fedora
DISTRVERSION=21 DISTRVERSION=23
BUILDARCH=x86_64 BUILDARCH=x86_64
PKGFORMAT=rpm PKGFORMAT=rpm
...@@ -119,6 +119,7 @@ check_repl unknown-devel "unknown-devel" ...@@ -119,6 +119,7 @@ check_repl unknown-devel "unknown-devel"
check_repl rpm-build-compat rpm-build-altlinux-compat check_repl rpm-build-compat rpm-build-altlinux-compat
check_repl libusb-devel libusbx-devel check_repl libusb-devel libusbx-devel
check_repl libkrb5-devel "krb5-devel"
......
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