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

[rpm/sailfishos-chum-gui-installer.spec] Use ssu's new %releaseMajorMinor macro for SailfishOS ≥ 4.6.0 #40

Merged
merged 18 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ef746f6
[rpm/sailfishos-chum-gui-installer.spec] Use `ssu`'s %releaseMajorMin…
Olf0 May 27, 2024
3ad4373
[rpm/sailfishos-chum-gui-installer.spec] Reverse logic to make it mor…
Olf0 May 31, 2024
f447437
[rpm/sailfishos-chum-gui-installer] Parametrise one debug output
Olf0 May 31, 2024
6ed62ba
[rpm/sailfishos-chum-gui-installer.spec] Rectify comments
Olf0 May 31, 2024
5542db7
[rpm/sailfishos-chum-gui-installer.spec] Revert commit 3ad4373 and en…
Olf0 May 31, 2024
f056529
[rpm/sailfishos-chum-gui-installer.spec] Use basic RegEx for `sed`
Olf0 May 31, 2024
993dc6d
[rpm/sailfishos-chum-gui-installer.spec] Revert commit f056529 for te…
Olf0 May 31, 2024
21ae531
[rpm/sailfishos-chum-gui-installer.spec] Instrument for testing
Olf0 May 31, 2024
e208b80
[rpm/sailfishos-chum-gui-installer.spec] Revert again for testing
Olf0 May 31, 2024
e7b51ee
[sailfishos-chum-gui-installer.spec] Test
Olf0 May 31, 2024
2979dce
[sailfishos-chum-gui-installer.spec] Omit misplaced shell statement
Olf0 May 31, 2024
aff68f2
[rpm/sailfishos-chum-gui-installer.spec] Test again
Olf0 May 31, 2024
6734496
[sailfishos-chum-gui-installer.spec] Another test
Olf0 May 31, 2024
ec985bd
Test #5 of sailfishos-chum-gui-installer.spec
Olf0 May 31, 2024
ab74a05
Update sailfishos-chum-gui-installer.spec ckjw
Olf0 May 31, 2024
ee2fd39
Update sailfishos-chum-gui-installer.spec skdwqkj
Olf0 May 31, 2024
a8c11b5
[rpm/sailfishos-chum-gui-installer.spec] Now working?
Olf0 May 31, 2024
8b9a7d9
[rpm/sailfishos-chum-gui-installer.spec] Fixup & eliminate debug output
Olf0 May 31, 2024
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
2 changes: 1 addition & 1 deletion bin/sailfishos-chum-gui-installer
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ do
sleep 1
systemctl stop packagekit.service
systemctl start packagekit.service
logentry='[Notice] Scheduling sailfishos-chum-gui-installer for removal in 20 seconds, trying to install sailfishos-chum-gui despite the failed repository refresh meanwhile.'
logentry="[Notice] Scheduling $called for removal in 20 seconds, trying to install sailfishos-chum-gui despite the failed repository refresh meanwhile."
printf '%s\n' "$(date -Iseconds) $logentry"
systemd-cat -t "$called" -p 5 printf '%s' "$logentry"
sleep 1
Expand Down
13 changes: 11 additions & 2 deletions rpm/sailfishos-chum-gui-installer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Provides: sailfishos-chum-repository
%global screenshots_url https://github.com/sailfishos-chum/sailfishos-chum-gui/raw/main/.screenshots
%global logdir %{_localstatedir}/log
%global logfile %{logdir}/%{name}.log.txt
%global _sailfish_version %(source /etc/os-release; echo $VERSION_ID | sed 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1\2\3/')

# This %%description section includes metadata for SailfishOS:Chum, see
# https://github.com/sailfishos-chum/main/blob/main/Metadata.md
Expand Down Expand Up @@ -134,9 +135,13 @@ then
chgrp ssu %{logfile}
umask "$curmask"
fi
# The added sailfishos-chum repository is not removed when SailfishOS:Chum GUI
# Installer is removed, but when the SailfishOS:Chum GUI application is removed.
# Add sailfishos-chum repository configuration, depending on the installed
# SailfishOS release (3.1.0 is the lowest supported, see line 60):
%if 0%{?_sailfish_version} >= 310 && 0%{?_sailfish_version} < 460
ssu ar sailfishos-chum 'https://repo.sailfishos.org/obs/sailfishos:/chum/%%(release)_%%(arch)/'
%else
ssu ar sailfishos-chum 'https://repo.sailfishos.org/obs/sailfishos:/chum/%%(releaseMajorMinor)_%%(arch)/'
%endif
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
Expand All @@ -152,6 +157,10 @@ ssu ur
exit 0

%postun
# The added sailfishos-chum repository is removed when the SailfishOS:Chum GUI
# Installer is removed, in contrast to Storeman-Installer from which it is
# derived, because the SailfishOS:Chum GUI application expects a pristine state as
# it enables by itself the SailfishOS:Chum repository (or its "testing" variant).
if [ "$1" = 0 ] # Removal
then
ssu rr sailfishos-chum
Expand Down
Loading