-
Notifications
You must be signed in to change notification settings - Fork 336
feat(fedora): release upgrade script #886
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0823398
1st commit
Angxddeep d7ef940
Update tab_data.toml
Angxddeep fdc9608
bashism fix
Angxddeep 29c9b0d
Update core/tabs/system-setup/fedora/fedora-upgrade.sh
f7aee7c
Update core/tabs/system-setup/fedora/fedora-upgrade.sh
ea0ec8e
Update core/tabs/system-setup/fedora/fedora-upgrade.sh
bc02407
Update core/tabs/system-setup/fedora/fedora-upgrade.sh
4ad8d76
Update core/tabs/system-setup/tab_data.toml
85cffe7
Update core/tabs/system-setup/fedora/fedora-upgrade.sh
d5ed0cb
Update core/tabs/system-setup/fedora/fedora-upgrade.sh
79ceae9
Update core/tabs/system-setup/fedora/fedora-upgrade.sh
eda8c45
Update core/tabs/system-setup/fedora/fedora-upgrade.sh
3f57c2d
update
Angxddeep 9782366
Apply suggestions from code review
df38d66
Update fedora-upgrade.sh
Angxddeep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/bin/sh -e | ||
|
||
. ../../common-script.sh | ||
|
||
current_version=$(rpm -E '%{fedora}') | ||
next_version=$((current_version + 1)) | ||
|
||
update() { | ||
printf "%b\n" "${RED}Make sure your system is fully updated; if not, update it first and reboot once.${RC}" | ||
printf "%b\n" "${CYAN}Your current Fedora version is $current_version.${RC}" | ||
printf "%b\n" "${CYAN}The next available version is $next_version.${RC}" | ||
|
||
printf "%b\n" "${YELLOW}Do you want to update to $next_version? (y/n): ${RC}" | ||
read -r response | ||
|
||
case "$response" in | ||
y|Y) | ||
printf "%b\n" "${CYAN}Preparing to update to $next_version...${RC}" | ||
|
||
if ! "$ESCALATION_TOOL" "$PACKAGER" install dnf-plugin-system-upgrade -y; then | ||
printf "%b\n" "${RED}Failed to install dnf-plugin-system-upgrade.${RC}" | ||
exit 1 | ||
fi | ||
|
||
if ! "$ESCALATION_TOOL" "$PACKAGER" system-upgrade download --releasever="$next_version"; then | ||
printf "%b\n" "${RED}Failed to download the upgrade packages.${RC}" | ||
exit 1 | ||
fi | ||
|
||
printf "%b\n" "${YELLOW}Do you want to reboot now to apply the upgrade? (y/n): ${RC}" | ||
read -r reboot_response | ||
|
||
case "$reboot_response" in | ||
y|Y) | ||
printf "%b\n" "${GREEN}Rebooting to apply the upgrade...${RC}" | ||
Angxddeep marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
"$ESCALATION_TOOL" "$PACKAGER" system-upgrade reboot | ||
;; | ||
*) | ||
printf "%b\n" "${YELLOW}You can reboot later to apply the upgrade.${RC}" | ||
;; | ||
esac | ||
;; | ||
*) | ||
printf "%b\n" "${RED}No upgrade performed.${RC}" | ||
;; | ||
esac | ||
} | ||
|
||
post_upgrade() { | ||
printf "%b\n" "${YELLOW}Running post-upgrade tasks...${RC}" | ||
|
||
case "$PACKAGER" in | ||
dnf) | ||
"$ESCALATION_TOOL" "$PACKAGER" autoremove | ||
"$ESCALATION_TOOL" "$PACKAGER" distro-sync -y | ||
;; | ||
*) | ||
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER.${RC}" | ||
exit 1 | ||
;; | ||
esac | ||
} | ||
|
||
checkEnv | ||
checkEscalationTool | ||
|
||
printf "%b\n" "${YELLOW}Select an option:${RC}" | ||
printf "%b\n" "${GREEN}1. Upgrade to the next Fedora version${RC}" | ||
printf "%b\n" "${GREEN}2. Run post-upgrade tasks${RC}" | ||
read -r choice | ||
|
||
case "$choice" in | ||
1) | ||
update | ||
;; | ||
2) | ||
post_upgrade | ||
;; | ||
*) | ||
printf "%b\n" "${RED}Invalid option. Please select 1 or 2.${RC}" | ||
exit 1 | ||
;; | ||
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.