Add temp repos to Debian too
This commit is contained in:
52
installJRMC
52
installJRMC
@@ -961,25 +961,41 @@ install_mc_deb() {
|
|||||||
execute rm -rf "$extract_dir"
|
execute rm -rf "$extract_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# On Ubuntu 24.04+, add jammy repos for libwebkit2gtk-4.0-37
|
add_temp_repo() {
|
||||||
local -i remove_jammy=0
|
local repo_name="$1"
|
||||||
|
local repo_uri="$2"
|
||||||
|
local repo_suite="$3"
|
||||||
|
local repo_key="$4"
|
||||||
|
declare -g TEMP_REPO_FILE="/etc/apt/sources.list.d/${repo_name}.sources"
|
||||||
|
|
||||||
|
echo "Creating temporary repository file $TEMP_REPO_FILE for $repo_suite"
|
||||||
|
sudo bash -c "cat <<-EOF > $TEMP_REPO_FILE
|
||||||
|
Types: deb
|
||||||
|
URIs: $repo_uri
|
||||||
|
Suites: $repo_suite
|
||||||
|
Components: main
|
||||||
|
Architectures: $MC_ARCH
|
||||||
|
Signed-By: $repo_key
|
||||||
|
EOF"
|
||||||
|
"${PKG_UPDATE[@]}" || { err "Package update failed!"; return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main logic for adding temporary repositories
|
||||||
|
local -i remove_temp_repo=0
|
||||||
if [[ "$ID" == "ubuntu" ]]; then
|
if [[ "$ID" == "ubuntu" ]]; then
|
||||||
local major_version="${VERSION_ID%%.*}"
|
local major_version="${VERSION_ID%%.*}"
|
||||||
local minor_version="${VERSION_ID##*.}"
|
local minor_version="${VERSION_ID##*.}"
|
||||||
if (( major_version > 24 || (major_version == 24 && minor_version >= 4) )); then
|
if [[ $major_version -gt 24 || ($major_version == 24 && minor_version -ge 4) ]]; then
|
||||||
echo "Temporarily adding jammy repository for libwebkit2gtk-4.0-37, etc."
|
echo "Temporarily adding jammy repository for libwebkit2gtk-4.0-37, etc."
|
||||||
local repo_file="/etc/apt/sources.list.d/jammy.sources"
|
remove_temp_repo=1
|
||||||
echo "Creating repository file $repo_file for jammy"
|
add_temp_repo "jammy" "https://archive.ubuntu.com/ubuntu" "jammy" "/usr/share/keyrings/ubuntu-archive-keyring.gpg"
|
||||||
sudo bash -c "cat <<-EOF > $repo_file
|
fi
|
||||||
Types: deb
|
elif [[ "$ID" == "debian" ]]; then
|
||||||
URIs: https://archive.ubuntu.com/ubuntu
|
local major_version="${VERSION_ID%%.*}"
|
||||||
Suites: jammy
|
if [[ $major_version -ge 13 || -z $major_version ]]; then
|
||||||
Components: main
|
echo "Temporarily adding bookworm repository for libwebkit2gtk-4.0-37, etc."
|
||||||
Architectures: $MC_ARCH
|
remove_temp_repo=1
|
||||||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
add_temp_repo "bookworm" "https://deb.debian.org/debian" "bookworm" "/usr/share/keyrings/debian-archive-keyring.gpg"
|
||||||
EOF"
|
|
||||||
"${PKG_UPDATE[@]}" || err "Package update failed!"
|
|
||||||
remove_jammy=1
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -998,13 +1014,15 @@ install_mc_deb() {
|
|||||||
--reinstall \
|
--reinstall \
|
||||||
"$temp_deb"; then
|
"$temp_deb"; then
|
||||||
err "Local MC DEB installation failed"
|
err "Local MC DEB installation failed"
|
||||||
((remove_jammy)) && { echo "Removing jammy repo"; execute sudo rm -f "$repo_file"; }
|
((remove_temp_repo)) && { echo "Removing temporary repo"; execute sudo rm -f "$TEMP_REPO_FILE"; }
|
||||||
if ask_ok "Remove source DEB and retry"; then
|
if ask_ok "Remove source DEB and retry"; then
|
||||||
execute sudo rm -f "$MC_DEB" "$temp_deb"
|
execute sudo rm -f "$MC_DEB" "$temp_deb"
|
||||||
exec "$SCRIPT_PATH" "$@" "--no-update"
|
exec "$SCRIPT_PATH" "$@" "--no-update"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
((remove_jammy)) && { echo "Removing jammy repo"; execute sudo rm -f "$repo_file"; }
|
|
||||||
|
# Cleanup temporary repository and temporary DEB file
|
||||||
|
((remove_temp_repo)) && { echo "Removing temporary repo"; execute sudo rm -f "$TEMP_REPO_FILE"; }
|
||||||
execute sudo rm -f "$temp_deb"
|
execute sudo rm -f "$temp_deb"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user