From 35bbe5617aad3733c823677fce0637a26a7b4345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 12 Mar 2019 06:25:11 +0100 Subject: [PATCH] Revert "Add semver import for sorting ls-lR list (#1735)" This reverts commit e61343f213d67c8b56b93e23da85a7eb750a2a8a. --- tools/daca2-download.py | 15 +-------------- tools/daca2-getpackages.py | 16 +--------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/tools/daca2-download.py b/tools/daca2-download.py index ce25d2deb..4895ca085 100644 --- a/tools/daca2-download.py +++ b/tools/daca2-download.py @@ -13,8 +13,6 @@ import glob import os import time -import semver - DEBIAN = ('ftp://ftp.se.debian.org/debian/', 'ftp://ftp.debian.org/debian/') @@ -33,14 +31,6 @@ def wget(filepath): return False -def latestvername(names): - if len(names) == 1: - return names[0] - names.sort(cmp=semver.cmp, key=lambda x: x[x.index( - '_')+1:x.index('.orig.tar')-x.index('_')+1]) - return names[-1] - - def getpackages(): if not wget('ls-lR.gz'): return [] @@ -53,20 +43,17 @@ def getpackages(): path = None archives = [] filename = None - filenames = [] for line in lines: line = line.strip() if len(line) < 4: if filename: - archives.append(path + '/' + latestvername(filenames)) + archives.append(path + '/' + filename) path = None filename = None - filenames = [] elif line[:12] == './pool/main/': path = line[2:-1] elif path and '.orig.tar.' in line: filename = line[1 + line.rfind(' '):] - filenames.append(filename) for a in archives: print(a) diff --git a/tools/daca2-getpackages.py b/tools/daca2-getpackages.py index 9cd239682..ffb87d30f 100644 --- a/tools/daca2-getpackages.py +++ b/tools/daca2-getpackages.py @@ -16,8 +16,6 @@ import os import datetime import time -import semver - DEBIAN = ('ftp://ftp.se.debian.org/debian/', 'ftp://ftp.debian.org/debian/') @@ -35,14 +33,6 @@ def wget(filepath): return False -def latestvername(names): - if len(names) == 1: - return names[0] - names.sort(cmp=semver.cmp, key=lambda x: x[x.index( - '_')+1:x.index('.orig.tar')-x.index('_')+1]) - return names[-1] - - def getpackages(): if not wget('ls-lR.gz'): return [] @@ -89,21 +79,17 @@ def getpackages(): path = None archives = [] filename = None - filenames = [] for line in lines: line = line.strip() if len(line) < 4: if filename: - archives.append(DEBIAN[0] + path + '/' + - latestvername(filenames)) + archives.append(DEBIAN[0] + path + '/' + filename) path = None filename = None - filenames = [] elif line.startswith('./pool/main/'): path = line[2:-1] elif path and line.endswith(('.orig.tar.gz', '.orig.tar.bz2')): filename = line[1 + line.rfind(' '):] - filenames.append(filename) return archives