mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-24 21:41:46 +02:00
check irp version...
This commit is contained in:
parent
b3676c43d0
commit
6d4c22a2b0
15
configure
vendored
15
configure
vendored
@ -198,7 +198,18 @@ def checking(d_dependency):
|
|||||||
check_python()
|
check_python()
|
||||||
|
|
||||||
try:
|
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:
|
except subprocess.CalledProcessError:
|
||||||
default_path = d_info[binary].default_path
|
default_path = d_info[binary].default_path
|
||||||
if os.path.exists(default_path):
|
if os.path.exists(default_path):
|
||||||
@ -265,7 +276,7 @@ def installation(l_install_descendant):
|
|||||||
def create_rule_ninja():
|
def create_rule_ninja():
|
||||||
|
|
||||||
l_rules = [
|
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}", ""
|
" description = Downloading ${descr}", ""
|
||||||
]
|
]
|
||||||
|
|
||||||
|
25
install/scripts/check_irp_version.sh
Executable file
25
install/scripts/check_irp_version.sh
Executable 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"
|
Loading…
Reference in New Issue
Block a user