Branch 'develop' - 4 commits - get_releases.py liveusb/releases.py

Luke Macken lmacken at fedoraproject.org
Thu Jan 30 01:56:31 UTC 2014


 get_releases.py     |   41 ---------------------------
 liveusb/releases.py |   78 ++++++++++++++++++++++------------------------------
 2 files changed, 34 insertions(+), 85 deletions(-)

New commits:
commit 89e1c77ad5d736631f13937574eea5dfef0742ac
Author: Adam Williamson <awilliam at redhat.com>
Date:   Wed Jan 29 15:55:17 2014 -0800

    Fix the filename parsing when retrieving available images from dl.fp.o
    
    Cutting off 6 characters from the end instead of 4 drops the rather useless
    trailing -1 (it's an artifact of Koji-based building of lives, AIUI).
    
    The chunks.pop / chunks.insert dodge takes the last field from the filename
    after trimming and splitting (which is the release version, and hopefully will
    stay that way for a bit...) and puts it into the list at position 1. So this
    is only dependent on the *last* field always being the release, and the
    *first* field always being the distribution name - other fields can jiggle
    around and this will still DTRT.

diff --git a/liveusb/releases.py b/liveusb/releases.py
index a418cef..db37385 100644
--- a/liveusb/releases.py
+++ b/liveusb/releases.py
@@ -73,8 +73,10 @@ def get_fedora_releases():
                                 if filename[0] != '*':
                                     continue
                                 filename = filename[1:]
-                                chunks = filename[:-4].split('-')
+                                chunks = filename[:-6].split('-')
                                 chunks.remove('Live')
+                                release = chunks.pop()
+                                chunks.insert(1,release)
                                 name = ' '.join(chunks)
                                 fedora_releases.append(dict(
                                     name=name,


commit a94a804e67e2a148ccce50c41790ad8b48b76fd1
Author: Adam Williamson <awilliam at redhat.com>
Date:   Wed Jan 29 12:27:41 2014 -0800

    update the static release list to F19+F20
    
    We probably should add the other spins as well as SoaS, but I'll put that in
    a separate commit.

diff --git a/liveusb/releases.py b/liveusb/releases.py
index 7f9e176..a418cef 100644
--- a/liveusb/releases.py
+++ b/liveusb/releases.py
@@ -7,42 +7,30 @@ ARCHES = ('armhfp', 'x86_64', 'i686', 'i386')
 
 # A backup list of releases, just in case we can't fetch them.
 fedora_releases = [
-    {'name': 'Fedora 18 i686 Desktop',
-     'sha256': '7c7f453c15a5d13df95bf8caab6277e5aab1c6353eb242b1cf00344b61869d26',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Live/i386/Fedora-18-i686-Live-Desktop.iso'},
-    {'name': 'Fedora 18 i686 KDE',
-     'sha256': 'f172192566d0e12c29a741a568a917c5d8643aa781fdf06598b12a217a58cb74',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Live/i386/Fedora-18-i686-Live-KDE.iso'},
-    {'name': 'Fedora 18 x86_64 Desktop',
-     'sha256': 'a276e06d244e04b765f0a35532d9036ad84f340b0bdcc32e0233a8fbc31d5bed',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Live/x86_64/Fedora-18-x86_64-Live-Desktop.iso'},
-    {'name': 'Fedora 18 x86_64 KDE',
-     'sha256': '41d51d86ff5c272263285d00a0c3da7acbbce404b9930b0ff8bd7226e7248805',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Live/x86_64/Fedora-18-x86_64-Live-KDE.iso'},
-    {'name': 'Fedora 17 i686 Desktop',
-     'sha256': '26027f4d4686f1df186b31ce773dbb903db18f4b1aa37a1e37f0fa6ff4111f42',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/i686/Fedora-17-i686-Live-Desktop.iso'},
-    {'name': 'Fedora 17 i686 KDE',
-     'sha256': 'f10142bb0a4d91a0d8320a925fa33ab3a87d9764b03137bb30506830c1068583',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/i686/Fedora-17-i686-Live-KDE.iso'},
-    {'name': 'Fedora 17 x86_64 Desktop',
-     'sha256': 'dfd19d677790fea6144bcf537cd031dfb0a50e6c56652c94bfc71ea7bb949f2c',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/x86_64/Fedora-17-x86_64-Live-Desktop.iso'},
-    {'name': 'Fedora 17 x86_64 KDE',
-     'sha256': '58b9abf5ef6a07b75b6a934468c783ab18e5a1236e6e5ab75dc2b39ca7680462',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Live/x86_64/Fedora-17-x86_64-Live-KDE.iso'},
-    {'name': 'Fedora 16 i686 Desktop',
-     'sha256': '561d2c15fa79c319959cfc821650c829860651d1e5b125b2a425ac9cbd3fe1bb',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/i686/Fedora-16-i686-Live-Desktop.iso'},
-    {'name': 'Fedora 16 i686 KDE',
-     'sha256': '822567e4b05f7be6b89c14e6165f4c9e0f388379c3f90e0bf439dd8397e87a3f',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/i686/Fedora-16-i686-Live-KDE.iso'},
-    {'name': 'Fedora 16 x86_64 Desktop',
-     'sha256': '632b2de39033ed1d4a61959c4002e07248793eff828ac5d60edbb7b5dcd7be5c',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-16-x86_64-Live-Desktop.iso'},
-    {'name': 'Fedora 16 x86_64 KDE',
-     'sha256': 'b10ff86610e46244b11f0a411915e80ca4fdf1e8ec20ee5b61f700feb0716ba8',
-     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-16-x86_64-Live-KDE.iso'},
+    {'name': 'Fedora 20 x86_64 Desktop',
+     'sha256': 'cc0333be93c7ff2fb3148cb29360d2453f78913cc8aa6c6289ae6823372a77d2',
+     'url': 'http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso'},
+    {'name': 'Fedora 20 x86_64 KDE',
+     'sha256': '08360a253b4a40dff948e568dba1d2ae9d931797f57aa08576b8b9f1ef7e4745',
+     'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-KDE-x86_64-20-1.iso'},
+    {'name': 'Fedora 20 i686 Desktop',
+     'sha256': 'b115c5653b855de2353e41ff0c72158350f14a020c041462f35ba2a47bd1e33b',
+     'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/i386/Fedora-Live-Desktop-i686-20-1.iso'},
+    {'name': 'Fedora 20 i686 KDE',
+     'sha256': 'd859132ea9496994ccbb5d6e60c9f40ae89ba31f8a4a1a2a883d6d45901de598',
+     'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/i386/Fedora-Live-KDE-i686-20-1.iso'},
+    {'name': 'Fedora 19 x86_64 Desktop',
+     'sha256': '21f0197284b9088b32d683f83a71bd42261f1df885a63b1eb87254d1ca096f12',
+     'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/19/Live/x86_64/Fedora-Live-Desktop-x86_64-19-1.iso'},
+    {'name': 'Fedora 19 x86_64 KDE',
+     'sha256': 'f4479d5639f62d7398722c6a432ba94711b80d5011d5b64e7afebb4f4ac10cf7',
+     'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/19/Live/x86_64/Fedora-Live-KDE-x86_64-19-1.iso'},
+    {'name': 'Fedora 19 i686 Desktop',
+     'sha256': 'ce9797802ef1f7aa670fffd04f209631c171b8ded5dc26f61df898cb9441c839',
+     'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/19/Live/i386/Fedora-Live-Desktop-i686-19-1.iso'},
+    {'name': 'Fedora 19 i686 KDE',
+     'sha256': 'e81717564f96ee0f8c6d8b0186e7fca44da57f2ef154ea427b6d765ea139a083',
+     'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/19/Live/i386/Fedora-Live-KDE-i686-19-1.iso'},
 ]
 
 other_releases = [
@@ -50,14 +38,14 @@ other_releases = [
     ## Custom spins
     ##
     {
-        'name': 'Sugar on a Stick v7 Quandong (x86_64)',
-        'url': 'http://dl.fedoraproject.org/pub/alt/releases/17/Spins/x86_64/Fedora-17-x86_64-Live-SoaS.iso',
-        'sha256': 'e872932ff02f20adc76252fff5fa16717b10a6d91dbee779bf4792d36c939a28',
+        'name': 'Sugar on a Stick v10 (x86_64)',
+        'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-SoaS-x86_64-20-1.iso',
+        'sha256': 'b1865e40e57ed5c4bb705f95e3190c5e56ca6ed9c34f53b16e8c45ccb1233be8',
     },
     {
-        'name': 'Sugar on a Stick v7 Quandong (i686)',
-        'url': 'http://dl.fedoraproject.org/pub/alt/releases/17/Spins/i686/Fedora-17-i686-Live-SoaS.iso',
-        'sha256': '04a7824f36a4015985e328da450534a40a4babb0d0a2c8959e0bc9103b06721e',
+        'name': 'Sugar on a Stick v10 (i686)',
+        'url': 'https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/i386/Fedora-Live-SoaS-i686-20-1.iso',
+        'sha256': 'efe76d842a7e19a5ee66461bf51a9cf649d426d007841a5f06f14851dceab389',
     },
 ]
 


commit 2608b8a402b35dacf3c12c9140e7cfc0223f448a
Author: Luke Macken <lmacken at redhat.com>
Date:   Wed Jan 29 12:56:04 2014 -0700

    Add armhfp to our fedora releases arch list, from pull #8

diff --git a/liveusb/releases.py b/liveusb/releases.py
index ffa063a..7f9e176 100644
--- a/liveusb/releases.py
+++ b/liveusb/releases.py
@@ -3,7 +3,7 @@ from urlgrabber import urlread
 from urlgrabber.grabber import URLGrabError
 
 FEDORA_RELEASES = 'http://dl.fedoraproject.org/pub/fedora/linux/releases/'
-ARCHES = ('x86_64', 'i686', 'i386')
+ARCHES = ('armhfp', 'x86_64', 'i686', 'i386')
 
 # A backup list of releases, just in case we can't fetch them.
 fedora_releases = [


commit 681f8c835345fec79e0751a6314d145605fa6ea0
Author: Luke Macken <lmacken at redhat.com>
Date:   Wed Jan 29 12:09:00 2014 -0700

    Remove get_releases.py, which got migrated into liveusb/releases.py

diff --git a/get_releases.py b/get_releases.py
deleted file mode 100644
index a6a1b24..0000000
--- a/get_releases.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import re
-from urlgrabber import urlread
-from urlgrabber.grabber import URLGrabError
-
-FEDORA_RELEASES = 'http://dl.fedoraproject.org/pub/fedora/linux/releases/'
-ARCHES = ('armhfp', 'i386', '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)
-            try:
-                files = urlread(arch_url)
-            except URLGrabError:
-                continue
-            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())




More information about the liveusb-creator mailing list