diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c9a7df..e354823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2024-04-18 +### Fixed +- Retracted release 5.0.1 + + :warning: We have identified a critical bug in a database migration that causes data loss. Please defer upgrading to release 5.0.1 until further notice on the mailing list. Please hold on to any backups that were taken prior to upgrading to version 5.0.1. + ## 2024-04-09 ### Added diff --git a/bin/docker-compose b/bin/docker-compose index 3c58d05..c5e9957 100755 --- a/bin/docker-compose +++ b/bin/docker-compose @@ -208,6 +208,7 @@ function docker_compose() { read_image_version read_config +check_retracted_version check_sharelatex_env_vars build_environment print_debug_info "$@" diff --git a/bin/doctor b/bin/doctor index d417515..6408f59 100755 --- a/bin/doctor +++ b/bin/doctor @@ -448,6 +448,7 @@ function cleanup() { function __main__() { read_image_version print_section_separator "Overleaf Doctor" + check_retracted_version check_sharelatex_env_vars check_host_information check_dependencies diff --git a/bin/upgrade b/bin/upgrade index 1be6adc..6a131af 100755 --- a/bin/upgrade +++ b/bin/upgrade @@ -241,6 +241,7 @@ function __main__() { read_seed_image_version read_image_version + check_retracted_version handle_rc_rebranding handle_image_upgrade diff --git a/lib/config-seed/version b/lib/config-seed/version index 6b244dc..cf78d5b 100644 --- a/lib/config-seed/version +++ b/lib/config-seed/version @@ -1 +1 @@ -5.0.1 +4.2.4 diff --git a/lib/shared-functions.sh b/lib/shared-functions.sh index 246f866..df188a1 100644 --- a/lib/shared-functions.sh +++ b/lib/shared-functions.sh @@ -10,12 +10,29 @@ function read_config() { function read_image_version() { IMAGE_VERSION="$(head -n 1 "$TOOLKIT_ROOT/config/version")" - if [[ ! "$IMAGE_VERSION" =~ ^([0-9]+)\.([0-9]+)\.[0-9]+(-RC[0-9]*)?(-with-texlive-full)?$ ]]; then + if [[ ! "$IMAGE_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9])+(-RC[0-9]*)?(-with-texlive-full)?$ ]]; then echo "ERROR: invalid version '${IMAGE_VERSION}'" exit 1 fi IMAGE_VERSION_MAJOR=${BASH_REMATCH[1]} IMAGE_VERSION_MINOR=${BASH_REMATCH[2]} + IMAGE_VERSION_PATCH=${BASH_REMATCH[3]} +} + +function check_retracted_version() { + local retracted_versions=( + "5.0.1" + ) + local version="$IMAGE_VERSION_MAJOR.$IMAGE_VERSION_MINOR.$IMAGE_VERSION_PATCH" + for v in "${retracted_versions[@]}"; do + if [[ "$version" == "$v" ]]; then + echo "-------------------------------------------------------" + echo " You are currently using a retracted version, $v." + echo " Please check the release notes for further details." + echo "-------------------------------------------------------" + prompt "Ignore warning?" + fi + done } prompt() {