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

develmaster: Commmits for v3.11.2-release1 #131

Merged
merged 18 commits into from
Sep 20, 2023
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
51 changes: 30 additions & 21 deletions bin/post_sfos-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ then
exit 1
fi

if ! [ "$(uptime | cut -f 1 -d ',' | rev | grep '^nim ' | cut -f 2 -d ' ' | rev)" -lt 4 ] 2> /dev/null
if ! [ "$(uptime | cut -f 1 -d ',' | rev | grep '^nim ' | cut -f 2 -d ' ' | rev)" -lt 4 ] 2>/dev/null
then
printf '%s\n\n' "Notice: Mind that $called is best run on a freshly rebooted device."
fi
Expand All @@ -36,11 +36,11 @@ printf '\n'

if command -v store-client > /dev/null 2>&1
then
printf '%s\n' "- Removing outdated Store version info."
for i in '-TERM' '-INT' '-TERM' '-HUP' '-KILL' '-Failed_to_kill_store-client'
printf '%s\n' "- Removing outdated SailfishOS version info for the Jolla Store."
for i in -TERM -INT -TERM -HUP -KILL -Failed_to_kill_store-client
do
if pgrep store-client > /dev/null
then eval pkill "$i" store-client # Or using the classic: `pkill "$(echo $i)" store-client`
if pgrep -x store-client > /dev/null
then pkill $i -x store-client
else break
fi
sleep 1
Expand All @@ -54,30 +54,39 @@ 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 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'
fi # Not executing either zypper or pkcon but both, because refreshing both of their caches is an important aspect.
if command -v pkcon > /dev/null 2>&1 # Is usually installed, but PackageKit is deliberately not specified as a dependency.
# This may have become superfluous with SFOS 3.2.0, see
# https://together.jolla.com/question/214572/changelog-320-torronsuo/#214572-packagekit
# Would need to investigate, but refreshing twice will do no harm, anyway.
printf '%s\n' "- Refreshing pkcon's caches:"
pkcon refresh || exit $?
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
fi

# This may have become superfluous with SFOS 3.2.0, see
# https://together.jolla.com/question/214572/changelog-320-torronsuo/#214572-packagekit
# 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

Loading