From 06539502876150a5f35801a46ca15b96cdfe4078 Mon Sep 17 00:00:00 2001 From: Andre Maroneze <andre.oliveiramaroneze@cea.fr> Date: Wed, 3 Jun 2020 11:44:58 +0200 Subject: [PATCH] [Dev] rename and improve check for reference configuration --- INSTALL.md | 4 ++-- ...on.sh => check-reference-configuration.sh} | 24 +++++++++---------- ...iguration.md => reference-configuration.md | 0 3 files changed, 14 insertions(+), 14 deletions(-) rename bin/{check-working-configuration.sh => check-reference-configuration.sh} (77%) rename known_working_configuration.md => reference-configuration.md (100%) diff --git a/INSTALL.md b/INSTALL.md index 60156ff3115..b4f5c160edc 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -89,9 +89,9 @@ Why3 must be configured to make them available for Frama-C/WP: why3 config --detect ``` -### Known working configuration +### Reference configuration -See file [known_working_configuration.md](known_working_configuration.md) +See file [reference-configuration.md](reference-configuration.md) for a set of packages that is known to work with Frama-C 21 (Scandium). ### Installing Custom Versions of Frama-C diff --git a/bin/check-working-configuration.sh b/bin/check-reference-configuration.sh similarity index 77% rename from bin/check-working-configuration.sh rename to bin/check-reference-configuration.sh index 807d1cc0678..2e18397b47a 100755 --- a/bin/check-working-configuration.sh +++ b/bin/check-reference-configuration.sh @@ -1,24 +1,24 @@ #!/bin/bash -eu # Displays the current working configuration of OCaml dependencies of Frama-C, -# comparing them with the one in `known_working_configuration.md`. +# comparing them with the one in `reference-configuration.md`. if ! type "opam" > /dev/null; then - opam="<none>" + opam="NOT" else opam="$(opam --version)" fi if ! type "ocaml" > /dev/null; then - ocaml="<none>" + ocaml="NOT" else ocaml=$(ocaml -vnum) fi version_via_opam() { - v=$(opam info -f version "$1" 2>/dev/null) - if [ "$v" = "" ]; then - echo "<none>" + v=$(opam info -f installed-version "$1" 2>/dev/null) + if [ "$v" = "" -o "$v" = "--" ]; then + echo "NOT" else echo $v fi @@ -27,23 +27,23 @@ version_via_opam() { version_via_ocamlfind() { v=$(ocamlfind query -format "$1" 2>/dev/null) if [ "$v" = "" ]; then - echo "<none>" + echo "NOT" else echo $v fi } SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -kwc="$SCRIPT_DIR/../known_working_configuration.md" +refconf="$SCRIPT_DIR/../reference-configuration.md" -packages=$(grep '^- [^ ]*\.' "$kwc" | sed 's/^- //' | sed 's/ .*//') +packages=$(grep '^- [^ ]*\.' "$refconf" | sed 's/^- //' | sed 's/ .*//') bold=$(tput bold) normal=$(tput sgr0) has_any_diffs=0 # Check OCaml version separately (not same syntax as the packages) -working_ocaml=$(grep "\- OCaml " "$kwc" | sed 's/.*OCaml //') +working_ocaml=$(grep "\- OCaml " "$refconf" | sed 's/.*OCaml //') if [ "$working_ocaml" != "$ocaml" ]; then echo -n "warning: OCaml ${bold}${ocaml}${normal} installed, " echo "expected ${bold}${working_ocaml}${normal}" @@ -55,9 +55,9 @@ for package in $packages; do name=${package%%.*} all_packages+=" $package" working_version=$(echo $package | sed 's/^[^.]*\.//') - if [ "$opam" != "<none>" ]; then + if [ "$opam" != "NOT" ]; then actual_version=$(version_via_opam $name) - elif [ "$ocamlfind" != "<none>" ]; then + elif [ "$ocamlfind" != "NOT" ]; then actual_version=$(version_via_ocamlfind $name) else echo "error: neither opam nor ocamlfind found." diff --git a/known_working_configuration.md b/reference-configuration.md similarity index 100% rename from known_working_configuration.md rename to reference-configuration.md -- GitLab