17
class UbuntuMaintenance(object):
18
""" Represents the support timeframe for a regular ubuntu release """
20
# architectures that are full supported (including LTS time)
26
# architectures we support (but not for LTS time)
27
SUPPORTED_ARCHES = PRIMARY_ARCHES + ["armel"]
29
# what defines the seeds is documented in wiki.ubuntu.com/SeedManagement
37
"supported-desktop-extra",
39
SUPPORTED_SEEDS = ["all"]
41
# normal support timeframe
44
("18m", SUPPORTED_SEEDS),
47
# distro names that we check the seeds for
53
19
# This is fun! We have a bunch of cases for 10.04 LTS
55
21
# - distro "ubuntu" follows SUPPORT_TIMEFRAME_LTS but only for
58
24
# considered *but* only follow SUPPORT_TIMEFRAME
59
25
# - anything that is in armel follows SUPPORT_TIMEFRAME
61
class LucidUbuntuMaintenance(UbuntuMaintenance):
62
""" Represents the support timeframe for a 10.04 (lucid) LTS release,
63
the exact rules differ from LTS release to LTS release
66
# lts support timeframe, order is important, least supported must be last
69
("5y", UbuntuMaintenance.SERVER_SEEDS),
70
("3y", UbuntuMaintenance.DESKTOP_SEEDS),
71
("18m", UbuntuMaintenance.SUPPORTED_SEEDS),
74
# on a LTS this is significant, it defines what names get LTS support
81
class PreciseUbuntuMaintenance(UbuntuMaintenance):
82
""" The support timeframe for the 12.04 (precise) LTS release.
83
This changes the timeframe for desktop packages from 3y to 5y
86
# lts support timeframe, order is important, least supported must be last
89
("5y", UbuntuMaintenance.SERVER_SEEDS),
90
("5y", UbuntuMaintenance.DESKTOP_SEEDS),
91
("18m", UbuntuMaintenance.SUPPORTED_SEEDS),
94
# on a LTS this is significant, it defines what names get LTS support
28
# codename of the lts releases
29
LTS_RELEASES = ["dapper", "hardy", "lucid"]
31
# architectures that are full supported (including LTS time)
32
PRIMARY_ARCHES = ["i386", "amd64"]
34
# architectures we support (but not for LTS time)
35
SUPPORTED_ARCHES = PRIMARY_ARCHES + ["armel"]
37
# what defines the seeds is documented in wiki.ubuntu.com/SeedManagement
38
SERVER_SEEDS = ["supported-server", "server-ship"]
39
DESKTOP_SEEDS = ["ship", "supported-desktop", "supported-desktop-extra"]
40
SUPPORTED_SEEDS = ["all"]
42
# normal support timeframe
45
("18m", SUPPORTED_SEEDS),
48
# lts support timeframe
50
SUPPORT_TIMEFRAME_LTS = [
52
("3y", DESKTOP_SEEDS),
53
("18m", SUPPORTED_SEEDS),
56
# distro names and if they get LTS support (order is important)
57
DISTRO_NAMES_AND_LTS_SUPPORT = [
100
63
# Names of the distribution releases that are not supported by this
101
64
# tool. All later versions are supported.
139
102
:return: A list of binary package names.
142
recs = apt_pkg.SourceRecords()
143
while recs.lookup(srcname):
144
for binary in recs.binaries:
105
recs = apt_pkg.GetPkgSrcRecords()
106
while recs.Lookup(srcname):
107
for binary in recs.Binaries:
145
108
pkgnames.add(binary)
381
338
# get dicts of pkgname -> support timeframe string
382
support_timeframe = ubuntu_maintenance.SUPPORT_TIMEFRAME
339
support_timeframe = SUPPORT_TIMEFRAME
340
if lts_supported and distro in LTS_RELEASES:
341
support_timeframe = SUPPORT_TIMEFRAME_LTS
343
support_timeframe = SUPPORT_TIMEFRAME
383
344
get_packages_support_time(
384
345
structure, name, pkg_support_time, support_timeframe)
386
347
# now go over the bits in main that we have not seen (because
387
348
# they are not in any seed and got added manually into "main"
388
for arch in ubuntu_maintenance.PRIMARY_ARCHES:
349
for arch in PRIMARY_ARCHES:
389
350
rootdir = "./aptroot.%s" % distro
390
apt_pkg.config.set("APT::Architecture", arch)
351
apt_pkg.Config.Set("APT::Architecture", arch)
391
352
cache = apt.Cache(rootdir=rootdir)
354
cache.update(apt.progress.FetchProgress())
394
355
except SystemError:
395
356
logging.exception("cache.update() failed")
357
cache.open(apt.progress.OpProgress())
397
358
for pkg in cache:
398
# ignore multiarch package names
401
359
if not pkg.name in pkg_support_time:
402
360
pkg_support_time[pkg.name] = support_timeframe[-1][0]
446
404
# go over the supported arches, they are divided in
447
405
# first-class (PRIMARY) and second-class with different
449
for arch in ubuntu_maintenance.SUPPORTED_ARCHES:
407
for arch in SUPPORTED_ARCHES:
450
408
# ensure we do not overwrite arch-specific overwrites
451
409
pkgname_and_arch = "%s/%s" % (pkgname, arch)
452
410
if pkgname_and_arch in pkg_support_time:
454
if arch in ubuntu_maintenance.PRIMARY_ARCHES:
412
if arch in PRIMARY_ARCHES:
455
413
# arch with full LTS support
456
414
print "%s %s %s" % (
457
415
pkgname_and_arch, SUPPORT_TAG,