[releng/abderrahim/refactor] convert-to-tarballs: drop support for subdirs



commit 863320369eea50881b0dd60eb083522902f94734
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Sat Apr 4 06:20:55 2020 +0100

    convert-to-tarballs: drop support for subdirs
    
    just tack the subdir to the main url

 tools/smoketesting/convert-to-tarballs.py         | 38 ++++++-----------------
 tools/smoketesting/tarball-conversion-3-34.config |  5 +--
 tools/smoketesting/tarball-conversion-3-36.config |  5 +--
 tools/smoketesting/tarball-conversion.config      |  5 +--
 4 files changed, 12 insertions(+), 41 deletions(-)
---
diff --git a/tools/smoketesting/convert-to-tarballs.py b/tools/smoketesting/convert-to-tarballs.py
index 1c82206..68e57c1 100755
--- a/tools/smoketesting/convert-to-tarballs.py
+++ b/tools/smoketesting/convert-to-tarballs.py
@@ -108,7 +108,6 @@ class Options:
         self.mirrors = {}
         self.release_sets = []
         self.release_set = []
-        self.subdir = {}
         self.version_limit = {}
         self.real_name = {}
         self.cvs_locations = []
@@ -127,18 +126,13 @@ class Options:
         return False
 
     def get_download_site(self, cvssite, modulename):
-        for list in self.module_locations:
-            if list[0] == modulename:
-                subdir = ''
-                if len(list) == 3:
-                    subdir = re.sub(r'\$module', modulename, list[2])
-                return posixjoin(list[1], subdir)
-        for list in self.cvs_locations:
-            if re.search(list[0] + '$', cvssite):
-                subdir = ''
-                if len(list) == 3:
-                    subdir = re.sub(r'\$module', modulename, list[2])
-                return posixjoin(list[1], subdir)
+        for module, location in self.module_locations:
+            if module == modulename:
+                return re.sub(r'\$module', modulename, location)
+
+        for cvs, location in self.cvs_locations:
+            if cvs == cvssite:
+                return re.sub(r'\$module', modulename, location)
         raise IOError('No download site found!\n')
 
     def _get_locations(self, locations_node):
@@ -149,15 +143,10 @@ class Options:
                 location = node.attributes.get('location').nodeValue
                 if node.attributes.get('cvs') is not None:
                     cvs = node.attributes.get('cvs').nodeValue
-                    subdir = node.attributes.get('subdir').nodeValue
-                    self.cvs_locations.append([cvs, location, subdir])
+                    self.cvs_locations.append([cvs, location])
                 elif node.attributes.get('module') is not None:
                     module = node.attributes.get('module').nodeValue
-                    if node.attributes.get('subdir'):
-                        dir = node.attributes.get('subdir').nodeValue
-                        self.module_locations.append([module, location, dir])
-                    else:
-                        self.module_locations.append([module, location])
+                    self.module_locations.append([module, location])
             else:
                 sys.stderr.write('Bad location node\n')
                 sys.exit(1)
@@ -193,12 +182,6 @@ class Options:
                 if node.attributes.get('module'):
                     self.real_name[name] = node.attributes.get('module').nodeValue
 
-                # Determine if we have a specified subdir for this package
-                if node.attributes.get('subdir'):
-                    self.subdir[name] = node.attributes.get('subdir').nodeValue
-                else:
-                    self.subdir[name] = ''
-
                 # Find the appropriate release set
                 if node.attributes.get('set'):
                     release_set = node.attributes.get('set').nodeValue
@@ -225,9 +208,6 @@ class Options:
     def get_real_name(self, modulename):
         return self.real_name.get(modulename, modulename)
 
-    def get_subdir(self, modulename):
-        return self.subdir.get(modulename, None)
-
     def _read_conversion_info(self):
         document = minidom.parse(self.filename)
         conversion_stuff = document.documentElement
diff --git a/tools/smoketesting/tarball-conversion-3-34.config 
b/tools/smoketesting/tarball-conversion-3-34.config
index f671009..a3eb615 100644
--- a/tools/smoketesting/tarball-conversion-3-34.config
+++ b/tools/smoketesting/tarball-conversion-3-34.config
@@ -1,10 +1,7 @@
 <?xml version="1.0" ?>
 <conversioninfo>
   <locations>  FIXME: get a better name
-    <site cvs="gnome.org"
-      location="https://download.gnome.org/sources/";
-      subdir="$module/"
-      />
+    <site cvs="gnome.org" location="https://download.gnome.org/sources/$module/"; />
 
     <site module="ModemManager"              location="https://www.freedesktop.org/software/ModemManager/"/>
     <site module="PackageKit"                
location="https://www.freedesktop.org/software/PackageKit/releases/"/>
diff --git a/tools/smoketesting/tarball-conversion-3-36.config 
b/tools/smoketesting/tarball-conversion-3-36.config
index da746f5..400799d 100644
--- a/tools/smoketesting/tarball-conversion-3-36.config
+++ b/tools/smoketesting/tarball-conversion-3-36.config
@@ -1,10 +1,7 @@
 <?xml version="1.0" ?>
 <conversioninfo>
   <locations>  FIXME: get a better name
-    <site cvs="gnome.org"
-      location="https://download.gnome.org/sources/";
-      subdir="$module/"
-      />
+    <site cvs="gnome.org" location="https://download.gnome.org/sources/$module/"; />
 
     <site module="ModemManager"              location="https://www.freedesktop.org/software/ModemManager/"/>
     <site module="accountsservice"           
location="https://www.freedesktop.org/software/accountsservice/"/>
diff --git a/tools/smoketesting/tarball-conversion.config b/tools/smoketesting/tarball-conversion.config
index c037a08..0176768 100644
--- a/tools/smoketesting/tarball-conversion.config
+++ b/tools/smoketesting/tarball-conversion.config
@@ -1,10 +1,7 @@
 <?xml version="1.0" ?>
 <conversioninfo>
   <locations>  FIXME: get a better name
-    <site cvs="gnome.org"
-      location="https://download.gnome.org/sources/";
-      subdir="$module/"
-      />
+    <site cvs="gnome.org" location="https://download.gnome.org/sources/$module/"; />
 
     <site module="ModemManager"              location="https://www.freedesktop.org/software/ModemManager/"/>
     <site module="accountsservice"           
location="https://www.freedesktop.org/software/accountsservice/"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]