Last active
December 23, 2015 18:29
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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