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



commit 9cc839a2c998fcaf6c20700f96cfe875b3fba765
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 f901a32..4fc66d2 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 = []
@@ -116,18 +115,13 @@ class Options:
         self._read_conversion_info()
 
     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):
@@ -138,15 +132,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)
@@ -182,12 +171,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
@@ -214,9 +197,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 f2847e4..34c23cc 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 2162883..ff6d1a0 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 a695663..6eb5713 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]