Merge lp:~brian-murray/ubuntu-archive-tools/identify-security into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Merged at revision: 1335
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/identify-security
Merge into: lp:ubuntu-archive-tools
Diff against target: 47 lines (+15/-2)
1 file modified
phased-updater (+15/-2)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/identify-security
Reviewer Review Type Date Requested Status
Ubuntu Package Archive Administrators Pending
Review via email: mp+181162@code.launchpad.net

Description of the change

Identify security updates in the fully phased report by appending (security) after the version.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phased-updater'
2--- phased-updater 2013-08-19 19:39:39 +0000
3+++ phased-updater 2013-08-20 21:36:23 +0000
4@@ -137,6 +137,16 @@
5 for pub_source in buckets[rname]:
6 pkg = pub_source.source_package_name
7 version = pub_source.source_package_version
8+ # Identify security updates
9+ if options.fully_phased:
10+ sec_pubs = [(ps.source_package_name,
11+ ps.source_package_version)
12+ for ps in archive.getPublishedSources(
13+ distro_series=release, pocket='Security',
14+ source_name=pkg, version=version,
15+ exact_match=True)]
16+ if (pkg, version) in sec_pubs:
17+ version += ' (security)'
18 age = (datetime.datetime.now() -
19 pub_source.date_published.replace(tzinfo=None)).days
20 update_percentage = buckets[rname][pub_source].get('pup', 100)
21@@ -418,8 +428,6 @@
22 # TODO: make email code less redundant
23 # TODO: modify HTTP_USER_AGENT (both versions of urllib)
24 # TODO: Open bugs for regressions when false positives reduced
25- ubuntu = launchpad.distributions['ubuntu']
26- archive = ubuntu.getArchive(name='primary')
27 options.archive = archive
28
29 overrides = defaultdict(list)
30@@ -551,12 +559,17 @@
31 options, args = parser.parse_args()
32 if options.launchpad_instance != 'production':
33 LP_BASE_URL = 'https://%s.launchpad.net' % options.launchpad_instance
34+ if options.email and options.fully_phased:
35+ parser.error("Sending emails and fully phased updates are mutually \
36+exclusive.")
37 launchpad = Launchpad.login_with(
38 'phased-updater', options.launchpad_instance, version='devel')
39 logging.basicConfig(filename='phased-updates.log',
40 format='%(asctime)s - %(levelname)s - %(message)s',
41 level=logging.INFO)
42 logging.info('Starting phased-updater')
43+ ubuntu = launchpad.distributions['ubuntu']
44+ archive = ubuntu.getArchive(name='primary')
45 main()
46 end_time = time.time()
47 logging.info("Elapsed time was %g seconds" % (end_time - start_time))

Subscribers

People subscribed via source and target branches