blob: d39427e9fdef49241268d244756fd30e71af1ef1 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001From a52d763559d1017ca73d2a2933aba1c78ad354c6 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal@rzerosystems.com>
3Date: Thu, 27 Jan 2022 16:32:25 -0600
4Subject: [PATCH] unattended-upgrade: Remove distro_info usage to check devel
5 releases
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10The distro-info python3 package is used to check if the release is a
11devel release and choice if continue with unattended-upgrade for now
12remove it because needs support into python3-distro-info [1].
13
14[1] https://salsa.debian.org/debian/distro-info
15
16Signed-off-by: Aníbal Limón <anibal@rzerosystems.com>
17
18Upstream-Status: Inappropriate
19---
20 unattended-upgrade | 38 --------------------------------------
21 1 file changed, 38 deletions(-)
22
23diff --git a/unattended-upgrade b/unattended-upgrade
24index 802d4d5..3b4e83e 100755
25--- a/unattended-upgrade
26+++ b/unattended-upgrade
27@@ -83,9 +83,6 @@ import apt
28 import apt_inst
29 import apt_pkg
30
31-import distro_info
32-
33-
34 # the reboot required flag file used by packages
35 REBOOT_REQUIRED_FILE = "/var/run/reboot-required"
36 KEPT_PACKAGES_FILE = "var/lib/unattended-upgrades/kept-back"
37@@ -2061,41 +2058,6 @@ def run(options, # type: Options
38 if should_stop():
39 return UnattendedUpgradesResult(False)
40
41- # check to see if want to auto-upgrade the devel release
42- if apt_pkg.config.find("Unattended-Upgrade::DevRelease") == "auto":
43- try:
44- if DISTRO_ID.lower() == 'ubuntu':
45- devel = (distro_info.UbuntuDistroInfo() .
46- devel(result="object"))
47- elif DISTRO_ID.lower() == 'debian':
48- devel = (distro_info.DebianDistroInfo() .
49- devel(result="object"))
50- else:
51- devel = (distro_info.DistroInfo(DISTRO_ID) .
52- devel(result="object"))
53- except Exception as e:
54- logging.warning("Could not figure out development release: %s" % e)
55- else:
56- if ((devel.series == DISTRO_CODENAME
57- and devel.release is not None
58- and devel.release - date.today() > DEVEL_UNTIL_RELEASE)):
59- syslog.syslog((_("Not running on this development "
60- "release before %s") %
61- (devel.release - DEVEL_UNTIL_RELEASE
62- - datetime.timedelta(days=1))))
63- logging.warning(_("Not running on this development "
64- "release before %s") %
65- (devel.release - DEVEL_UNTIL_RELEASE
66- - datetime.timedelta(days=1)))
67- return UnattendedUpgradesResult(True)
68-
69- logging.debug("Running on the development release")
70- elif "(development branch)" in DISTRO_DESC and not\
71- apt_pkg.config.find_b("Unattended-Upgrade::DevRelease", True):
72- syslog.syslog(_("Not running on the development release."))
73- logging.info(_("Not running on the development release."))
74- return UnattendedUpgradesResult(True)
75-
76 logging.info(_("Starting unattended upgrades script"))
77
78 # check and get lock