Skip to content

Instantly share code, notes, and snippets.

@lmacken
Last active December 23, 2015 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmacken/6676152 to your computer and use it in GitHub Desktop.
Save lmacken/6676152 to your computer and use it in GitHub Desktop.
Download the updateinfo.xml from Fedora updates-testing and stable repos and check it for notices with duplicate update IDs.
# Download the updateinfo.xml from fedora stable & testing repos and check it
# for notices with duplicate update IDs.
import os
import urllib
from yum.update_md import UpdateMetadata
ver = 20
testing_url = 'http://dl.fedoraproject.org/pub/fedora/linux/updates/testing/%d/x86_64/repodata/updateinfo.xml.gz' % ver
stable_url = 'http://dl.fedoraproject.org/pub/fedora/linux/updates/%d/x86_64/repodata/updateinfo.xml.gz' % ver
filename = 'updateinfo.xml.gz'
print('Downloading %s' % stable_url)
urllib.urlretrieve(stable_url, filename='stable-' + filename)
print('Downloading %s' % testing_url)
urllib.urlretrieve(testing_url, filename='testing-' + filename)
umd = UpdateMetadata()
umd.add('stable-' + filename)
umd.add('testing-' + filename)
print('updateinfo.xml.gz loaded')
print('%d notices' % len(umd.get_notices()))
notices = {}
for notice in umd.get_notices():
id = notice['update_id']
if id in notices:
print('Duplicate notice for %s' % id)
print(notices[id])
else:
notices[id] = notice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment