Commit 8258f32a authored by Vitaly Lipatov's avatar Vitaly Lipatov

workaround for echo -e

parent ecf40bee
...@@ -53,7 +53,14 @@ check_for_openvz() ...@@ -53,7 +53,14 @@ check_for_openvz()
sort_dn() sort_dn()
{ {
# sort -V # sort -V
sort -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -g sort -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -g "$@"
}
# build fake source table from source list
fake_source_versions()
{
echo "[Generic]"
list_source_versions | grep '^[0-9]' | sort_dn -r
} }
detect_etercifs_sources() detect_etercifs_sources()
...@@ -69,9 +76,7 @@ detect_etercifs_sources() ...@@ -69,9 +76,7 @@ detect_etercifs_sources()
# generic kernels # generic kernels
if [ -z "$KERNEL_STRING" ] || [ "$KERNEL_STRING" = "fixme" ] ; then if [ -z "$KERNEL_STRING" ] || [ "$KERNEL_STRING" = "fixme" ] ; then
# build fake source table from source list KERNEL_STRING=$(fake_source_versions | ./source.sh "Generic" "$KERNELVERSION")
KERNEL_STRING=$(echo -e "[Generic]\n$(list_source_versions | grep '^[0-9]' | sort_dn)" | ./source.sh "Generic" "$KERNELVERSION")
# hack for mc colorifer: "
fi fi
if [ -n "$KERNEL_STRING" ] ; then if [ -n "$KERNEL_STRING" ] ; then
......
...@@ -13,12 +13,12 @@ KERNELVERSION="$2" ...@@ -13,12 +13,12 @@ KERNELVERSION="$2"
sort_dn() sort_dn()
{ {
# sort -V # sort -V
sort -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -g sort -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -g "$@"
} }
# <= # <=
verlte() { verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort_dn | head -n1`" ] [ "$1" = "`( echo "$1" ; echo "$2" ; ) | sort_dn | head -n1`" ]
} }
# < # <
......
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