From 6d4c22a2b09d24ff0f898d50a2ec04603b567eb5 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Tue, 23 Jun 2015 15:23:45 +0200 Subject: [PATCH] check irp version... --- configure | 15 +++++++++++++-- install/scripts/check_irp_version.sh | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100755 install/scripts/check_irp_version.sh diff --git a/configure b/configure index b810f600..6ff1c77b 100755 --- a/configure +++ b/configure @@ -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}", "" ] diff --git a/install/scripts/check_irp_version.sh b/install/scripts/check_irp_version.sh new file mode 100755 index 00000000..245a15d9 --- /dev/null +++ b/install/scripts/check_irp_version.sh @@ -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" \ No newline at end of file