diff --git a/helpers/DATA/ubuntu-release-upgrader/patch_changes/002-prevent_trisquel-sugar_to_fail_dependency_resolve.patch b/helpers/DATA/ubuntu-release-upgrader/patch_changes/002-prevent_trisquel-sugar_to_fail_dependency_resolve.patch new file mode 100644 index 0000000..937587a --- /dev/null +++ b/helpers/DATA/ubuntu-release-upgrader/patch_changes/002-prevent_trisquel-sugar_to_fail_dependency_resolve.patch @@ -0,0 +1,50 @@ +diff --git a/DistUpgrade/DistUpgradeQuirks.py b/DistUpgrade/DistUpgradeQuirks.py +index f7427ac2..51f85b32 100644 +--- a/DistUpgrade/DistUpgradeQuirks.py ++++ b/DistUpgrade/DistUpgradeQuirks.py +@@ -190,6 +190,7 @@ class DistUpgradeQuirks(object): + """ run right before calculating the dist-upgrade """ + logging.debug("running Quirks.PreDistUpgradeCache") + # self._install_python_is_python2() ++ self._t64_transition_helper() + self._protect_essential_gui() + self._maybe_remove_gpg_wks_server() + self._install_t64_replacement_packages() +@@ -205,6 +206,37 @@ class DistUpgradeQuirks(object): + self._disable_cloud_init() + + # helpers ++ def _t64_transition_helper(self): ++ """ ++ Provides a minimal t64 transition focused on GLib and Qt5Core. ++ Marks the t64 variants for installation if the older packages are ++ installed. Idempotent and conservative for initial testing. ++ """ ++ cache = self.controller.cache ++ log = logging.getLogger("DistUpgrade") ++ ++ # Run only if at least one of the target t64 packages is in the cache. ++ if "libglib2.0-0t64" not in cache and "libqt5core5t64" not in cache: ++ log.debug("t64-helper: no target t64 packages in cache; skipping") ++ return ++ ++ pairs = [ ++ ("libglib2.0-0", "libglib2.0-0t64"), ++ ("libqt5core5a", "libqt5core5t64"), ++ ] ++ ++ touched = [] ++ for old, new in pairs: ++ try: ++ if old in cache and cache[old].is_installed and new in cache: ++ cache[new].mark_install(True, True, False) ++ touched.append(f"{old}->{new}") ++ except Exception as e: ++ log.warning("t64-helper: error marking %s->%s: %s", old, new, e) ++ ++ if touched: ++ log.info("t64-helper: touched=%s", ", ".join(touched)) ++ + def _is_lxde_system(self): + """Return True if LXDE (trisquel-mini) is detected as installed.""" + cache = self.controller.cache diff --git a/helpers/DATA/ubuntu-release-upgrader/patch_changes/003-prevent_trisquel_old_versioning_overcome_ecnes_new_version_scheme.patch b/helpers/DATA/ubuntu-release-upgrader/patch_changes/003-prevent_trisquel_old_versioning_overcome_ecnes_new_version_scheme.patch new file mode 100644 index 0000000..85f9166 --- /dev/null +++ b/helpers/DATA/ubuntu-release-upgrader/patch_changes/003-prevent_trisquel_old_versioning_overcome_ecnes_new_version_scheme.patch @@ -0,0 +1,102 @@ +diff --git a/DistUpgrade/DistUpgradeQuirks.py b/DistUpgrade/DistUpgradeQuirks.py +index 243efc14..a63db6bb 100644 +--- a/DistUpgrade/DistUpgradeQuirks.py ++++ b/DistUpgrade/DistUpgradeQuirks.py +@@ -196,6 +196,8 @@ class DistUpgradeQuirks(object): + self._install_t64_replacement_packages() + self._install_pipewire_audio_on_ubuntu_studio() + self._handle_ufw_breaks() ++ cache = self._get_cache() ++ self._prefer_ecne_suffix(cache) + + # individual quirks handler that run *after* the dist-upgrade was + # calculated in the cache +@@ -206,6 +208,88 @@ class DistUpgradeQuirks(object): + self._disable_cloud_init() + + # helpers ++ def _get_cache(self): ++ """ ++ Return the active apt cache used by the upgrader, regardless of how ++ this DistUpgradeQuirks instance was wired in this fork. ++ """ ++ for attr in ("cache", "_cache", "apt_cache"): ++ c = getattr(self, attr, None) ++ if c is not None: ++ return c ++ ctrl = getattr(self, "controller", None) or getattr(self, "_controller", None) ++ if ctrl: ++ for attr in ("cache", "_cache"): ++ c = getattr(ctrl, attr, None) ++ if c is not None: ++ return c ++ return None ++ ++ def _prefer_ecne_suffix(self, cache): ++ """ ++ Force candidate versions to Ecne-style (e.g. '101trisquel1') when the ++ installed version uses the older '+11.0trisquel' scheme. This avoids ++ holding back old packages and enables the intended transition/downgrade. ++ """ ++ import logging ++ import apt_pkg ++ ++ if cache is None or not hasattr(cache, "_depcache"): ++ logging.debug("prefer-ecne-suffix: cache not available, skipping") ++ return ++ ++ changed = 0 ++ depcache = cache._depcache ++ ++ for pkg in cache: ++ # Only act on installed packages with the old '+11.0trisquel' suffix ++ if not getattr(pkg, "is_installed", False): ++ continue ++ inst = pkg.installed ++ if not inst: ++ continue ++ inst_ver = getattr(inst, "version", "") ++ if "+11.0trisquel" not in inst_ver: ++ continue ++ ++ # Find a target version that is trisquel*-style but NOT '+11.0trisquel' ++ target = None ++ for ver in pkg.versions: ++ vstr = getattr(ver, "version", "") ++ if "+11.0trisquel" in vstr: ++ continue ++ if "trisquel" in vstr: ++ target = ver ++ break ++ if not target: ++ continue ++ ++ # Resolve the underlying apt_pkg.Version so we can set it as candidate ++ aptpkg_pkg = pkg._pkg ++ aptpkg_ver = None ++ for v in aptpkg_pkg.version_list: ++ if v.ver_str == target.version: ++ aptpkg_ver = v ++ break ++ if aptpkg_ver is None: ++ continue ++ ++ # Force candidate and request an upgrade/install to pull it in ++ depcache.set_candidate_ver(aptpkg_pkg, aptpkg_ver) ++ try: ++ pkg.mark_upgrade() ++ except Exception: ++ try: ++ pkg.mark_install() ++ except Exception: ++ continue ++ changed += 1 ++ ++ if changed: ++ logging.info("prefer-ecne-suffix: changed packages=%d", changed) ++ else: ++ logging.debug("prefer-ecne-suffix: no candidates changed") ++ + def _t64_transition_helper(self): + """ + Provides a minimal t64 transition focused on GLib and Qt5Core. diff --git a/helpers/make-ubuntu-release-upgrader b/helpers/make-ubuntu-release-upgrader index 0cd9958..9f962a3 100644 --- a/helpers/make-ubuntu-release-upgrader +++ b/helpers/make-ubuntu-release-upgrader @@ -25,7 +25,7 @@ # Also, don't forget to update the meta-release files at archive and packages.t.i # The "obsoletes" list from ubuntu has been removed -VERSION=16.4 +VERSION=16.5 . ./config # Previous upstream release name, update for each release.