check irp version...

This commit is contained in:
Thomas Applencourt 2015-06-23 15:23:45 +02:00
parent b3676c43d0
commit 6d4c22a2b0
2 changed files with 38 additions and 2 deletions

15
configure vendored
View File

@ -198,7 +198,18 @@ def checking(d_dependency):
check_python()
try:
return check_output(["which", binary])
a = check_output(["which", binary])
if binary == "irpf90":
cmd = join(QP_ROOT_INSTALL, "scripts", "check_irp_version.sh")
if check_output(cmd) == "FAIL":
raise subprocess.CalledProcessError
else:
return a
return a
except subprocess.CalledProcessError:
default_path = d_info[binary].default_path
if os.path.exists(default_path):
@ -265,7 +276,7 @@ def installation(l_install_descendant):
def create_rule_ninja():
l_rules = [
"rule download", " command = wget ${url} -O ${out} -o /dev/null",
"rule download", " command = wget --no-check-certificate ${url} -O ${out} -o /dev/null",
" description = Downloading ${descr}", ""
]

View File

@ -0,0 +1,25 @@
#!/bin/bash
# This script should be included
# pro:
#
# solid way to compare fancy version strings:
# support any length of sub-parts (ie: 1.3alpha.2.dev2 > 1.1 ?)
# support alpha-betical sort (ie: 1.alpha < 1.beta2)
# support big size version (ie: 1.10003939209329320932 > 1.2039209378273789273 ?)
# can easily be modified to support n arguments. (leaved as an exercise ;) )
# usually very usefull with 3 arguments: (ie: 1.2 < my_version < 2.7 )
# cons:
#
# uses a lot of various calls to different programs. So it's not that efficient.
# uses a pretty recent version of sort and it might not be available on your system. (check with man sort)
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | tail -n 1)" == "$1"; }
irp_cur_version=`irpf90 -v`
irp_need_version=1.6.7
if version_gt $irp_cur_version $irp_need_version; then
echo "OK"
fi
echo "FAIL"