[Pkg-privacy-commits] [tails-installer] 15/24: Fix the filename parsing when retrieving available images from dl.fp.o

anonym anonym-tails-guest at moszumanska.debian.org
Thu Jan 12 15:14:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

anonym-tails-guest pushed a commit to annotated tag 3.12.1
in repository tails-installer.

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.
---
 liveusb/releases.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git



More information about the Pkg-privacy-commits mailing list