Skip to content

Commit

Permalink
Rework stop release handling / determination (#103) #110 from Olf0/devel
Browse files Browse the repository at this point in the history
* Rework stop release handling / determination

* Set version-release to 3.10.0-release1
  • Loading branch information
Olf0 authored Mar 19, 2023
2 parents 30b6981 + 6b83a67 commit 58fbb8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rpm/sfos-upgrade.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Summary: Scripts for fail-safe upgrading of SailfishOS at the command lin
# and OBS, when configured accordingly; mind the sorting (`adud` < `alpha`).
# For details and reasons, see
# https://github.com/Olf0/sfos-upgrade/wiki/Git-tag-format
Version: 3.9.22
Release: release14
Version: 3.10.0
Release: release1
Group: Applications/System
Distribution: SailfishOS
License: LGPL-2.1-only
Expand Down
10 changes: 7 additions & 3 deletions usr/bin/sfos-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export BLOCK_SIZE=512 # For `df` et al, see man-page for GNU `df`
export DF_BLOCK_SIZE=512 # For `df` et al, see man-page for GNU `df`

# Switched to use bash since version 2.1 of this script (in its first line), as this ensures that "-o pipefail"
# (in line 679) is available, after checking that bash seems to be present in mer-core at least since 2011-10-04
# (in line 683) is available, after checking that bash seems to be present in mer-core at least since 2011-10-04
# (see https://git.sailfishos.org/mer-core/bash / https://git.merproject.org/mer-core/bash ) and consequently in
# SailfishOS since its beginnings (checked v1.0.0.5 per
# curl https://releases.sailfishos.org/sources/sailfish-1.0.0.5-oss.tar.bz2 | tar -tv | fgrep 'bash' , as no earlier
Expand Down Expand Up @@ -223,7 +223,8 @@ else
sailfishdocs_stop_releases=""
# Because Jolla regularly fails to document their stop releases in a timely manner (see e.g., https://forum.sailfishos.org/t/scripted-download-of-https-jolla-zendesk-com-hc-en-us-articles-201836347-fails/7935/2 ),
# I had to change the policy how to deal with this lacking information: All final releases, which are not documented not to be a stop release, are handled as one starting with sfos-upgrade 3.9.1.
mylist_stop_releases="4.5.0.18,4.4.0.72,4.3.0.15,4.2.0.21,4.1.0.24,4.0.1.48,3.4.0.24,3.2.0.12,3.0.0.8,2.2.0.29,2.0.5.6,2.0.0.10,1.1.9.30,1.1.7.28,1.1.2.16,1.0.2.5,1.0.0.5"
# mylist_stop_releases="4.5.0.18,4.4.0.72,4.3.0.15,4.2.0.21,4.1.0.24,4.0.1.48,3.4.0.24,3.2.0.12,3.0.0.8,2.2.0.29,2.0.5.6,2.0.0.10,1.1.9.30,1.1.7.28,1.1.2.16,1.0.2.5,1.0.0.5"
mylist_stop_versions="4.5.0,4.4.0,4.3.0,4.2.0,4.1.0,4.0.1,3.4.0,3.2.0,3.0.0,2.2.0,2.0.5,2.0.0,1.1.9,1.1.7,1.1.2,1.0.2,1.0.0"
# 0.99.5.11 and 1.0.1.10 are not documented to be "stop releases" at https://docs.sailfishos.org/Support/Releases/
# But 2.0.5.6 seems to be a "stop release", at least on some devices, see comments thread to
# https://together.jolla.com/question/207172/downgrade-sailfish-os/?answer=207190#post-id-207190
Expand All @@ -246,7 +247,10 @@ else
echo >&2
fi
fi
all_stop_releases="$(echo -e "${sailfishdocs_stop_releases}\n$(echo "$mylist_stop_releases" | tr ',' '\n')" | grep -vx '' | sort -u)"
# As of 2023-03-18 (i.e., 4.5.0.18 is the newest release) this works fine despite *and* because of busybox's `sort` lacking `-V`: 3.0.0.11, which was a release only for the Inoi R7, is treated as smaller than 3.0.0.8, which is the correct stop release version of 3.0.0.x.
# But as soon as a stop release version X.Y.Z is publicly released (cBetas are *not* public) with both, point releases smaller and larger than 10, this ceases to work as intended. Likely it will still work out O.K. in practice.
all_stop_versions="$(echo -e "$(echo "$sailfishdocs_stop_releases" | cut -s -d '.' -f 1-3)\n$(echo "$mylist_stop_versions" | tr ',' '\n')" | grep -vx '' | sort -u)"
all_stop_releases="$(for i in $all_stop_versions; do echo "$all_sfos_releases" | grep -xm 1 "${i}\.[0-9][0-9]*"; done)"
compar0="$(compare_versions "$installed_release" "$upgrade_release")"
case "$compar0" in
e?) # Equality
Expand Down

0 comments on commit 58fbb8f

Please sign in to comment.