support git@gitlab.com: style URLs in servergitmirrors

This converts the git@gitlab.com SSH URLs to the proper HTTPS URLs that
fdroidclient can directly use.
This commit is contained in:
Hans-Christoph Steiner 2017-04-11 12:28:36 +02:00
parent 183ce9541b
commit 5cc15d0fa9
2 changed files with 23 additions and 15 deletions

View file

@ -22,6 +22,7 @@ import hashlib
import os
import paramiko
import pwd
import re
import subprocess
from argparse import ArgumentParser
import logging
@ -235,9 +236,8 @@ def update_servergitmirrors(servergitmirrors, repo_section):
repo = git.Repo.init(repo_dir)
# take care of each mirror
for mirror in servergitmirrors:
hostname = mirror.split("/")[2]
hostname = re.sub(r'\W*\w+\W+(\w+).*', r'\1', mirror)
repo.create_remote(hostname, mirror)
logging.info('Mirroring to: ' + mirror)