Commit bb49886f authored by Vitaly Lipatov's avatar Vitaly Lipatov

implement regexp support in source.table and use it

parent 4ca50bc1
......@@ -36,19 +36,6 @@ extract_source()
tar -xJf $ETERCIFS_SOURCES_TARBALL -C "$2" --strip 1 "$1"
}
# TODO: drop it too
check_for_openvz()
{
if echo "$KERNELVERSION" | egrep -q "2\.6\.18.*(stab|ovz-el|ovz-rhel)" ; then
KERNEL_STRING="centos-ovz"
elif echo "$KERNELVERSION" | egrep -q "2\.6\.32.*(stab|ovz-el|ovz-smp|ovz-rhel|openvz)" ; then
KERNEL_STRING="centos60"
else
return 1
fi
return 0
}
# kernel version sorting
sort_dn()
{
......@@ -66,9 +53,7 @@ fake_source_versions()
detect_etercifs_sources()
{
KERNEL_STRING=
if check_for_openvz ; then
echo "Building from legacy sources for OpenVZ kernel $KERNEL_STRING"
elif which lsb_release > /dev/null; then
if which lsb_release > /dev/null; then
# TODO epm
DISTRO=$(lsb_release -d)
KERNEL_STRING=$(./source.sh "$DISTRO" "$KERNELVERSION" < source.table)
......
......@@ -39,8 +39,18 @@ while read vers source other; do
fi
[ -n "$VERBOSE" ] && echo "$vers - $prevvers: $source"
# FIXME: comparing for kernel version
# >=
# vers is regular expression
if echo "$vers" | grep -q "\*" ; then
if echo "$KERNELVERSION" | egrep -q "$vers" ; then
echo "$source"
exit
fi
# do not count regexps
# prevvers="$vers"
continue
fi
# vers is a kernel version
if [ -z "$skip" ] && ! verlt "$KERNELVERSION" "$vers" ; then
if [ -z "$prevvers" ] || verlt "$KERNELVERSION" "$prevvers" ; then
[ -n "$source" ] && echo "$source" || echo "$vers"
......
# TODO: parse with script?
# using version between current and prev
# Using:
# [Distro name]
# real_version source_version
# 1. using version between current and prev
# 2. using first regexp
[.*]
2\.6\.18.*(stab|ovz-el|ovz-rhel) centos-ovz
2\.6\.32.*(stab|ovz-el|ovz-smp|ovz-rhel|openvz) centos60
[GosLinux|CentOS|Red Hat|Scientific Linux|NauLinux|LinuxWizard Server|RERemix]
# >= source_version
......
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