Skip to content

Commit

Permalink
ssu: Make sure the ssu cache is up-to-date.
Browse files Browse the repository at this point in the history
[ssu] Make sure the ssu cache is up-to-date. Fixes JB#54650

Add RPM file triggers to:
- Touch any new ssu config files so it's newer than the cache
- Remove caches when relevant files are removed.
  • Loading branch information
abranson committed Nov 23, 2021
1 parent 03138a8 commit 5bd8a09
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 5bd8a09

Please sign in to comment.