added license information, converted some cvs repositories to git, removed moopy

This commit is contained in:
Trilarion
2018-06-20 13:27:17 +02:00
parent 16372f2e07
commit e1b9cb6496
42 changed files with 220 additions and 146 deletions

View File

@ -1,5 +1,5 @@
Clones and/or pulls many git repositories from the open source games entries, so that one has an archive of them.
Currently requires at least 50 GB space!
Currently requires at least 55 GB space!
Run update.py to update the archive. Git URLs are stored in archives.json.
Run update.py to update the archive. URLs are stored in archives.json.

View File

@ -293,22 +293,34 @@
"https://github.com/xoreos/xoreos.git",
"https://github.com/zaki/irrlicht.git",
"https://gitlab.com/Trilarion/antichess.git",
"https://gitlab.com/Trilarion/aplanetsrevenge.git",
"https://gitlab.com/Trilarion/attal.git",
"https://gitlab.com/Trilarion/blitzkrieg.git",
"https://gitlab.com/Trilarion/civil.git",
"https://gitlab.com/Trilarion/civilwar.git",
"https://gitlab.com/Trilarion/coltoo.git",
"https://gitlab.com/Trilarion/conquests.git",
"https://gitlab.com/Trilarion/dragon-hunt.git",
"https://gitlab.com/Trilarion/galaxyng.git",
"https://gitlab.com/Trilarion/gm-tools.git",
"https://gitlab.com/Trilarion/lincity.git",
"https://gitlab.com/Trilarion/machinations.git",
"https://gitlab.com/Trilarion/mercenarycommander.git",
"https://gitlab.com/Trilarion/metalmech.git",
"https://gitlab.com/Trilarion/pizza-business.git",
"https://gitlab.com/Trilarion/planets.git",
"https://gitlab.com/Trilarion/promisance.git",
"https://gitlab.com/Trilarion/rogueclone.git",
"https://gitlab.com/Trilarion/skrupel.git",
"https://gitlab.com/Trilarion/theclans.git",
"https://gitlab.com/Trilarion/tuxracer.git",
"https://gitlab.com/Trilarion/uwadv.git",
"https://gitlab.com/Trilarion/wargamer.git",
"https://gitlab.com/Trilarion/xconq.git",
"https://gitlab.com/Trilarion/zangband.git",
"https://gitlab.com/evol/evol-all.git",
"https://gitlab.com/freedroid/freedroid-src.git",
"https://gitlab.com/pingus/pingus.git",
"https://gitlab.com/solarus-games/zsdx.git",
"https://gitlab.com/xonotic/xonotic.git",
"https://gitlab.gnome.org/GNOME/libxml2.git",

View File

@ -72,39 +72,64 @@ def svn_folder_name(url):
def svn_clone(url, folder):
pass
result = subprocess.run(["svn", "checkout", url, folder])
if result.returncode:
print(result)
def svn_update(folder):
pass
os.chdir(folder)
result = subprocess.run(["svn", "update"])
if result.returncode:
print(result)
def hg_folder_name(url):
pass
replaces = {
'https://bitbucket.org': 'bitbucket',
'https://hg.code.sf.net/p': 'sourceforge',
'http://hg.': ''
}
return derive_folder_name(url, replaces)
def hg_clone(url, folder):
pass
result = subprocess.run(["hg", "clone", url, folder])
if result.returncode:
print(result)
def hg_update(folder):
pass
os.chdir(folder)
result = subprocess.run(['hg', 'pull', '-u'])
if result.returncode:
print(result)
def bzr_folder_name(url):
pass
replaces = {
'https://code.launchpad.net': 'launchpad',
}
return derive_folder_name(url, replaces)
def bzr_clone(url, folder):
pass
result = subprocess.run(['bzr', 'branch', url, folder])
if result.returncode:
print(result)
def bzr_update(folder):
pass
os.chdir(folder)
result = subprocess.run(['bzr', 'pull'])
if result.returncode:
print(result)
def run(type, urls):
print('update {} {} archives'.format(len(urls), type))
base_folder = os.path.join(root_folder, type)
if not os.path.exists(base_folder):
os.mkdir(base_folder)
# get derived folder names
folders = [folder_name[type](url) for url in urls]
@ -124,9 +149,10 @@ def run(type, urls):
folders = [os.path.join(base_folder, x) for x in folders]
os.chdir(base_folder)
for folder, url in zip(folders, urls):
if url.startswith('https://git.code.sf.net/p/'):
if url.startswith('https://git.code.sf.net/p/') or url.startswith('http://hg.code.sf.net/p/'):
continue
if not os.path.isdir(folder):
print('clone {} into {}'.format(url, folder[len(base_folder):]))
clone[type](url, folder)
# at the end update them all
@ -135,6 +161,7 @@ def run(type, urls):
if not os.path.isdir(folder):
print('folder not existing, wanted to update, will skip')
continue
print('update {}'.format(folder[len(base_folder):]))
update[type](folder)
@ -169,6 +196,9 @@ if __name__ == '__main__':
archives = json.loads(text)
for type in archives:
# currently no bzr checkout (problems with the repos)
if type == 'bzr':
continue
urls = archives[type]
run(type, urls)