-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Prefer
bootc
over rpm-ostree
for update & rebase/switch co…
…mmand
- Loading branch information
1 parent
d5c0cdd
commit 71f0554
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
cat << EOF > /etc/profile.d/prefer-bootc-over-rpm-ostree.sh | ||
# Prefer 'bootc update/upgrade' & 'bootc switch' over rpm-ostree's equivalent functionality | ||
rpm-ostree() { | ||
if [[ ${#} -eq 0 ]]; then | ||
/usr/bin/rpm-ostree | ||
elif [[ -n "$(awk '/(^|\s)('update'|'upgrade')($|\s)/' <<< "${@}")" ]]; then | ||
echo "ERROR: Don't use 'rpm-ostree update/upgrade', use 'sudo bootc update/upgrade' instead." | ||
echo " Some functionality like kargs.d is only available when using bootc, hence why Gidro-OS slowly deprecates using rpm-ostree." | ||
elif [[ -n "$(awk '/(^|\s)('rebase')($|\s)/' <<< "${@}")" ]]; then | ||
echo "ERROR: Don't use 'rpm-ostree rebase', use 'sudo bootc switch' instead." | ||
echo " Some functionality like kargs.d is only available when using bootc, hence why Gidro-OS slowly deprecates using rpm-ostree." | ||
else | ||
/usr/bin/rpm-ostree "${@}" | ||
fi | ||
} | ||
export -f rpm-ostree | ||
EOF |
This file contains 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