From 0d208dbdf7f52ecb0a8020f9ebf6f19256a4ad80 Mon Sep 17 00:00:00 2001 From: Trilarion Date: Wed, 26 Aug 2020 19:31:09 +0200 Subject: [PATCH] archive update (with location specified in local-config.ini) and small updates of links --- .gitignore | 2 +- code/archive_update.py | 27 +++++++++++++++++++++------ code/archives.json | 5 ++--- code/utils/constants.py | 15 ++++++++++++++- code/utils/utils.py | 4 ++-- docs/data.json | 8 ++++---- entries/doomsday_engine.md | 2 +- entries/kknd.md | 1 + entries/kq_lives.md | 4 ++-- entries/open_fortress.md | 2 +- entries/opensc2k.md | 4 ++-- entries/parpg.md | 2 +- entries/ryzom_core.md | 2 +- entries/scourge.md | 2 +- entries/wizards_magic.md | 2 +- statistics.md | 2 +- 16 files changed, 56 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 728aea42..081abfac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /.idea __pycache__ -/local.properties +/local-config.ini /code/archive/** /code/lgw-import diff --git a/code/archive_update.py b/code/archive_update.py index 53d06527..082ce404 100644 --- a/code/archive_update.py +++ b/code/archive_update.py @@ -11,21 +11,28 @@ TODO are really all existing branches cloned and pulled? (see https://stackoverf TODO Sourceforge git clone may not work all the time (restarting the script sometimes helps..) Note: May need to set http.postBuffer (https://stackoverflow.com/questions/17683295/git-bash-error-rpc-failed-result-18-htp-code-200b-1kib-s) + + +For repositories +see https://serverfault.com/questions/544156/git-clone-fail-instead-of-prompting-for-credentials """ import json from utils.utils import * from utils.archive import * +import utils.constants as c def git_clone(url, folder): + # subprocess_run(["git", "clone", "--mirror", url, folder], shell=True, env={'GIT_TERMINAL_PROMPT': '0'}) subprocess_run(["git", "clone", "--mirror", url, folder]) def git_update(folder): os.chdir(folder) - subprocess_run(["git", "fetch", "--all"]) + # subprocess_run(["git", "fetch", "--all"], shell=True, env={'GIT_TERMINAL_PROMPT': '0'}) + subprocess_run(["git", "fetch", "--all"], display=False) def svn_folder_name(url): @@ -69,6 +76,9 @@ def run_update(type, urls, type_folder=None): base_folder = os.path.join(archive_folder, type_folder) if not os.path.exists(base_folder): os.mkdir(base_folder) + unused_base_folder = os.path.join(archive_folder, type_folder + '.unused') + if not os.path.exists(unused_base_folder): + os.mkdir(unused_base_folder) # get derived folder names folders = [folder_name[type](url) for url in urls] @@ -76,9 +86,12 @@ def run_update(type, urls, type_folder=None): # find those folders not used anymore existing_folders = [x for x in os.listdir(base_folder) if os.path.isdir(os.path.join(base_folder, x))] unused_folders = [x for x in existing_folders if x not in folders] - print('{} unused archives'.format(len(unused_folders))) - if unused_folders: - print(unused_folders) + print('{} unused archives, move to unused folder'.format(len(unused_folders))) + for folder in unused_folders: + origin = os.path.join(base_folder, folder) + destination = os.path.join(unused_base_folder, folder) + if not os.path.exists(destination): + shutil.move(origin, destination) # new folder, need to clone new_folders = [x for x in folders if x not in existing_folders] @@ -101,7 +114,7 @@ def run_update(type, urls, type_folder=None): if not os.path.isdir(folder): print('folder not existing, wanted to update, will skip') continue - print('update {}'.format(folder[len(base_folder):])) + # print('update {}'.format(folder[len(base_folder):])) try: update[type](folder) except RuntimeError as e: @@ -148,7 +161,9 @@ if __name__ == '__main__': # get this folder root_folder = os.path.realpath(os.path.dirname(__file__)) - archive_folder = os.path.join(root_folder, 'archive') + archive_folder = c.get_config('archive-folder') + if not archive_folder: + raise RuntimeError('No archive folder specified.') # read archives.json text = read_text(os.path.join(root_folder, 'archives.json')) diff --git a/code/archives.json b/code/archives.json index bede0a24..db3205ff 100644 --- a/code/archives.json +++ b/code/archives.json @@ -295,6 +295,7 @@ "https://github.com/ObKo/OpenSR.git", "https://github.com/OneSleepyDev/boswars_osd.git", "https://github.com/OneSleepyDev/boswars_osd_archive.git", + "https://github.com/OnlineCop/kqlives.git", "https://github.com/OoliteProject/oolite.git", "https://github.com/OpMonTeam/OpMon-Data.git", "https://github.com/OpMonTeam/OpMon.git", @@ -641,7 +642,6 @@ "https://github.com/gregoryfenton/other-life.git", "https://github.com/griefly/griefly.git", "https://github.com/grit-engine/grit-engine.git", - "https://github.com/grrk-bzzt/kqlives.git", "https://github.com/gtheilman/RxWars.git", "https://github.com/guillaume-gouchon/dungeonhero.git", "https://github.com/guillaume-gouchon/dungeonquest.git", @@ -792,6 +792,7 @@ "https://github.com/nenadalm/Train.git", "https://github.com/nevat/abbayedesmorts-gpl.git", "https://github.com/nhydock/UlDunAd.git", + "https://github.com/nicholas-ochoa/OpenSC2K.git", "https://github.com/nicupavel/openpanzer.git", "https://github.com/nigels-com/glew.git", "https://github.com/nikki-and-the-robots/nikki.git", @@ -880,7 +881,6 @@ "https://github.com/radu124/splexhd.git", "https://github.com/raduprv/Eternal-Lands.git", "https://github.com/rafaelcastrocouto/enduro.git", - "https://github.com/rage8885/OpenSC2K.git", "https://github.com/rayjohannessen/songofalbion.git", "https://github.com/raysan5/raylib.git", "https://github.com/raysan5/rfxgen.git", @@ -1385,7 +1385,6 @@ "svn://svn.zoy.org/abuse/abuse/trunk" ], "hg": [ - "http://hg.assembla.com/parpg-core", "http://hg.code.sf.net/p/blood/code", "http://hg.code.sf.net/p/directpython11/code", "http://hg.code.sf.net/p/fltrator/code", diff --git a/code/utils/constants.py b/code/utils/constants.py index df8ed000..bd24a5b7 100644 --- a/code/utils/constants.py +++ b/code/utils/constants.py @@ -3,6 +3,7 @@ Paths, properties. """ import os +import configparser # paths root_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)) @@ -10,4 +11,16 @@ entries_path = os.path.join(root_path, 'entries') tocs_path = os.path.join(entries_path, 'tocs') code_path = os.path.join(root_path, 'code') -local_properties_file = os.path.join(root_path, 'local.properties') +local_config_file = os.path.join(root_path, 'local-config.ini') + +config = configparser.ConfigParser() +config.read(local_config_file) + + +def get_config(key): + """ + + :param key: + :return: + """ + return config['general'][key] diff --git a/code/utils/utils.py b/code/utils/utils.py index 61bbf4c9..f217a6e7 100644 --- a/code/utils/utils.py +++ b/code/utils/utils.py @@ -146,12 +146,12 @@ def determine_latest_last_modified_date(folder): return latest_last_modified -def subprocess_run(cmd, display=True): +def subprocess_run(cmd, display=True, shell=False, env={}): """ Runs a cmd via subprocess and displays the std output in case of success or the std error output in case of failure where it also stops execution. """ - result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell, env=dict(os.environ, **env)) if result.returncode: if display: print("error {} in call {}".format(result.returncode, cmd)) diff --git a/docs/data.json b/docs/data.json index 46def187..d251e838 100644 --- a/docs/data.json +++ b/docs/data.json @@ -4966,7 +4966,7 @@ "Link", "beta / inactive since 2011", "role playing", - "Source - C - GPL-2.0" + "Source - C - GPL-2.0" ], [ "Krank (home, entry)", @@ -7025,12 +7025,12 @@ "Source - C# - LGPL-3.0" ], [ - "OpenSC2K (home, entry)", + "OpenSC2K (home, entry)", "Remake of SimCity 2000.", "", "beta / active", "simulation, inspired by SimCity 2000, remake", - "Source - JavaScript - GPL-3.0" + "Source - JavaScript - GPL-3.0" ], [ "OpenSkyscraper (home, entry)", @@ -7398,7 +7398,7 @@ "Link", "beta / inactive since 2012", "role playing, inspired by Fallout 2, remake", - "Source - Python - GPL-3.0" + "Source - Python - GPL-3.0" ], [ "PARSEC47 (home, entry)", diff --git a/entries/doomsday_engine.md b/entries/doomsday_engine.md index c5578b4a..144dfef5 100644 --- a/entries/doomsday_engine.md +++ b/entries/doomsday_engine.md @@ -7,7 +7,7 @@ _Remake of Doom, Doom II, Heretic, Hexen._ - Download: https://sourceforge.net/projects/deng/files/ - Platform: Windows, Linux, macOS - Keywords: action, commercial content, inspired by Doom + Doom II + Heretic + Hexen, remake, requires original content -- Code repository: https://github.com/skyjake/Doomsday-Engine.git, https://git.code.sf.net/p/deng/code (+), http://hg.code.sf.net/p/deng/code-0 (hg) +- Code repository: https://github.com/skyjake/Doomsday-Engine.git, https://git.code.sf.net/p/deng/code (+) - Code language: C, C++ - Code license: GPL-2.0 (see source files), GPL-3.0, LGPL-3.0 (core) diff --git a/entries/kknd.md b/entries/kknd.md index c911e36a..31b638cb 100644 --- a/entries/kknd.md +++ b/entries/kknd.md @@ -12,5 +12,6 @@ _Remake of Krush, Kill 'n' Destroy._ - Code license: GPL-3.0 - Code dependencies: OpenRA +See also https://github.com/gp-alex/OpenKKND ## Building diff --git a/entries/kq_lives.md b/entries/kq_lives.md index 6fd0ff8a..30c6d091 100644 --- a/entries/kq_lives.md +++ b/entries/kq_lives.md @@ -6,11 +6,11 @@ _A console-style role playing game._ - State: beta, inactive since 2011 - Download: https://sourceforge.net/projects/kqlives/files/ - Keywords: role playing -- Code repository: https://github.com/grrk-bzzt/kqlives.git (backup), https://svn.code.sf.net/p/kqlives/code (svn) +- Code repository: https://github.com/OnlineCop/kqlives.git (archived), https://svn.code.sf.net/p/kqlives/code (svn) - Code language: C - Code license: GPL-2.0 -Are [KQtheBetrayer](https://sourceforge.net/projects/kqthebetrayer/) or [this github fork](https://github.com/grrk-bzzt/kq-fork) different enough to +Are [KQtheBetrayer](https://sourceforge.net/projects/kqthebetrayer/) or [this github fork](https://github.com/OnlineCop/kq-fork) different enough to warrant their own entries? ## Building diff --git a/entries/open_fortress.md b/entries/open_fortress.md index 815bc33d..3b85651c 100644 --- a/entries/open_fortress.md +++ b/entries/open_fortress.md @@ -5,7 +5,7 @@ _Mod of Team Fortress 2._ - Home: https://openfortress.fun/ - State: beta - Keywords: remake, commercial content, inspired by Team Fortress 2, modification, multiplayer competitive + online + LAN + co-op + matchmaking -- Code repository: https://github.com/KaidemonLP/Open-Fortress-Source.git +- Code repository: https://github.com/KaidemonLP/Open-Fortress-Source.git, https://svn.openfortress.fun/svn/open_fortress/ - Code language: C++ - Code license: CC-BY-NC-SA-4.0 (https://github.com/KaydemonLP/Open-Fortress-Source/blob/master/LICENSE), Custom (Source 1 SDK license) - Code dependencies: Source SDK diff --git a/entries/opensc2k.md b/entries/opensc2k.md index 37e1f093..961a67ca 100644 --- a/entries/opensc2k.md +++ b/entries/opensc2k.md @@ -2,11 +2,11 @@ _Remake of SimCity 2000._ -- Home: https://github.com/rage8885/OpenSC2K +- Home: https://github.com/nicholas-ochoa/OpenSC2K - State: beta - Platform: Web - Keywords: simulation, inspired by SimCity 2000, remake -- Code repository: https://github.com/rage8885/OpenSC2K.git +- Code repository: https://github.com/nicholas-ochoa/OpenSC2K.git - Code language: JavaScript - Code license: GPL-3.0 - Code dependencies: Phaser, WebGL diff --git a/entries/parpg.md b/entries/parpg.md index cab7336e..b5b95748 100644 --- a/entries/parpg.md +++ b/entries/parpg.md @@ -6,7 +6,7 @@ _Post-Apocalyptic RPG._ - State: beta, inactive since 2012 - Download: http://blog.parpg.net/download/, http://wiki.parpg.net/Download - Keywords: role playing, inspired by Fallout 2, remake -- Code repository: http://hg.assembla.com/parpg-core (hg), https://gitlab.com/osgames/parpg-core.git (+), http://subversion.assembla.com/svn/parpg-assets/ (svn), http://parpg-trac.cvsdude.com/parpg/browser (svn) +- Code repository: https://gitlab.com/osgames/parpg-core.git, http://subversion.assembla.com/svn/parpg-assets/ (svn), http://parpg-trac.cvsdude.com/parpg/browser (svn) - Code language: Python - Code license: GPL-3.0 - Code dependencies: Blender game engine, FIFE, psyco, pygame, PyQt, PySide diff --git a/entries/ryzom_core.md b/entries/ryzom_core.md index f1e316b9..e9d397ec 100644 --- a/entries/ryzom_core.md +++ b/entries/ryzom_core.md @@ -7,7 +7,7 @@ _MMORPG with open world play._ - State: mature - Play: https://www.ryzom.com/ (commercial) - Keywords: role playing, inspired by Ryzom, multiplayer massive + online, remake, requires server (?) -- Code repository: https://github.com/ryzom/ryzomcore.git +- Code repository: https://github.com/ryzom/ryzomcore.git, https://gitlab.com/ryzom/ryzom-core.git (mirror) - Code language: C++ - Code license: AGPL-3.0 - Assets license: CC diff --git a/entries/scourge.md b/entries/scourge.md index 427371d2..07d9008b 100644 --- a/entries/scourge.md +++ b/entries/scourge.md @@ -11,7 +11,7 @@ _Roguelike game with a 3D user interface._ - Code license: GPL-2.0 - Code dependencies: SDL -See also: https://github.com/q4a/scourge2, https://bitbucket.org/uzudil/scourge2/ +See also: https://github.com/q4a/scourge2 ## Building diff --git a/entries/wizards_magic.md b/entries/wizards_magic.md index 9c9aeed5..d7e400b0 100644 --- a/entries/wizards_magic.md +++ b/entries/wizards_magic.md @@ -2,7 +2,7 @@ _Simple card strategy, based on Magic: The Gathering rules._ -- Home: https://code.google.com/archive/p/wizards-magic/, https://sourceforge.net/projects/wizards-magic/, https://bitbucket.org/chubakur/wizards-magic-old +- Home: https://code.google.com/archive/p/wizards-magic/ - Media: https://web.archive.org/web/20160407053043/https://lgdb.org/game/wizards_magic - State: mature, inactive since 2012 - Download: https://code.google.com/archive/p/wizards-magic/downloads diff --git a/statistics.md b/statistics.md index 08c277c2..b0f03470 100644 --- a/statistics.md +++ b/statistics.md @@ -1,7 +1,7 @@ [comment]: # (autogenerated content, do not edit) # Statistics -analyzed 1443 entries on 2020-08-26 15:53:31 +analyzed 1443 entries on 2020-08-26 19:30:05 ## State