[sysadmin-bin] Set GitHub project website to GitLab repo
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Set GitHub project website to GitLab repo
- Date: Fri, 31 Jan 2020 11:38:34 +0000 (UTC)
commit 68773acc2bd8b5894247e2c27e88c1dbbefb07e5
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Fri Jan 31 12:30:56 2020 +0100
Set GitHub project website to GitLab repo
git/post-receive-mirror-github | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/git/post-receive-mirror-github b/git/post-receive-mirror-github
index aa88d68..976ea90 100755
--- a/git/post-receive-mirror-github
+++ b/git/post-receive-mirror-github
@@ -157,11 +157,13 @@ def get_doap_settings(repo_name):
nss = {'doap': 'http://usefulinc.com/ns/doap#',
'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'}
+ repo_owner = os.path.dirname(os.getcwd()).split('/')[-1]
+
# Get the repo's mainline branch name
branch_name = get_project_head_name()
branches = get_project_branches()
- doap_url = 'https://gitlab.gnome.org/%s/%s/raw/%s/%s.doap' %
(os.path.dirname(os.getcwd()).split('/')[-1], repo_name, branch_name, repo_name)
+ doap_url = 'https://gitlab.gnome.org/%s/%s/raw/%s/%s.doap' % (repo_owner, repo_name, branch_name,
repo_name)
rq = requests.get(doap_url)
if rq.status_code not in (200, 301, 302):
@@ -177,8 +179,7 @@ def get_doap_settings(repo_name):
name = name.text if name != None else repo_name
desc = desc.text if desc != None else name
-
- homepage = homepage.get(resource) if homepage != None else 'https://gitlab.gnome.org/GNOME/%s' %
repo_name
+ homepage = 'https://gitlab.gnome.org/{}/{}'.format(repo_owner, repo_name)
return {
"homepage": homepage.encode("utf-8").decode("utf-8"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]