added new entries, update can also list repositories by size

This commit is contained in:
Trilarion 2018-07-04 16:15:48 +02:00
parent 1000938341
commit 27d2a0698d
11 changed files with 172 additions and 39 deletions

View File

@ -3,14 +3,14 @@
[Dynamic HTML table](https://trilarion.github.io/opensourcegames/) of the entries / Development [Blog](https://trilarion.blogspot.com/search/label/osgames)
[comment]: # (start of autogenerated content, do not edit)
406 entries
- **[Action/Arcade](games/action/_toc.md)** (20)
408 entries
- **[Action/Arcade](games/action/_toc.md)** (21)
- **[Adventure & Visual novels](games/adventure/_toc.md)** (15)
- **[Engines & Frameworks](games/framework/_toc.md)** (52)
- **[Libraries](games/library/_toc.md)** (22)
- **[Role Playing](games/rpg/_toc.md)** (106)
- **[Simulation](games/simulation/_toc.md)** (15)
- **[Strategy](games/strategy/_toc.md)** (164)
- **[Strategy](games/strategy/_toc.md)** (165)
- **[Tools & Manuals](games/misc/_toc.md)** (12)
[comment]: # (end of autogenerated content)

View File

@ -441,6 +441,15 @@
"",
"<a href=\"https://github.com/cocos2d/cocos2d-x\">Source</a> - C++ - MIT"
],
[
"Cabbages and Kings (<a href=\"https://github.com/Mekire/cabbages-and-kings\">home</a>, <a href=\"https://github.com/Trilarion/opensourcegames/blob/master/games/action/cabbages_and_kings.md\">entry</a>)",
"Mix between action and rpg.",
"",
"Action/Arcade",
"mature / active",
"",
"<a href=\"https://github.com/Mekire/cabbages-and-kings\">Source</a> - Python - MIT"
],
[
"Caesar IA (<a href=\"https://bitbucket.org/dalerank/caesaria/overview\">home</a>, <a href=\"https://github.com/Trilarion/opensourcegames/blob/master/games/strategy/caesar_ia.md\">entry</a>)",
"Remake of the popular citybuilder/economic strategy -..",
@ -1465,7 +1474,7 @@
"Strategy",
"beta / inactive since 2012",
"TBS, online",
"<a href=\"https://github.com/mgfreshour/hexwar\">Source</a> - Ruby, JavaScript"
"<a href=\"https://github.com/mgfreshour/hexwar\">Source</a> - Ruby, JavaScript - MIT"
],
[
"Holyspirit (<a href=\"https://sourceforge.net/projects/lechemindeladam/\">home</a>, <a href=\"https://github.com/Trilarion/opensourcegames/blob/master/games/rpg/holy_spirit.md\">entry</a>)",
@ -2682,6 +2691,15 @@
"remake, requires original content",
"<a href=\"https://github.com/jsettlers/settlers-remake\">Source</a> - Java - MIT"
],
[
"SharpKonquest (<a href=\"https://sourceforge.net/projects/sharpkonquest/\">home</a>, <a href=\"https://github.com/Trilarion/opensourcegames/blob/master/games/strategy/sharpkonquest.md\">entry</a>)",
"C# implementation of the classic Linux game \"Konquest\".",
"<a href=\"https://sourceforge.net/projects/sharpkonquest/files/\">Link</a>",
"Strategy",
"mature / inactive since 2007",
"",
"<a href=\"https://gitlab.com/Trilarion/sharpkonquest.git\">Source</a> - C# - GPL-2.0"
],
[
"Silvertree (<a href=\"https://code.google.com/archive/p/silvertree/\">home</a>, <a href=\"https://github.com/Trilarion/opensourcegames/blob/master/games/rpg/silvertree.md\">entry</a>)",
"3D RPG with a hybrid real time, turn based system.",

View File

@ -3,6 +3,7 @@
[comment]: # (start of autogenerated content, do not edit)
- **[Astromenace](astromenace.md)** (C++, C, GPL-3.0, mature)
- **[Boulder Dash](boulder_dash.md)** (Java, MIT, mature, inactive since 2015)
- **[Cabbages and Kings](cabbages_and_kings.md)** (Python, MIT, mature)
- **[Cat Mother Dead Justice](catmother.md)** (C++, BSD, beta, inactive since 2003)
- **[CommandoJS](commando_js.md)** (JavaScript, CoffeeScript, MIT, beta, inactive since 2012)
- **[Epiar](epiar.md)** (C, C++, Lua, GPL-2.0, beta)

View File

@ -0,0 +1,13 @@
# Cabbages and Kings
_Mix between action and rpg._
- Home: https://github.com/Mekire/cabbages-and-kings
- State: mature
- Code repository: https://github.com/Mekire/cabbages-and-kings
- Code language: Python
- Code license: MIT
- Code dependencies: Pygame
## Building

View File

@ -1,17 +1,17 @@
[comment]: # (autogenerated content, do not edit)
# Statistics
analyzed 406 entries on 2018-07-03 11:44:25
analyzed 408 entries on 2018-07-04 14:29:30
## State
- mature: 240 (59.1%)
- beta: 166 (40.9%)
- inactive: 173 (42.6%)
- mature: 242 (59.3%)
- beta: 166 (40.7%)
- inactive: 174 (42.6%)
##### Inactive State
Zone of Control (2017), 3d.city (2016), Atlantis (2016), Atrinik (2016), Birth of the Empires (2016), DNT (2016), Dark Destiny (2016), Dungeon Monkey Eternal (2016), FreeRCT (2016), Mechanized Assault & eXploration Reloaded (2016), Polis (2016), Battleround (2015), Boulder Dash (2015), Dash Engine (2015), Delta Engine (2015), Egoboo (2015), Free heroes2 engine (2015), M.E.W.L. (2015), Project Helena (2015), Roguish (2015), The Epic of Heroes (2015), TwinEngine (2015), Witch Blast (2015), pyORPG (2015), Argentum Online (2014), Battles of Antargis (2014), Deity (2014), Drop Shock (2014), Dune Dynasty (2014), EternalWinterWars (2014), FAR Colony (2014), Hale (2014), Heroes of Wing Commander (2014), Kingdoms (2014), Lips of Suna (2014), Open RPG Maker (2014), Open Tibia (2014), Radakan (2014), SDL Game Engine 2D (2014), Sintel The Game (2014), Summoning Wars (2014), Supremacy (2014), Turious (2014), Xenowar (2014), rpge (2014), sandbox Game Maker (2014), Bos Wars (2013), C-evo (2013), Decker (2013), DemiGod (2013), Dungeon Mapper (2013), Holyspirit (2013), MechCommander 2 Omnitech (2013), Mpango (2013), Murder In The Public Domain (2013), OpenRPG (2013), Phantasy Star Rebirth (2013), Room for Change (2013), Source of Tales (2013), Trinity Reign (2013), VegaTrek (2013), BlackNova Traders (2012), Blitzkrieg (2012), Cataclysm (2012), CommandoJS (2012), Conquests (2012), Dark City (2012), Goblin Camp (2012), Hexwar (2012), PARPG (2012), Solar Empire (2012), Thousand Parsec (2012), UFO2000 (2012), Wizards Magic (2012), Age of Magic (2011), Battlefield Java (2011), Danger from the Deep (2011), Dawn (2011), GalaxyMage Redux (2011), JaNaG - Java Name Generator (2011), KQ Lives (2011), Kobold's Quest 2 (2011), OpenMOO2 (2011), RuneSword II (2011), Skrupel - Tribute Compilation (2011), Song of Albion (2011), Star Control II: The Ur-Quan Masters (2011), UlDunAd (2011), World of Phaos (2011), X-Force: Fight For Destiny (2011), AI Wars (2010), Crimson Fields (2010), Dragon History - Dračí Historie (2010), Endgame: Singularity (2010), Heroes of Wesnoth (2010), Labyrinth of Worlds (2010), Linwarrior 3D (2010), Mercenary Commander (2010), OpenHoMM (2010), Slay (2010), Solaris the Game (2010), SpaceTrader for Java (2010), XSera (2010), 8 Kingdoms (2009), Alien Assault Traders (2009), Annchienta (2009), Ardentryst (2009), Begin2 (2009), Crown and Cutlass (2009), Dark Oberon (2009), Duel Commander (2009), Fall of Imyrin (2009), Fallen Spire (2009), FreeTrain (2009), Glest (2009), Goblin Hack (2009), ORIENT (2009), OpenPop (2009), Secret Mario Chronicles (2009), Space Trader for Windows (2009), World of Heroes (2009), A Planet's Revenge (2008), Attal: Lords of doom (2008), Avanor (2008), Freestars (2008), Mars, Land of No Mercy (2008), Meritous (2008), S.C.O.U.R.G.E. (2008), Scoreos (2008), Sengoku: Warring States of Japan (2008), Space Opera (2008), Armies (2007), Eos, Dawn of Light: A Space Opera (2007), Silvertree (2007), Slash'EM (2007), Underworld Adventures (2007), Arthur's Knights (2006), Betrayer's Moon Tactics (2006), Boson (2006), Eleconics (2006), JQuest (2006), Linley's Dungeon Crawl (2006), Metal Mech (2006), RPDungeon - computer aided role playing (2006), Rogue Clone IV (2006), Visions from the Other Side (2006), GalaxyNG (2005), H-World (2005), LinCity (2005), Spice Trade (2005), WAtomic (2005), Xconq (2005), ZAngband (2005), Colonization too (2004), GM Tools (2004), Gee Whiz (2004), Openglad (2004), Promisance (2004), T-Bots (2004), AntiChess (2003), Cat Mother Dead Justice (2003), Civil (2003), Machinations (2003), Pizza Business (2003), Planetary Hoppers (2003), The Clans (2003), Wargamer (2003), XArchon (2003), Umbra (2002), Greenius' Civil War (2001), Tux Racer (2001), Operation Citadel (2000), xdigger (1999)
Zone of Control (2017), 3d.city (2016), Atlantis (2016), Atrinik (2016), Birth of the Empires (2016), DNT (2016), Dark Destiny (2016), Dungeon Monkey Eternal (2016), FreeRCT (2016), Mechanized Assault & eXploration Reloaded (2016), Polis (2016), Battleround (2015), Boulder Dash (2015), Dash Engine (2015), Delta Engine (2015), Egoboo (2015), Free heroes2 engine (2015), M.E.W.L. (2015), Project Helena (2015), Roguish (2015), The Epic of Heroes (2015), TwinEngine (2015), Witch Blast (2015), pyORPG (2015), Argentum Online (2014), Battles of Antargis (2014), Deity (2014), Drop Shock (2014), Dune Dynasty (2014), EternalWinterWars (2014), FAR Colony (2014), Hale (2014), Heroes of Wing Commander (2014), Kingdoms (2014), Lips of Suna (2014), Open RPG Maker (2014), Open Tibia (2014), Radakan (2014), SDL Game Engine 2D (2014), Sintel The Game (2014), Summoning Wars (2014), Supremacy (2014), Turious (2014), Xenowar (2014), rpge (2014), sandbox Game Maker (2014), Bos Wars (2013), C-evo (2013), Decker (2013), DemiGod (2013), Dungeon Mapper (2013), Holyspirit (2013), MechCommander 2 Omnitech (2013), Mpango (2013), Murder In The Public Domain (2013), OpenRPG (2013), Phantasy Star Rebirth (2013), Room for Change (2013), Source of Tales (2013), Trinity Reign (2013), VegaTrek (2013), BlackNova Traders (2012), Blitzkrieg (2012), Cataclysm (2012), CommandoJS (2012), Conquests (2012), Dark City (2012), Goblin Camp (2012), Hexwar (2012), PARPG (2012), Solar Empire (2012), Thousand Parsec (2012), UFO2000 (2012), Wizards Magic (2012), Age of Magic (2011), Battlefield Java (2011), Danger from the Deep (2011), Dawn (2011), GalaxyMage Redux (2011), JaNaG - Java Name Generator (2011), KQ Lives (2011), Kobold's Quest 2 (2011), OpenMOO2 (2011), RuneSword II (2011), Skrupel - Tribute Compilation (2011), Song of Albion (2011), Star Control II: The Ur-Quan Masters (2011), UlDunAd (2011), World of Phaos (2011), X-Force: Fight For Destiny (2011), AI Wars (2010), Crimson Fields (2010), Dragon History - Dračí Historie (2010), Endgame: Singularity (2010), Heroes of Wesnoth (2010), Labyrinth of Worlds (2010), Linwarrior 3D (2010), Mercenary Commander (2010), OpenHoMM (2010), Slay (2010), Solaris the Game (2010), SpaceTrader for Java (2010), XSera (2010), 8 Kingdoms (2009), Alien Assault Traders (2009), Annchienta (2009), Ardentryst (2009), Begin2 (2009), Crown and Cutlass (2009), Dark Oberon (2009), Duel Commander (2009), Fall of Imyrin (2009), Fallen Spire (2009), FreeTrain (2009), Glest (2009), Goblin Hack (2009), ORIENT (2009), OpenPop (2009), Secret Mario Chronicles (2009), Space Trader for Windows (2009), World of Heroes (2009), A Planet's Revenge (2008), Attal: Lords of doom (2008), Avanor (2008), Freestars (2008), Mars, Land of No Mercy (2008), Meritous (2008), S.C.O.U.R.G.E. (2008), Scoreos (2008), Sengoku: Warring States of Japan (2008), Space Opera (2008), Armies (2007), Eos, Dawn of Light: A Space Opera (2007), SharpKonquest (2007), Silvertree (2007), Slash'EM (2007), Underworld Adventures (2007), Arthur's Knights (2006), Betrayer's Moon Tactics (2006), Boson (2006), Eleconics (2006), JQuest (2006), Linley's Dungeon Crawl (2006), Metal Mech (2006), RPDungeon - computer aided role playing (2006), Rogue Clone IV (2006), Visions from the Other Side (2006), GalaxyNG (2005), H-World (2005), LinCity (2005), Spice Trade (2005), WAtomic (2005), Xconq (2005), ZAngband (2005), Colonization too (2004), GM Tools (2004), Gee Whiz (2004), Openglad (2004), Promisance (2004), T-Bots (2004), AntiChess (2003), Cat Mother Dead Justice (2003), Civil (2003), Machinations (2003), Pizza Business (2003), Planetary Hoppers (2003), The Clans (2003), Wargamer (2003), XArchon (2003), Umbra (2002), Greenius' Civil War (2001), Tux Racer (2001), Operation Citadel (2000), xdigger (1999)
## Code Languages
@ -21,14 +21,14 @@ Imperium, Land of Fire, Open AL, Open General, Solaris the Game, VegaTrek, Xconq
##### Language frequency
- C++ (36.6%)
- C (19.8%)
- Java (11.9%)
- Python (8.7%)
- C++ (36.4%)
- C (19.7%)
- Java (11.8%)
- Python (8.9%)
- Lua (5.2%)
- JavaScript (3.7%)
- PHP (3.3%)
- C# (2.5%)
- C# (2.7%)
- Pascal (2.3%)
- Ren'py (0.8%)
- Haxe (0.6%)
@ -57,17 +57,17 @@ Imperium, Land of Fire, Open AL, Open General, Solaris the Game, VegaTrek, Xconq
## Code licenses
Without license tag: 23 (5.7%)
Without license tag: 22 (5.4%)
8 Kingdoms, Armies, Battlefield Java, C-evo, Dark Destiny, Drop Shock, Eleconics, First Strike, H-World, Hexwar, Imperium, JQuest, Labyrinth of Worlds, Land of Fire, Mpango, Open General, OpenRPG, Project Helena, RuneSword II, Solar Empire, Solaris the Game, SpaceTrader for Java, sCoreForge Pathfinder Character Creator
8 Kingdoms, Armies, Battlefield Java, C-evo, Dark Destiny, Drop Shock, Eleconics, First Strike, H-World, Imperium, JQuest, Labyrinth of Worlds, Land of Fire, Mpango, Open General, OpenRPG, Project Helena, RuneSword II, Solar Empire, Solaris the Game, SpaceTrader for Java, sCoreForge Pathfinder Character Creator
##### Licenses frequency
- GPL-2.0 (39.1%)
- GPL-3.0 (25.6%)
- MIT (11.1%)
- GPL-3.0 (25.4%)
- MIT (11.6%)
- Custom (5.7%)
- Apache-2.0 (3.4%)
- Apache-2.0 (3.3%)
- zlib (2.3%)
- BSD (2.1%)
- GPL (1.3%)

View File

@ -73,7 +73,7 @@
- **[Harris](harris.md)** (C, Python, GPL-3.0, beta)
- **[Heroes of Wesnoth](heroes_of_wesnoth.md)** (C++, GPL-3.0, beta, inactive since 2010)
- **[Heroes of Wing Commander](heroes_of_wing_commander.md)** (Python, GPL-3.0, beta, inactive since 2014)
- **[Hexwar](hexwar.md)** (Ruby, JavaScript, beta, inactive since 2012)
- **[Hexwar](hexwar.md)** (Ruby, JavaScript, MIT, beta, inactive since 2012)
- **[JQuest](jquest.md)** (Java, beta, inactive since 2006)
- **[JSettlers](jsettlers.md)** (Java, GPL-3.0, mature)
- **[Jagged Alliance 2 Stracciatella](jagged_alliance2.md)** (C++, Custom, mature)
@ -120,6 +120,7 @@
- **[Scoreos](scoreos.md)** (PHP, GPL-2.0, beta, inactive since 2008)
- **[Sengoku: Warring States of Japan](sengoky_warring_states_of_japan.md)** (C++, Lua, MIT, beta, inactive since 2008)
- **[Settlers III remake](settlers_iii_remake.md)** (Java, MIT, beta)
- **[SharpKonquest](sharpkonquest.md)** (C#, GPL-2.0, mature, inactive since 2007)
- **[Simple-Solitaire](simple_solitaire.md)** (Java, GPL-3.0, mature)
- **[Skrupel - Tribute Compilation](skrupel.md)** (PHP, JavaScript, GPL-2.0, mature, inactive since 2011)
- **[Slay](slay.md)** (Java, GPL-3.0, beta, inactive since 2010)

View File

@ -7,6 +7,7 @@ _Simple turn based, hexagon map, strategy game in the tradition of Panzer Genera
- Keywords: TBS, online
- Code repository: https://github.com/mgfreshour/hexwar
- Code language: Ruby, JavaScript
- Code license: MIT
## Building

View File

@ -0,0 +1,14 @@
# SharpKonquest
_C# implementation of the classic Linux game "Konquest"._
- Home: https://sourceforge.net/projects/sharpkonquest/
- State: mature, inactive since 2007
- Download: https://sourceforge.net/projects/sharpkonquest/files/
- Code repository: https://gitlab.com/Trilarion/sharpkonquest.git (snapshot of source releases)
- Code language: C#
- Code license: GPL-2.0
License has been added after personal communication with the original maintainer (https://github.com/Trilarion/opensourcegames/issues/17).
## Building

View File

@ -86,6 +86,7 @@
"https://github.com/MattMatt0240/DemiGod.git",
"https://github.com/MegaGlest/megaglest-source.git",
"https://github.com/MegaMek/megamek.git",
"https://github.com/Mekire/cabbages-and-kings.git",
"https://github.com/Meridian59/Meridian59.git",
"https://github.com/MonoGame/MonoGame.git",
"https://github.com/MovingBlocks/Terasology.git",
@ -341,6 +342,7 @@
"https://gitlab.com/Trilarion/pymapper.git",
"https://gitlab.com/Trilarion/rogueclone.git",
"https://gitlab.com/Trilarion/sentient-storage.git",
"https://gitlab.com/Trilarion/sharpkonquest.git",
"https://gitlab.com/Trilarion/skrupel.git",
"https://gitlab.com/Trilarion/slaygame.git",
"https://gitlab.com/Trilarion/spicetrade.git",

View File

@ -3,10 +3,11 @@ The svn is too big to be automatically imported to git (and Github) because ther
Needs a manual solution.
TODO use git lfs migrate later on the elements
TODO check for sufficient disc space before checkout
"""
import json
import psutil
from utils.utils import *
@ -27,7 +28,8 @@ def special_treatment(destination, revision):
# remove it
shutil.rmtree(os.path.join(destination, 'Holyspirit'))
if 337 <= revision <= 400:
# copy all important files from Holyspirit and delete it
if 337 <= revision <= 1200:
source = os.path.join(destination, 'Holyspirit')
if os.path.isdir(source):
data = os.path.join(source, 'Data')
@ -39,6 +41,24 @@ def special_treatment(destination, revision):
# remove it
shutil.rmtree(source)
# remove Holyspirit3 folder
if 464 <= revision <= 1200:
source = os.path.join(destination, 'Holyspirit3')
if os.path.isdir(source):
shutil.rmtree(source)
# remove Holyspirit2 folder
if 659 <= revision <= 1200:
source = os.path.join(destination, 'Holyspirit2')
if os.path.isdir(source):
shutil.rmtree(source)
# remove Launcher/release
if 413 <= revision <= 1200:
source = os.path.join(destination, 'Launcher', 'release')
if os.path.isdir(source):
shutil.rmtree(source)
# delete all *.dll, *.exe in base folder
if 3 <= revision <= 9:
files = os.listdir(destination)
@ -46,16 +66,50 @@ def special_treatment(destination, revision):
if file.endswith('.exe') or file.endswith('.dll'):
os.remove(os.path.join(destination, file))
# delete "cross" folder
if 42 <= revision <= 43:
folder = os.path.join(destination, 'Cross')
if os.path.isdir(folder):
shutil.rmtree(folder)
if 374 <= revision:
# delete personal photos
if 374 <= revision <= 1200:
folder = os.path.join(destination, 'Photos')
if os.path.isdir(folder):
shutil.rmtree(folder)
# move empire of steam out
if 1173 <= revision <= 1200:
folder = os.path.join(destination, 'EmpireOfSteam')
if os.path.isdir(folder):
# move to empire path
empire = os.path.join(empire_path, 'r{:04d}'.format(revision))
shutil.move(folder, empire)
# holy editor cleanup
if 1078 <= revision <= 1200:
source = os.path.join(destination, 'HolyEditor')
for name in ('bin', 'release'):
folder = os.path.join(source, name)
if os.path.isdir(folder):
shutil.rmtree(folder)
for name in ('moc.exe',):
file = os.path.join(source, name)
if os.path.isfile(file):
os.remove(file)
# source folder cleanup
if 939 <= revision <= 1200:
source = os.path.join(destination, 'Source')
for name in ('HS',):
folder = os.path.join(source, name)
if os.path.isdir(folder):
shutil.rmtree(folder)
for name in ('HS.zip',):
file = os.path.join(source, name)
if os.path.isfile(file):
os.remove(file)
def delete_global_excludes(folder):
"""
@ -105,6 +159,11 @@ def checkout(revision_start, revision_end):
assert revision_end >= revision_start
for revision in range(revision_start, revision_end + 1):
# check free disc space
if psutil.disk_usage(svn_checkout_path).free < 3e10: # 1e10 = 10 GiB
print('not enough free disc space, will exit')
sys.exit(-1)
print('checking out revision {}'.format(revision))
# create destination directory
@ -117,11 +176,6 @@ def checkout(revision_start, revision_end):
subprocess_run(['svn', 'export', '-r{}'.format(revision), svn_url, destination])
print('checkout took {:.1f}s'.format(time.time() - start_time))
# copy to backup
# backup_path = os.path.join(svn_backup_path, 'r{:04d}'.format(revision))
# if not os.path.exists(backup_path):
# shutil.copytree(destination, backup_path)
def fix_revision(revision_start, revision_end):
"""
@ -291,9 +345,9 @@ if __name__ == "__main__":
svn_checkout_path = os.path.join(base_path, 'svn')
if not os.path.exists(svn_checkout_path):
os.mkdir(svn_checkout_path)
svn_backup_path = os.path.join(base_path, 'svn_backup')
if not os.path.exists(svn_backup_path):
os.mkdir(svn_backup_path)
empire_path = os.path.join(base_path, 'empire') # empire of steam side project
if not os.path.exists(empire_path):
os.mkdir(empire_path)
git_path = os.path.join(base_path, 'lechemindeladam')
if not os.path.exists(git_path):
initialize_git()
@ -330,5 +384,11 @@ if __name__ == "__main__":
# gitify(201, 400)
# checkout(401, 800)
# fix_revision(401, 800)
# gitify(401, 800)
checkout(493, 800)
# checkout(801, 1200)
# fix_revision(801, 1200)
# gitify(801, 1200)
checkout(1201, 1500)

View File

@ -12,6 +12,7 @@ Note: May need to set http.postBuffer (https://stackoverflow.com/questions/17683
"""
import json
from utils.utils import *
@ -27,6 +28,7 @@ def derive_folder_name(url, replaces):
return sanitize(url)
raise Exception('malformed url')
def git_folder_name(url):
replaces = {
'https://github.com': 'github',
@ -100,7 +102,7 @@ def bzr_update(folder):
subprocess_run(['bzr', 'pull'])
def run(type, urls):
def run_update(type, urls):
print('update {} {} archives'.format(len(urls), type))
base_folder = os.path.join(archive_folder, type)
if not os.path.exists(base_folder):
@ -140,6 +142,22 @@ def run(type, urls):
update[type](folder)
def run_info(type, urls):
print('collect info on {}'.format(type))
# get derived folder names
folders = [os.path.join(type, folder_name[type](url)) for url in urls]
# collect information
info = []
for folder in folders:
print(folder)
path = os.path.join(archive_folder, folder)
size = folder_size(path) if os.path.isdir(path) else -1
info.append([size, folder])
return info
if __name__ == '__main__':
supported_types = ['git', 'hg', 'svn'] # currently no bzr client installed
@ -173,13 +191,18 @@ if __name__ == '__main__':
text = read_text(os.path.join(root_folder, 'archives.json'))
archives = json.loads(text)
# update
for type in archives:
if type not in supported_types:
continue
urls = archives[type]
run(type, urls)
run_update(type, urls)
# collect info
infos = []
for type in archives:
urls = archives[type]
infos.extend(run_info(type, urls))
infos.sort(key=lambda x: x[0], reverse=True)
text = json.dumps(infos, indent=1)
write_text(os.path.join(archive_folder, 'infos.json'), text)