get_releases.py | 37 ++++++++++++++++++++++++++++ liveusb/releases.py | 67 ++++++++++++++++++---------------------------------- 2 files changed, 61 insertions(+), 43 deletions(-)
New commits: commit a16a5b45b4e3f70f033900c05d834e345b0aa9f1 Author: Luke Macken lmacken@redhat.com Date: Mon Apr 25 21:53:45 2011 -0400
Initial code to dynamically fetch fedora releases.
This is not yet integrated into the liveusb-creator itself, but should be in the future.
diff --git a/get_releases.py b/get_releases.py new file mode 100644 index 0000000..53c222f --- /dev/null +++ b/get_releases.py @@ -0,0 +1,37 @@ +import re +from urlgrabber import urlread + +FEDORA_RELEASES = 'http://download.fedora.redhat.com/pub/fedora/linux/releases/' +ARCHES = ('i686', 'x86_64') + +def get_fedora_releases(): + releases = [] + html = urlread(FEDORA_RELEASES) + for release in re.findall(r'<a href="(\d+)/">', html)[-2:][::-1]: + for arch in ARCHES: + arch_url = FEDORA_RELEASES + '%s/Live/%s/' % (release, arch) + files = urlread(arch_url) + for link in re.findall(r'<a href="(.*)">', files): + if link.endswith('-CHECKSUM'): + checksum = urlread(arch_url + link) + for line in checksum.split('\n'): + try: + sha256, filename = line.split() + if filename[0] != '*': + continue + filename = filename[1:] + chunks = filename[:-4].split('-') + chunks.remove('Live') + name = ' '.join(chunks) + releases.append(dict( + name = name, + url = arch_url + filename, + sha256 = sha256, + )) + except ValueError: + pass + return releases + + +from pprint import pprint +pprint(get_fedora_releases())
commit 1eac988c30ab8b0baf02fcc8b4e831f28b1809bd Author: Luke Macken <lmacken@redhat.com> Date: Mon Apr 25 21:53:34 2011 -0400
Update our releases
diff --git a/liveusb/releases.py b/liveusb/releases.py index 7bf61e8..d620785 100644 --- a/liveusb/releases.py +++ b/liveusb/releases.py @@ -1,47 +1,28 @@ releases = ( - { - 'name': 'Fedora 14 (i686)', - 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Live/i686/Fedora-14-i686-Live-Desktop.iso', - 'sha256': '60d05ebdb6882a63f245e609aacb16d47923e1dcb925e9a928f6818a89e17e08', - }, - { - 'name': 'Fedora 14 (x86_64)', - 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Live/x86_64/Fedora-14-x86_64-Live-Desktop.iso', - 'sha256': '8f81741e938924f68965b5dceac7013d72fe875725b53f61bebd36e740f79b99', - }, - { - 'name': 'Fedora 14 KDE (i686)', - 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Live/i686/Fedora-14-i686-Live-KDE.iso', - 'sha256': 'b2419b32c255a63ba122e2c7673bffd80d6293ce085de779aac39816966b45c3', - }, - { - 'name': 'Fedora 14 KDE (x86_64)', - 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Live/x86_64/Fedora-14-x86_64-Live-KDE.iso', - 'sha256': 'd0d3890a55e1febf5df5f3624d7f3d57f45a062e9ed21f57119d90c2b2bf27b5', - }, - { - 'name': 'Fedora 13 (i686)', - 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/13/Live/i686/Fedora-13-i686-Live.iso', - 'sha256': '47ccc37db256387b70857f53a6067e8d50e692c9aa85e45e63e5190c5d1e0942', - }, - - { - 'name': 'Fedora 13 KDE (i686)', - 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/13/Live/i686/Fedora-13-i686-Live-KDE.iso', - 'sha256': '6828c02f2bce4ec3bd1ca488df8662640bf53fe7724913310295a5f5f6502cf8', - }, - - { - 'name': 'Fedora 13 (x86_64)', - 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/13/Live/x86_64/Fedora-13-x86_64-Live.iso', - 'sha256': 'c16923e9c2f04af3609c9534f32ea280e4d2c3af50e704344ccb35090f87065a', - }, - - { - 'name': 'Fedora 13 KDE (x86_64)', - 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/13/Live/x86_64/Fedora-13-x86_64-Live-KDE.iso', - 'sha256': '789d7090d39230f0e9b16ed3276974223c120db3120c48e53fa95a6f1604c650', - }, + {'name': 'Fedora 14 i686 Desktop', + 'sha256': '60d05ebdb6882a63f245e609aacb16d47923e1dcb925e9a928f6818a89e17e08', + 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Live/i686/Fedora-14-i686-Live-Desktop.iso'}, + {'name': 'Fedora 14 i686 KDE', + 'sha256': 'b2419b32c255a63ba122e2c7673bffd80d6293ce085de779aac39816966b45c3', + 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Live/i686/Fedora-14-i686-Live-KDE.iso'}, + {'name': 'Fedora 14 x86_64 Desktop', + 'sha256': '8f81741e938924f68965b5dceac7013d72fe875725b53f61bebd36e740f79b99', + 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Live/x86_64/Fedora-14-x86_64-Live-Desktop.iso'}, + {'name': 'Fedora 14 x86_64 KDE', + 'sha256': 'd0d3890a55e1febf5df5f3624d7f3d57f45a062e9ed21f57119d90c2b2bf27b5', + 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Live/x86_64/Fedora-14-x86_64-Live-KDE.iso'}, + {'name': 'Fedora 13 i686', + 'sha256': '47ccc37db256387b70857f53a6067e8d50e692c9aa85e45e63e5190c5d1e0942', + 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/13/Live/i686/Fedora-13-i686-Live.iso'}, + {'name': 'Fedora 13 i686 KDE', + 'sha256': '6828c02f2bce4ec3bd1ca488df8662640bf53fe7724913310295a5f5f6502cf8', + 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/13/Live/i686/Fedora-13-i686-Live-KDE.iso'}, + {'name': 'Fedora 13 x86_64', + 'sha256': 'c16923e9c2f04af3609c9534f32ea280e4d2c3af50e704344ccb35090f87065a', + 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/13/Live/x86_64/Fedora-13-x86_64-Live.iso'}, + {'name': 'Fedora 13 x86_64 KDE', + 'sha256': '789d7090d39230f0e9b16ed3276974223c120db3120c48e53fa95a6f1604c650', + 'url': 'http://download.fedora.redhat.com/pub/fedora/linux/releases/13/Live/x86_64/Fedora-13-x86_64-Live-KDE.iso'},
## ## Custom spins
liveusb-creator@lists.stg.fedorahosted.org