Skip to content

Commit

Permalink
mastersfos4.2: Ultimate commits for v0.3.2 (#367) #371
Browse files Browse the repository at this point in the history
* [harbour-storeman.changes] Enhance wording (#365)

* Refine `%post` section … (#366)

* Refine %post section …
… analogue to storeman-developers/harbour-storeman-installer#96

* Only memorise what is really needed: repo names

* Add comment for new `%post` section

* Minimise quoting

* Update harbour-storeman.spec, twice

* Clarify comment (#368)
  • Loading branch information
Olf0 authored Dec 2, 2022
2 parents 1e4652e + 777aa82 commit 6b029f5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rpm/harbour-storeman.changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- [harbour-storeman.ts] Fix typo & beautify (#347)
- [harbour-storeman.qml] Eliminate last stale link (#354)
- Enhance comments WRT Qt-ToDos (#357)
- Enhance spec file a bit, requires Installer ≥ 1.3.0 (#360)
- Enhance spec file, now requires Installer ≥ 1.3.0 (#360)

* Sun Jul 17 2022 olf <https:/Olf0> 0.3.1
- [LICENSE] Update contributors' copyright notices (#313)
Expand Down
21 changes: 18 additions & 3 deletions rpm/harbour-storeman.spec
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,31 @@ desktop-file-install --delete-original --dir=%{buildroot}%{_datadir}/application
%{buildroot}%{_datadir}/applications/%{name}.desktop

%post
if [ "$1" = "1" ] # Installation
# The %%post scriptlet is deliberately run when installing *and* updating:
ssu_ur=no
ssu_lr="$(ssu lr | grep '^ - ' | cut -f 3 -d ' ')"
if printf %s "$ssu_lr" | grep -Fq mentaljam-obs
then
ssu rr mentaljam-obs
rm -f /var/cache/ssu/features.ini
ssu_ur=yes
fi
if ! printf %s "$ssu_lr" | grep -Fq harbour-storeman-obs
then
ssu ar harbour-storeman-obs 'https://repo.sailfishos.org/obs/home:/olf:/harbour-storeman/%%(release)_%%(arch)/'
ssu ur
ssu_ur=yes
fi
if [ $ssu_ur = yes ]
then ssu ur
fi
# 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 on Fedora Docs it
# is indicated that only the final exit status of a whole scriptlet is crucial:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax

%postun
if [ "$1" = "0" ] # Removal
if [ $1 = 0 ] # Removal
then
ssu rr harbour-storeman-obs
rm -f /var/cache/ssu/features.ini
Expand Down

0 comments on commit 6b029f5

Please sign in to comment.