diff options
Diffstat (limited to 'scripts/version-check.sh')
-rw-r--r-- | scripts/version-check.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/version-check.sh b/scripts/version-check.sh new file mode 100644 index 0000000..c4a2bd0 --- /dev/null +++ b/scripts/version-check.sh @@ -0,0 +1,38 @@ +# This script checks the version of the configuration file and either +# alerts the user about the need to run the upgrade, or attempts to +# perform such an upgrade. + +CFGFILE="${1}" + +. "${CT_LIB_DIR}/scripts/functions" +. "${CFGFILE}" +if [ "${CT_CONFIG_VERSION_CURRENT}" == "${CT_CONFIG_VERSION}" ]; then + # Nothing to do + exit 0 +fi + +if [ -z "${CT_UPGRADECONFIG}" ]; then + if [ "${CT_CONFIG_VERSION}" != "0" ]; then + oldversion="is version ${CT_CONFIG_VERSION}" + else + oldversion="has no version" + fi + cat 2>&1 <<EOF + +Configuration file was generated by an older version of crosstool-NG; +configuration file ${oldversion}; crosstool-NG currently expects +version ${CT_CONFIG_VERSION_CURRENT}. If this configuration file was generated by a crosstool-NG +version 1.23.0 or later, you can run 'ct-ng upgradeconfig'. +Compatibility with previous releases is not guaranteed. In any case, +verify the resulting configuration. + +EOF + if [ "${CT_VCHECK}" = "strict" ]; then + exit 1 + else + exit 0 + fi +fi + +echo "TBD not implemented yet" >&2 +exit 1 |