mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-07-16 05:49:49 +00:00
fix backports and system modules
- Refactored `is_backports_enabled()` to dynamically detect backports using `DEBIAN_CODENAME` instead of hardcoded strings, improving script portability. - Added support for standalone classic backports files (`/etc/apt/sources.list.d/debian-backports.list`) and deb822 format (`*.sources`) to ensure consistent detection across different repository configurations. - Resolved Mesa and Kernel backports detection bugs, ensuring correct dialogue prompts and preventing false error messages during installation. - Implemented smart rounding for zram memory allocation to the nearest Gigabyte for optimized performance. - Enhanced Whiptail manual input validation for zram to block empty, non-numeric, or zero values. - Introduced a dedicated `software_centers.sh` module for the modular and clean installation of GNOME Software and Plasma Discover. - Added smart desktop environment detection (GTK/QT) to automatically suggest and install the optimal software center. - Implemented a two-phase installation flow for software centers (Base Store -> Optional Flatpak support) with static consistency warnings based on the detected desktop environment. - update README.md
This commit is contained in:
+18
-16
@@ -265,24 +265,26 @@ get_intel_generation() {
|
||||
# Check if backports repository is enabled (active line without #)
|
||||
# ----------------------------------------------------------------------
|
||||
is_backports_enabled() {
|
||||
# Check classic sources.list
|
||||
if [ -f /etc/apt/sources.list ]; then
|
||||
if grep -Eq '^[^#]*[ \t]+bookworm-backports[ \t]+' /etc/apt/sources.list 2>/dev/null; then
|
||||
echo true
|
||||
return
|
||||
fi
|
||||
if grep -Eq '^[^#]*[ \t]+trixie-backports[ \t]+' /etc/apt/sources.list 2>/dev/null; then
|
||||
echo true
|
||||
return
|
||||
fi
|
||||
local codename="${DEBIAN_CODENAME:-}"
|
||||
[ -z "$codename" ] && { echo false; return; }
|
||||
|
||||
local c_pattern="^[^#]*${codename}-backports[[:space:]]+"
|
||||
local d_pattern="Suites:.*${codename}-backports"
|
||||
|
||||
# Classic embedded (sources.list)
|
||||
if [ -f /etc/apt/sources.list ] && grep -Eq "$c_pattern" /etc/apt/sources.list 2>/dev/null; then
|
||||
echo true; return
|
||||
fi
|
||||
|
||||
# Check deb822 .sources files
|
||||
if [ -d /etc/apt/sources.list.d ]; then
|
||||
if grep -qr 'Suites:.*-backports' /etc/apt/sources.list.d/*.sources 2>/dev/null; then
|
||||
echo true
|
||||
return
|
||||
fi
|
||||
# Classic standalone (new — debian-backports.list)
|
||||
if [ -f /etc/apt/sources.list.d/debian-backports.list ] && \
|
||||
grep -Eq "$c_pattern" /etc/apt/sources.list.d/debian-backports.list 2>/dev/null; then
|
||||
echo true; return
|
||||
fi
|
||||
|
||||
# Deb822 any .sources file
|
||||
if grep -qr "$d_pattern" /etc/apt/sources.list.d/*.sources 2>/dev/null; then
|
||||
echo true; return
|
||||
fi
|
||||
|
||||
echo false
|
||||
|
||||
Reference in New Issue
Block a user