no more container-upgrade. self-upgrade does all

This commit is contained in:
pvincent
2026-09-02 11:02:30 +04:00
parent 119467d416
commit af0b650c23
3 changed files with 20 additions and 17 deletions
-14
View File
@@ -1,14 +0,0 @@
function upgrade {
local container_version host_version
container_version=$(</var/lib/miaou-bash/semver_current)
host_version=$(<"$MIAOU_BASH_DIR"/.semver_git_tag)
if [[ "$container_version" != "$host_version" ]]; then
echo -n "MIAOU-BASH: initiate new version: $host_version"
[[ "$UID" -ne 0 ]] && echo " (CTRL+c to bypass)" || echo
sudo -E miaou-bash "$MIAOU_BASH_DIR"/lib/initiate.bash
fi
}
if [[ -f /var/lib/miaou-bash/semver_current ]]; then
upgrade
fi
+1 -1
View File
@@ -240,7 +240,7 @@ function fix_locales {
if [[ ${found_locales[$locale]} == 'false' ]]; then if [[ ${found_locales[$locale]} == 'false' ]]; then
local language="${locale:0:5}" local language="${locale:0:5}"
echo "Locale: $locale missing" echo "Locale: $locale missing"
. /opt/miaou-bash/tools/smart_write /etc/locale.gen "(^# )?${language}\.UTF-8 UTF-8" "${language}.UTF-8 UTF-8" . /opt/miaou-bash/tools/smart_write /etc/locale.gen "(^# ?)?${language}\.UTF-8 UTF-8" "${language}.UTF-8 UTF-8"
should_regenerate=true should_regenerate=true
fi fi
done done
+19 -2
View File
@@ -5,8 +5,24 @@ INSTALL_URL='https://git.artcode.re/miaou/miaou-bash/raw/branch/main/install.sh'
# FUNCTIONS # FUNCTIONS
function container_upgrade { function container_upgrade {
echo "MIAOU_BASH_MODE=$MIAOU_BASH_MODE" local container_version host_version
. "$MIAOU_BASH_DIR"/lib/container-upgrade.bash host_version=$(<"$MIAOU_BASH_DIR"/.semver_git_tag)
if [[ -f /var/lib/miaou-bash/semver_current ]]; then
container_version=$(</var/lib/miaou-bash/semver_current)
else
container_version='M.m.p'
fi
if [[ "$container_version" == "$host_version" ]]; then
echo -n "initiating new version: $host_version"
else
echo -n "upgrading from $container_version to $host_version"
fi
echo ' (Ctrl-c to bypass)'
if sudo_root; then
sudo -E miaou-bash "$MIAOU_BASH_DIR"/lib/initiate.bash
else
builtin exit 1
fi
} }
function development_upgrade { function development_upgrade {
@@ -80,6 +96,7 @@ function perform_upgrade {
source "$MIAOU_BASH_DIR"/lib/functions.bash source "$MIAOU_BASH_DIR"/lib/functions.bash
fetch_mode fetch_mode
echo "upgrading mode: $MIAOU_BASH_MODE"
case "$MIAOU_BASH_MODE" in case "$MIAOU_BASH_MODE" in
hosted) container_upgrade ;; hosted) container_upgrade ;;
development) development_upgrade ;; development) development_upgrade ;;