Skip to content
Snippets Groups Projects
Commit 5bab20d0 authored by Luis Guzmán's avatar Luis Guzmán
Browse files

update-manager: update patches and match newer release.

parent 226526fc
No related branches found
No related tags found
1 merge request!1501update-manager: update patches and match newer release.
From 79b3c51dac13c1b2689d139bb0667fa27e8a02a9 Mon Sep 17 00:00:00 2001
From: Nathan Pratta Teodosio <nathan.teodosio@canonical.com>
Date: Fri, 22 Mar 2024 08:24:04 +0100
Subject: 1:22.04.20 (patches unapplied)
# Changelog portion removed to avoid version conflict --ark74
Imported using git-ubuntu import.
---
UpdateManager/UpdateManager.py | 60 ++++++++++++++++++++++--------------------
debian/changelog | 10 +++++++
2 files changed, 41 insertions(+), 29 deletions(-)
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index 5882e0a0..03b11aa3 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -27,6 +27,7 @@ from gi.repository import Gdk, GdkX11
from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GObject
+import uaclient.api.u.pro.packages.updates.v1 as ua
GdkX11 # pyflakes
@@ -36,11 +37,11 @@ warnings.filterwarnings("ignore", "Accessed deprecated property",
import distro_info
import fnmatch
-import json
import os
import subprocess
import sys
import time
+import threading
from gettext import gettext as _
import dbus
@@ -270,36 +271,37 @@ class UpdateManager(Gtk.Window):
and pkg.installed:
self.oem_metapackages.add(pkg)
+ def _fetch_ua_updates(self):
+ self.ua_updates = ua.updates().updates
+
def _get_ua_security_status(self):
self.ua_security_packages = []
- try:
- p = subprocess.Popen(['pro', 'security-status', '--format=json'],
- stdout=subprocess.PIPE)
- except OSError:
- pass
- else:
- while p.poll() is None:
- while Gtk.events_pending():
- Gtk.main_iteration()
- time.sleep(0.05)
- s = json.load(p.stdout)
- for package in s.get('packages', []):
- if package.get('service_name', '') == 'standard-security':
- continue
- status = package.get('status', '')
- if (
- status == 'pending_attach'
- or status == 'pending_enable'
- or status == 'upgrade_available'
- ):
- name = package.get('package', '')
- version = package.get('version', '')
- size = package.get('download_size', 0)
- downloadable = status == 'upgrade_available'
- self.ua_security_packages.append(
- (name, version, size, downloadable)
- )
- self.cache.create_pro_cache(self.ua_security_packages)
+ t = threading.Thread(target=self._fetch_ua_updates, daemon=True)
+ t.start()
+ while t.is_alive():
+ while Gtk.events_pending():
+ Gtk.main_iteration()
+ time.sleep(0.05)
+ for package in self.ua_updates:
+ if (
+ package.provided_by == 'standard-security'
+ or package.provided_by == 'standard-updates'
+ ):
+ continue
+ status = package.status
+ if (
+ status == 'pending_attach'
+ or status == 'pending_enable'
+ or status == 'upgrade_available'
+ ):
+ name = package.package
+ version = package.version
+ size = package.download_size
+ downloadable = status == 'upgrade_available'
+ self.ua_security_packages.append(
+ (name, version, size, downloadable)
+ )
+ self.cache.create_pro_cache(self.ua_security_packages)
def _make_available_pane(self, install_count, need_reboot=False,
cancelled_update=False, error_occurred=False):
--
cgit v1.2.3
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager.py
index 3b9eaa58..d44040d5 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager.py
@@ -25,7 +25,6 @@ from gi.repository import Gdk, GdkX11
from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GObject
-import uaclient.api.u.pro.packages.updates.v1 as ua
GdkX11 # pyflakes
@@ -40,7 +40,6 @@ import os
import subprocess
import sys
import time
-import threading
from gettext import gettext as _
import dbus
@@ -90,7 +88,6 @@ class UpdateManager(Gtk.Window):
self.unity = UnitySupport()
self.controller = None
self.cache = None
- self.ua_security_packages = []
self.update_list = None
self.meta_release = None
self.hwe_replacement_packages = None
@@ -287,42 +286,6 @@ class UpdateManager(Gtk.Window):
and pkg.installed:
self.oem_metapackages.add(pkg)
- def _fetch_ua_updates(self):
- try:
- self.ua_updates = ua.updates().updates
- except:
- self.ua_updates = []
-
- def _get_ua_security_status(self):
- self.ua_security_packages = []
- self.ua_updates = []
- t = threading.Thread(target=self._fetch_ua_updates, daemon=True)
- t.start()
- while t.is_alive():
- while Gtk.events_pending():
- Gtk.main_iteration()
- time.sleep(0.05)
- for package in self.ua_updates:
- if (
- package.provided_by == 'standard-security'
- or package.provided_by == 'standard-updates'
- ):
- continue
- status = package.status
- if (
- status == 'pending_attach'
- or status == 'pending_enable'
- or status == 'upgrade_available'
- ):
- name = package.package
- version = package.version
- size = package.download_size
- downloadable = status == 'upgrade_available'
- self.ua_security_packages.append(
- (name, version, size, downloadable)
- )
- self.cache.create_pro_cache(self.ua_security_packages)
-
def _make_available_pane(self, install_count, need_reboot=False,
cancelled_update=False, error_occurred=False):
self._check_hwe_support_status()
@@ -495,8 +460,6 @@ class UpdateManager(Gtk.Window):
self._check_oem_metapackages()
- self._get_ua_security_status()
-
for pkgname in self.oem_metapackages:
try:
if not self.cache[pkgname].is_installed:
@@ -488,9 +451,7 @@ class UpdateManager(Gtk.Window):
self.update_list = UpdateList(self)
try:
self.update_list.update(self.cache, eventloop_callback=iterate,
- duplicate_packages=self.duplicate_packages,
- ua_security_packages=self.
- ua_security_packages)
+ duplicate_packages=self.duplicate_packages)
except SystemError as e:
header = _("Could not calculate the upgrade")
desc = _("An unresolvable problem occurred while "
diff --git a/UpdateManager/Core/MyCache.py b/UpdateManager/Core/MyCache.py
index fc227822..89f4a774 100644
--- a/UpdateManager/Core/MyCache.py
+++ b/UpdateManager/Core/MyCache.py
@@ -424,48 +424,3 @@ class MyCache(DistUpgrade.DistUpgradeCache.MyCache):
"Failed to download the list of changes. \n"
"Please check your Internet connection.")
self.all_changes[name] += error_message
-
- # If the machine is not attached to Ubuntu Pro, Update Manager advertises
- # the upgrades that would be available if it were attached.
- # As that is unbeknownst to Apt, we need this map to show the correct
- # version of each upgradable-if-pro-subscribed package.
- def create_pro_cache(self, pro_pkgs):
- for (name, version, _a, _a) in pro_pkgs:
- self.pro_versions[name] = version
-
- def get_changelog(self, name):
- " get the changelog file from the changelog location "
- origins = self[name].candidate.origins
- version = self.pro_versions.get(name, self[name].candidate.version)
- self.all_changes[name] = _("Changes for %s versions:\n"
- "Installed version: %s\n"
- "Available version: %s\n\n") % \
- (name, getattr(self[name].installed, "version", None), version)
- if self.CHANGELOG_ORIGIN not in [o.origin for o in origins]:
- self._fetch_changelog_for_third_party_package(name, origins)
- return
- # fixup epoch handling version
- srcpkg = self[name].candidate.source_name
- srcver_epoch = self[name].candidate.source_version.replace(':', '%3A')
- try:
- changelog = self._get_changelog_or_news(name, "changelog")
- if len(changelog) == 0:
- changelog = _("The changelog does not contain any relevant "
- "changes.\n\n"
- "Please use http://launchpad.net/ubuntu/+source/"
- "%s/%s/+changelog\n"
- "until the changes become available or try "
- "again later.") % (srcpkg, srcver_epoch)
- except HTTPError:
- changelog = _("The list of changes is not available yet.\n\n"
- "Please use http://launchpad.net/ubuntu/+source/"
- "%s/%s/+changelog\n"
- "until the changes become available or try again "
- "later.") % (srcpkg, srcver_epoch)
- except (IOError, BadStatusLine, socket.error) as e:
- print("caught exception: ", e)
- changelog = _("Failed to download the list "
- "of changes. \nPlease "
- "check your Internet "
- "connection.")
- self.all_changes[name] += changelog
--- UpdateManager/Core/utils.py 2015-10-21 04:05:26.461825091 +0200
+++ UpdateManager/Core/utils.py.new 2015-10-21 04:03:30.461825105 +0200
--- a/UpdateManager/Core/utils.py 2015-10-21 04:05:26.461825091 +0200
+++ b/UpdateManager/Core/utils.py 2015-10-21 04:03:30.461825105 +0200
@@ -426,7 +426,7 @@
# From spec, first if ubuntu-desktop is installed, use that.
# Second, grab first installed one from DistUpgrade.cfg.
......
......@@ -23,30 +23,34 @@ VERSION=23
. ./config
PRE_REVISION=10.0
PRE_UPSTREAMRELEASE=20.04
rm UpdateManager/Core/LivePatchSocket.py
rm tests/test_livepatch_socket.py
# Important patch make sure to update when necessary.
patch --no-backup-if-mismatch -p1 < $DATA/remove-livepatch2.patch
patch_p1 $DATA/remove-livepatch2.patch
sed -i "/ubuntu-advantage-tools/d" debian/control
#Closes #12545
patch --no-backup-if-mismatch -p0 < $DATA/trisquel-versions.patch
patch_p1 $DATA/trisquel-versions.patch
cp $DATA/index.docbook help/C/index.docbook
# Prevent automated connections
patch --no-backup-if-mismatch -p1 < $DATA/prevent-autoconnection.patch
patch_p1 $DATA/prevent-autoconnection.patch
# NOTE: prevent-autoconnection.patch l10n is now part of the DATA/l10n/ patches.
# Roll back the usage of uaclient.api.u.pro.packages.updates.v1
patch --no-backup-if-mismatch -p1 -R < $DATA/rm-usage_uaclient.api.u.pro.packages.updates.v1.patch
patch_p1 $DATA/rm_pro.packages.updates_from_u-m.patch
replace internet Internet .
replace Ubuntu Trisquel .
replace TrisquelDistroInfo UbuntuDistroInfo .
replace "Trisquel-Gettext" "Ubuntu-Gettext" .
sed -i 's/Trisquel 20.04 LTS to Trisquel 22.04 LTS/Trisquel 10.0 LTS to Trisquel 11.0 LTS/' HweSupportStatus/consts.py
sed -i "s|Trisquel $PRE_UPSTREAMRELEASE LTS to Trisquel $UPSTREAMRELEASE LTS|Trisquel $PRE_REVISION LTS to Trisquel $REVISION LTS|" \
HweSupportStatus/consts.py
replace kubuntu-desktop triskel .
replace xubuntu-desktop trisquel-mini .
......@@ -55,7 +59,6 @@ replace ubuntu-desktop trisquel .
sed '/%s base/ s/name.*/name = "Trisquel base"/' -i ./UpdateManager/Core/UpdateList.py
sed 's_https://changelogs.ubuntu.com/changelogs/pool/_https://packages.trisquel.org/changelogs/pool/_' -i UpdateManager/Core/MyCache.py
sed '/len(changelog) == 0/,/"later."/d' -i UpdateManager/Core/MyCache.py
#Make sure apt_pkg is enabled for prevent-autoconnection.patch to work.
[ -z "$(grep 'import apt_pkg' UpdateManager/UpdateManager.py)" ] && \
......@@ -76,8 +79,7 @@ sed -i 's|changelogs.ubuntu.com/|archive.trisquel.org/trisquel/|' UpdateManager/
# Trisquel l10n modifications using git patches.
for patch in $(ls -v ${DATA}/l10n/*.patch)
do
echo "> Applying $(echo $patch|xargs basename)"
patch --no-backup-if-mismatch -Np1 < $patch
patch_p1 $patch
done
changelog "Compiled for Trisquel"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment