Commit 6da133fa authored by Vitaly Lipatov's avatar Vitaly Lipatov

rewrite replacement rule: check for each file from new version to old

parent 95f68b25
......@@ -3,7 +3,7 @@
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
ETERBUILDVERSION=186
ETERBUILDVERSION=196
SUDO="sudo"
......
......@@ -71,6 +71,16 @@ print_grpreq()
eval_spec ${1} | grep "^Group" | sed -e "s|^.*:||g" | sort -u | filter_strip_spaces
}
internal_repl_list()
{
local REPLBASE="$1"
local ARCHEXT="$2"
local FINDPKG=$REPLBASE.$VENDOR.$DISTRVERSION$ARCHEXT
( ls -1 $PKGREPLBASE/pkgrepl.$VENDOR*$ARCHEXT | ( test -n "$ARCHEXT" && cat || grep -v "x86_64" ) ; echo $FINDPKG ) | sort -u | grep "^$FINDPKG\$" -B1000 | sort -r
echo $REPLBASE.$VENDOR$ARCHEXT
[ "$VENDOR" = "alt" ] || echo "$REPLBASE.$TARGET$ARCHEXT "
}
# internal
print_replbased_list()
{
......@@ -78,15 +88,12 @@ print_replbased_list()
# VENDOR, TARGET is already defined in detect_target_env() func
[ -z "$DISTRVERSION" ] && DISTRVERSION=`$($DISTRVENDOR -v)`
# separate checking for x86_64
if [ $DEFAULTARCH = "x86_64" ] ; then
echo -n "$REPLBASE.$VENDOR.$DISTRVERSION.x86_64 $REPLBASE.$VENDOR.x86_64 "
[ "$VENDOR" = "alt" ] || echo -n "$REPLBASE.$TARGET.x86_64 "
internal_repl_list $REPLBASE .x86_64
fi
# general rules listing
echo -n "$REPLBASE.$VENDOR.$DISTRVERSION $REPLBASE.$VENDOR "
[ "$VENDOR" = "alt" ] || echo -n "$REPLBASE.$TARGET "
internal_repl_list $REPLBASE ""
}
# TODO: list in alph. order and use if <= then our version
......
......@@ -31,7 +31,7 @@ for i in `print_grprepl_list` ; do
done
}
VENDOR=Fedora
VENDOR=fedora
TARGET=rpm
DISTRVERSION=10
......@@ -54,10 +54,19 @@ check_repl rpm-build-compat rpm-build-altlinux-compat
check_repl libusb-devel libusb-devel
VENDOR=Debian
VENDOR=ubuntu
TARGET=deb
DISTRVERSION=5.0
DISTRVERSION=9.04
echo "Correct replacement checking for $VENDOR/$DISTRVERSION (target $TARGET):"
check_repl rpm-build-compat rpm-build-altlinux-compat
check_repl libusb-devel libusb-dev
VENDOR=mdv
DISTRVERSION=2010.1
DEFAULTARCH=x86_64
TARGET=rpm
#FINDPKG=$PKGREPLBASE.pkgrepl.$VENDOR.$DISTRVERSION
#( ls -1 $PKGREPLBASE/pkgrepl.$VENDOR* | grep -v x86_64 ; echo $FINDPKG ) | sort -u | grep "^$FINDPKG\$" -B1000 | sort -r
print_pkgrepl_list
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