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
=== modified file 'phased-updater'
--- phased-updater 2013-08-19 19:39:39 +0000
+++ phased-updater 2013-08-20 21:36:23 +0000
@@ -137,6 +137,16 @@
137 for pub_source in buckets[rname]:137 for pub_source in buckets[rname]:
138 pkg = pub_source.source_package_name138 pkg = pub_source.source_package_name
139 version = pub_source.source_package_version139 version = pub_source.source_package_version
140 # Identify security updates
141 if options.fully_phased:
142 sec_pubs = [(ps.source_package_name,
143 ps.source_package_version)
144 for ps in archive.getPublishedSources(
145 distro_series=release, pocket='Security',
146 source_name=pkg, version=version,
147 exact_match=True)]
148 if (pkg, version) in sec_pubs:
149 version += ' (security)'
140 age = (datetime.datetime.now() -150 age = (datetime.datetime.now() -
141 pub_source.date_published.replace(tzinfo=None)).days151 pub_source.date_published.replace(tzinfo=None)).days
142 update_percentage = buckets[rname][pub_source].get('pup', 100)152 update_percentage = buckets[rname][pub_source].get('pup', 100)
@@ -418,8 +428,6 @@
418 # TODO: make email code less redundant428 # TODO: make email code less redundant
419 # TODO: modify HTTP_USER_AGENT (both versions of urllib)429 # TODO: modify HTTP_USER_AGENT (both versions of urllib)
420 # TODO: Open bugs for regressions when false positives reduced430 # TODO: Open bugs for regressions when false positives reduced
421 ubuntu = launchpad.distributions['ubuntu']
422 archive = ubuntu.getArchive(name='primary')
423 options.archive = archive431 options.archive = archive
424432
425 overrides = defaultdict(list)433 overrides = defaultdict(list)
@@ -551,12 +559,17 @@
551 options, args = parser.parse_args()559 options, args = parser.parse_args()
552 if options.launchpad_instance != 'production':560 if options.launchpad_instance != 'production':
553 LP_BASE_URL = 'https://%s.launchpad.net' % options.launchpad_instance561 LP_BASE_URL = 'https://%s.launchpad.net' % options.launchpad_instance
562 if options.email and options.fully_phased:
563 parser.error("Sending emails and fully phased updates are mutually \
564exclusive.")
554 launchpad = Launchpad.login_with(565 launchpad = Launchpad.login_with(
555 'phased-updater', options.launchpad_instance, version='devel')566 'phased-updater', options.launchpad_instance, version='devel')
556 logging.basicConfig(filename='phased-updates.log',567 logging.basicConfig(filename='phased-updates.log',
557 format='%(asctime)s - %(levelname)s - %(message)s',568 format='%(asctime)s - %(levelname)s - %(message)s',
558 level=logging.INFO)569 level=logging.INFO)
559 logging.info('Starting phased-updater')570 logging.info('Starting phased-updater')
571 ubuntu = launchpad.distributions['ubuntu']
572 archive = ubuntu.getArchive(name='primary')
560 main()573 main()
561 end_time = time.time()574 end_time = time.time()
562 logging.info("Elapsed time was %g seconds" % (end_time - start_time))575 logging.info("Elapsed time was %g seconds" % (end_time - start_time))

Subscribers

People subscribed via source and target branches