[sysadmin-bin] Make sure repositories.doap takes into consideration Gitlab repositories (https://gitlab.gnome.org/I
- From: Andrea Veri <averi src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Make sure repositories.doap takes into consideration Gitlab repositories (https://gitlab.gnome.org/I
- Date: Thu, 8 Mar 2018 12:49:27 +0000 (UTC)
commit b7d40e891d287d89bc4dc7b1ceaae3045b5c6d65
Author: Andrea Veri <averi redhat com>
Date: Thu Mar 8 13:49:14 2018 +0100
Make sure repositories.doap takes into consideration Gitlab repositories
(https://gitlab.gnome.org/Infrastructure/GitLab/issues/160)
git/build-repo-list | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
---
diff --git a/git/build-repo-list b/git/build-repo-list
index f81a9b1..93d4119 100755
--- a/git/build-repo-list
+++ b/git/build-repo-list
@@ -51,10 +51,16 @@ class Repo:
self.pending = os.path.isfile(os.path.join(repopath, 'pending'))
self.owner = ''
- shortname = re.sub('/git/', '', repopath)
- shortname = re.sub('/srv/', '', shortname)
- shortname = re.sub('\.git$', '', shortname)
- shortname = re.sub('/home/', '~', shortname)
+ if repopath.startswith('/var/opt/gitlab/git-data/repositories'):
+ shortname = re.sub('/var/opt/gitlab/git-data/repositories/GNOME/', '', repopath)
+ shortname = re.sub('Infrastructure/', '', shortname)
+ shortname = re.sub('\.git$', '', shortname)
+ else:
+ shortname = re.sub('/git/', '', repopath)
+ shortname = re.sub('/srv/', '', shortname)
+ shortname = re.sub('\.git$', '', shortname)
+ shortname = re.sub('/home/', '~', shortname)
+
self.shortname = shortname
pending = ''
@@ -130,7 +136,8 @@ parser.add_option('', "--output", action='store', choices=['cgit', 'flat', 'doap
options, args = parser.parse_args()
if len(args) == 0:
- paths = ['/git', '/git/preview']
+ paths = ['/git', '/var/opt/gitlab/git-data/repositories/GNOME',
+ '/var/opt/gitlab/git-data/repositories/GNOME/Infrastructure']
else:
paths = args
@@ -145,6 +152,14 @@ elif options.output == 'doap':
nodes = []
def add_file(repo):
doapfile = os.path.join(repo.path, "gnome_doap")
+
+ if repo.path.startswith('/var/opt/gitlab/git-data/repositories'):
+ https_url = 'https://gitlab.gnome.org/GNOME/%s' % repo.shortname
+ ssh_uri = 'ssh://git gitlab gnome org:GNOME/%s.git' % repo.shortname
+ else:
+ https_url = 'https://git.gnome.org/browse/%s' % repo.shortname
+ ssh_uri = 'ssh://git.gnome.org/git/%s' % repo.shortname
+
if os.path.isfile(doapfile):
f = open(doapfile)
file_nodes = semi_rdf.read_rdf(f)
@@ -153,10 +168,10 @@ elif options.output == 'doap':
repository_node = semi_rdf.Node((DOAP, "GitRepository"))
repository_node.add_property((DOAP, "location"),
None,
- semi_rdf.UrlResource("git://git.gnome.org/%s" % repo.shortname))
+ semi_rdf.UrlResource(ssh_uri))
repository_node.add_property((DOAP, "browse"),
None,
- semi_rdf.UrlResource("http://git.gnome.org/browse/%s" %
repo.shortname))
+ semi_rdf.UrlResource(https_url))
old_repository_node = None
for node in file_nodes:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]