[sysadmin-bin] Make sure both GitLab and Git repository locations are taken into account



commit 59835709947b51c79d0aa9785ef0d9958b5dbe57
Author: Andrea Veri <averi redhat com>
Date:   Fri Apr 27 16:27:34 2018 +0200

    Make sure both GitLab and Git repository locations are taken into account

 ftpadmin | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/ftpadmin b/ftpadmin
index fa43b99..5221e8e 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -297,7 +297,7 @@ class DOAP(BasicInfo):
 
     DOAP_URL = 'https://git.gnome.org/repositories.doap'
     DOAP_CACHE = '/ftp/cache/doap.json'
-    GNOME_REPO = 'git://git.gnome.org/'
+    GITLAB_REPO = 'ssh://git gitlab gnome org'
 
     TARBALL_PATH_PREFIX = '/sources/'
     TARBALL_HOSTNAME_SUFFIX = '.gnome.org'
@@ -404,8 +404,12 @@ class DOAP(BasicInfo):
             if isinstance(repo, semi_rdf.Node):
                 repo_loc = repo.find_property((self.NS_DOAP, u'location'))
 
-                if hasattr(repo_loc, 'startswith') and repo_loc.startswith(self.GNOME_REPO):
-                    modname = repo_loc[len(self.GNOME_REPO):]
+                if hasattr(repo_loc, 'startswith'):
+                    if repo_loc.startswith(self.GITLAB_REPO):
+                        modname = re.sub('ssh://git gitlab gnome org:(GNOME|Infrastructure)/', '', repo_loc)
+                        modname = re.sub('\.git$', '', modname)
+                    else:
+                        modname = re.sub('ssh://git.gnome.org/git/', '', repo_loc)
 
             # In case project is unknown or already defined, ignore it
             if not modname or modname in MODULE_INFO:


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