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

[post_sfos-upgrade] Add cleansing ssu(d)'s caches #129

Merged
merged 1 commit into from
Sep 19, 2023
Merged
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
22 changes: 15 additions & 7 deletions bin/post_sfos-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,27 @@ primuser="$(loginctl list-sessions | fgrep seat0 | tr -s ' ' | cut -d ' ' -f 4)"
# Paths for SailfishOS ≥ 2.2.1 rsp. SailfishOS < 2.2.1, see chapter "Final clean up" at https://docs.sailfishos.org/Support/Help_Articles/Updating_Sailfish_OS/#final-clean-up
rm -f "/home/${primuser}/.cache/sailfish-osupdateservice/os-info" "/home/${primuser}/.cache/store-client/os-info"

printf '%s\n' "- Cleansing ssu(d)\'s caches and restarting it."
for i in -TERM -INT -TERM -HUP -KILL -Failed_to_kill_ssud
do
if pgrep -x ssud > /dev/null
then eval pkill $i -x ssud
else break
fi
sleep 1
done
printf '\n'
rm -rf /var/cache/ssu/*
ssu ur

if command -v zypper > /dev/null 2>&1
then
# No need to be "brutal":
# printf '%s\n' "- Cleaning zypper's caches:"
# printf '%s\n' "- Cleansing zypper's caches:"
# zypper clean -m || exit $?
printf '%s\n' "- Refreshing zypper's caches:"
zypper refresh || exit $?
printf '\n'
# Syncing, as I could not determine if zypper already does that:
sync
printf '%s\n' "- Checking for updates by zypper:"
printf '\n%s\n' "- Checking for updates by zypper:"
# As of SailfishOS 4.1.0, `version --dup` does not seem to always update all packages, any more:
zypper update -y -l
printf '\n'
Expand All @@ -75,8 +85,6 @@ fi
# Would need to investigate, but refreshing twice will do no harm, anyway.
printf '%s\n' "- Refreshing pkcon's caches:"
pkcon refresh || exit $?
# Syncing, as I could not determine if pkcon already does that:
sync
printf '%s\n' "- Checking for updates by pkcon:"
# As of SailfishOS 4.1.0, `version --dup` does not seem to always update all packages, any more:
pkcon -y update
Expand Down