Skip to content

Commit

Permalink
Merge pull request #3 from sailfishos/jb56434
Browse files Browse the repository at this point in the history
ssu: Make sure the ssu cache is up-to-date.
  • Loading branch information
abranson authored Nov 23, 2021
2 parents 03138a8 + 5bd8a09 commit d0aea62
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
29 changes: 27 additions & 2 deletions rpm/ssu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,30 @@ fi

%post
/sbin/ldconfig
# make sure an old ssud isn't still running
killall ssud || :

%transfiletriggerin -- %{_datarootdir}/%{name}
# Touch all modified repo config files so they will be newer than the cache
grep \.ini$ | xargs -r touch
%{_bindir}/add-oneshot --now ssu-update-repos

%transfiletriggerun -- %{_datarootdir}/%{name}/features.d/
if [ "$1" == 0 ]; then
echo "Removing ssu feature cache"
rm -f /var/cache/ssu/features.ini
fi

%transfiletriggerun -- %{_datarootdir}/%{name}/board-mappings.d/
if [ "$1" == 0 ]; then
echo "Removing ssu board-mappings cache"
rm -f /var/cache/ssu/board-mappings.ini
fi

%transfiletriggerun -- %{_datarootdir}/%{name}/repos.d/
if [ "$1" == 0 ]; then
echo "Removing ssu main cache"
rm -f /var/cache/ssu/repos.ini
fi

%transfiletriggerpostun -- %{_datarootdir}/%{name}
%{_bindir}/add-oneshot --now ssu-update-repos

3 changes: 2 additions & 1 deletion ssu-update-repos
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ if [ "$MIC_RUN" != "" ]; then
exit 1
fi

touch /usr/share/ssu/board-mappings.d/*.ini 2>/dev/null
# Update repos
killall ssud 2>/dev/null || :
/usr/bin/ssu updaterepos

0 comments on commit d0aea62

Please sign in to comment.