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

Launcher sets default upgrader policy #213

Closed
wants to merge 92 commits into from

Conversation

EduardGomezEscandell
Copy link
Contributor

@EduardGomezEscandell EduardGomezEscandell commented Jun 27, 2022

This pull request depends on #217

Ubuntu desktop proposes upgrades according to a certain policy:

$ cat /etc/update-manager/release-upgrades
# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting and upgrade behavior, valid options:
#
#  never  - Never check for, or allow upgrading to, a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the supported release that immediately succeeds the
#           currently-running release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that if this option is used and
#           the currently-running release is not itself an LTS release the
#           upgrader will assume prompt was meant to be normal.
Prompt=lts

There are different releases of Ubuntu WSL on the Microsoft store. These can be classified in three categories. Currently, the policy is always lts by default. This PR changes the default upgrader policy to:

Category Releases in store Desired default policy
Preview Ubuntu (Preview) normal
Latest LTS Ubuntu lts
Numbered Ubuntu 18.04.5 LTS
Ubuntu 20.04.4 LTS
Ubuntu 22.04 LTS
never

@EduardGomezEscandell EduardGomezEscandell self-assigned this Jun 27, 2022
@EduardGomezEscandell EduardGomezEscandell marked this pull request as ready for review June 30, 2022 12:56
@EduardGomezEscandell EduardGomezEscandell marked this pull request as draft June 30, 2022 12:58
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Please check out carefully the isses found by clang-tidy in the new code ⚠️
⚠️ clang-format found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)

DistroLauncher/AfterInstall.h Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.h Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.h Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.h Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.cpp Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.cpp Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.cpp Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.cpp Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.cpp Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.cpp Outdated Show resolved Hide resolved
EduardGomezEscandell and others added 3 commits June 30, 2022 15:44
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Please check out carefully the isses found by clang-tidy in the new code ⚠️
⚠️ clang-format found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)

DistroLauncher/AfterInstall.h Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.h Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.h Outdated Show resolved Hide resolved
DistroLauncher/AfterInstall.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Please check out carefully the isses found by clang-tidy in the new code ⚠️
⚠️ clang-format found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/2)

DistroLauncher/RootUser.h Outdated Show resolved Hide resolved
DistroLauncher/RootUser.h Outdated Show resolved Hide resolved
DistroLauncher/RootUser.h Outdated Show resolved Hide resolved
DistroLauncher/RootUser.h Outdated Show resolved Hide resolved
DistroLauncher/RootUser.h Outdated Show resolved Hide resolved
DistroLauncher/Patches.cpp Outdated Show resolved Hide resolved
bool ShutdownDistro()
{
const std::wstring shutdownCmd = L"wsl -t " + DistributionInfo::Name;
if (int cmdResult = _wsystem(shutdownCmd.c_str()); cmdResult != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-simplify-boolean-expr ⚠️
redundant boolean literal in conditional return statement

Suggested change
if (int cmdResult = _wsystem(shutdownCmd.c_str()); cmdResult != 0) {
return cmdResult == 0;

DistroLauncher/Patches.cpp Show resolved Hide resolved
DistroLauncher/RootUser.cpp Outdated Show resolved Hide resolved
DistroLauncher/RootUser.cpp Outdated Show resolved Hide resolved
@EduardGomezEscandell
Copy link
Contributor Author

Closing in favour of refactored #226

@EduardGomezEscandell EduardGomezEscandell deleted the upgrader-policy branch July 19, 2022 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants