Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[harbour-storeman.spec] Fix, comment and enhance %post scriptlet … #505

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions rpm/harbour-storeman.changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
* Thu Nov 14 2024 olf <[email protected]> - 0.7.3
-

* Mon Nov 11 2024 olf <[email protected]> - 0.7.2
* Mon Nov 25 2024 olf <[email protected]> - 0.7.2
- Rework OBS repository handling, part 2: Improve (#498)
- Fix, comment and enhance `%post` scriptlet (#505)

* Mon Nov 04 2024 olf <[email protected]> - 0.7.1
- Handle `harbour-storeman-obs` SailfishOS-OBS-repository for self-updating well, when Storeman was not installed by the Storeman Installer
Expand Down
14 changes: 6 additions & 8 deletions rpm/harbour-storeman.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Name: harbour-storeman
Summary: OpenRepos client application for SailfishOS
# The <version> tag must adhere to semantic versioning: Among multiple other
# reasons due to its use for `qmake5` in line 107. See https://semver.org/
Version: 0.7.3
Version: 0.7.2
# The <release> tag comprises one of {alpha,beta,rc,release} postfixed with a
# natural number greater or equal to 1 (e.g., "beta3") and may additionally be
# postfixed with a plus character ("+"), the name of the packager and a release
Expand All @@ -14,7 +14,7 @@ Version: 0.7.3
# build at GitHub and OBS, when configured accordingly; mind the sorting
# (`adud` < `alpha`). For details and reasons, see
# https://github.com/storeman-developers/harbour-storeman/wiki/Git-tag-format
Release: release1_%{branch}
Release: release2_%{branch}
# The Group tag should comprise one of the groups listed here:
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
Group: Software Management/Package Manager
Expand Down Expand Up @@ -132,15 +132,15 @@ VERSION_ID=''
source %{_sysconfdir}/os-release
sailfish_version="$(echo "$VERSION_ID" | cut -s -f 1-3 -d '.' | tr -d '.')"
# sailfish_version must be an all numerical string of at least three digits:
if ! echo "sailfish_version" | grep -q '^[0-9][0-9][0-9][0-9]*$'
then
echo "Error: VERSION_ID=$VERSION_ID => sailfish_version=$sailfish_version" >&2
if [ $(echo "$sailfish_version" | grep -c '^[0-9][0-9][0-9][0-9]*$') != 1 ]
then echo "Error: VERSION_ID=$VERSION_ID => sailfish_version=$sailfish_version" >&2
else
# Ensure that the repo config is correct: If it is missing or a fixed
# SFOS-release number was used, set it anew.
release_macro="$(grep '^harbour-storeman-obs=' %{_sysconfdir}/ssu/ssu.ini | grep -o '/[[:graph:]][[:graph:]][[:graph:]][[:graph:]]*/$' | grep -o '%%(release[[:alpha:]]*)')"
if [ $sailfish_version -ge 460 ] && [ "$release_macro" != '%%(releaseMajorMinor)' ]
then
# No `ssu rr harbour-storeman-obs` needed, because an `ssu ar <name> <URL>` overwrites an extant entry.
ssu ar harbour-storeman-obs 'https://repo.sailfishos.org/obs/home:/olf:/harbour-storeman/%%(releaseMajorMinor)_%%(arch)/'
ssu_ur=yes
elif [ $sailfish_version -lt 460 ] && [ "$release_macro" != '%%(release)' ]
Expand All @@ -149,9 +149,7 @@ else
ssu_ur=yes
fi
fi
if [ $ssu_ur = yes ]
then ssu ur
fi
[ $ssu_ur = yes ] && ssu ur
# BTW, `ssu`, `rm -f`, `mkdir -p` etc. *always* return with "0" ("success"), hence
# no appended `|| true` needed to satisfy `set -e` for failing commands outside of
# flow control directives (if, while, until etc.). Furthermore Fedora Docs etc.
Expand Down
Loading