From de24f68f2b25dcbb80502b73a201a9de4c071e2c Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sat, 12 Apr 2025 21:51:15 -0500 Subject: [PATCH] [pkgselectprocess] Compliment the previous commit by aligning installation of Calamares To complement the last fix, ensure that Calamares ends up on the removal list for non-stacked squashfses if and only if OEM is disabled, and Calamares shows up on the install list only for stacked squashfses which have OEM enabled. This nuanced approach ensures all potential combinations have the intended functionality. --- .../pkgselectprocess/PackageSelectProcess.cpp | 29 +++++++++++++++---- debian/changelog | 5 ++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/common/modules/pkgselectprocess/PackageSelectProcess.cpp b/common/modules/pkgselectprocess/PackageSelectProcess.cpp index 7fc687f..6056ae6 100644 --- a/common/modules/pkgselectprocess/PackageSelectProcess.cpp +++ b/common/modules/pkgselectprocess/PackageSelectProcess.cpp @@ -365,15 +365,19 @@ Calamares::JobResult PackageSelectProcess::exec() const QString checkpackage_path = "/usr/libexec/checkpackage-backend"; const QString chroot_checkpackage_path = rootMountPoint + checkpackage_path; - // As part of the fix for LP: #2104343, we need to ensure that, if - // we are currently in OEM mode, Calamares and friends remain - // installed. During stage two, we clean it up. + // Corresponding to the temporary hack in pkgselect adding calamares + // and kdialog to the list, we only want those two included in the + // final installation if we're actually in OEM mode. Otherwise, they + // can be ignored, and are just clutter. // FIXME: When the OEM stack is rewritten in 25.10, this needs to be - // rewritten. - if (QFile::exists("/etc/calamares/OEM_MODE_ACTIVATED")) { + // removed. + if (!QFile::exists("/etc/calamares/OEM_MODE_ACTIVATED")) { QStringList wip_list; for (auto debPackage : debPackages) { - if (!debPackage.contains(QString("calamares"))) wip_list << debPackage; + if (!debPackage.contains(QString("calamares")) && + !debPackage.contains(QString("kdialog"))) { + wip_list << debPackage; + } } debPackages = wip_list; } @@ -408,6 +412,19 @@ Calamares::JobResult PackageSelectProcess::exec() removeDebPackages << var.toString(); } + // As part of the fix for LP: #2104343, we need to ensure that, if + // we are currently in OEM mode, Calamares and friends remain + // installed. During stage two, we clean it up. + // FIXME: When the OEM stack is rewritten in 25.10, this needs to be + // rewritten. + if (QFile::exists("/etc/calamares/OEM_MODE_ACTIVATED")) { + QStringList wip_list; + for (auto removeDebPackage : removeDebPackages) { + if (!removeDebPackage.contains(QString("calamares"))) wip_list << removeDebPackage; + } + removeDebPackages = wip_list; + } + const double removeStart = installEnd; const double removeEnd = removeStart + 0.2 * aptRange; diff --git a/debian/changelog b/debian/changelog index 0527c76..04536b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,11 @@ calamares-settings-ubuntu (1:25.04.25) UNRELEASED; urgency=medium about stacked squashfses, it's what provides the final "additional install list" to be considered by checkpackage-backend, and this is a temporary fix anyway (LP: #2104343). + * [pkgselectprocess] To complement the last fix, ensure that Calamares ends + up on the removal list for non-stacked squashfses if and only if OEM is + disabled, and Calamares shows up on the install list only for stacked + squashfses which have OEM enabled. This nuanced approach ensures all + potential combinations have the intended functionality. -- Simon Quigley Sat, 12 Apr 2025 00:23:39 -0500