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

ssu: Make sure the ssu cache is up-to-date. #3

Merged
merged 1 commit into from
Nov 23, 2021
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
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
abranson marked this conversation as resolved.
Show resolved Hide resolved
# 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