I submitted the new clean command to github (
https://github.com/eddie3/gogrepo). You can run clean with -dryrun to see what would be moved and total size of the files. Without the -dryrun option, it will orphan files into a "!orphaned" directory relative to the cleandir.
Usage:
python gogrepo.py clean -h
usage: gogrepo.py clean [-h] [-dryrun] cleandir
positional arguments:
cleandir root directory containing gog games
optional arguments:
-h, --help show this help message and exit
-dryrun do not move/orphan files, only display what would be cleaned
Example:
./gogrepo.py clean T:\gog
It works like this:
* Any unknown folders found in the root cleandir will be moved to "!orphaned" folder (eg. unknown_dir -> !orphaned\unknown_dir)
* Files in the root cleandir are ignored (since gogrepo.py would have only ever created game folders from root eg. the_witcher_2\)
* Any files in a game directory that are unknown to manifest will be moved to "!orphaned" folder (eg. the_witcher_2\old_patch.exe -> !orphaned\the_witcher_2\old_patch.exe)
* Any sub directories found within a game folder will be ignored (eg. the_witcher_2\mods would be left unscanned and untouched). Since gogrepo.py doesn't create subdirectories within game folders, it assumes this is created by the user manually.
So basically this is a pretty safe clean where you can review the stuff moved into !orphaned and delete as you wish.
You can add root cleandir subdir exclusions if you want by modifying ORPHAN_DIR_EXCLUDE_LIST in the source.
You can change the orphan foldername by modifying ORPHAN_DIR_NAME. I could add an command line option later, but I assume most people will just delete the folder after reviewing.
Example of clean with -dryrun (you can see what would be moved)
python gogrepo.py clean t:\gog -dryrun
22:40:20 | loading local manifest...
22:40:21 | scanning local directories within 't:\gog'...
22:40:23 | orphaning file 'tex_murphy_1_mean_streets\gog_tex_murphy_mean_streets_1.0.0.1.tar.gz'
22:40:23 | orphaning file 'tex_murphy_1_mean_streets\gog_tex_murphy_mean_streets_1.0.0.1.deb'
22:40:23 | orphaning file 'tex_murphy_2_martian_memorandum\gog_tex_murphy_martian_memorandum_1.0.0.1.deb'
22:40:23 | orphaning file 'tex_murphy_2_martian_memorandum\gog_tex_murphy_martian_memorandum_1.0.0.1.tar.gz'
22:40:23 | orphaning file 'tex_murphy_the_pandora_directive\gog_tex_murphy_the_pandora_directive_1.0.0.5.tar.gz'
22:40:23 | orphaning file 'tex_murphy_under_a_killing_moon\gog_tex_murphy_under_a_killing_moon_1.0.0.5.tar.gz'
22:40:23 |
22:40:23 | total size of newly orphaned files: 4.52GB
22:40:23 | --
22:40:23 | total time: 0:00:02.642685
22:40:23 | exiting...
Do a real clean where unknown files are moved to !orphaned folder
python gogrepo.py clean t:\gog
22:52:39 | loading local manifest...
22:52:39 | scanning local directories within 't:\gog'...
22:52:41 | orphaning file 'tex_murphy_1_mean_streets\gog_tex_murphy_mean_streets_1.0.0.1.tar.gz'
22:52:41 | orphaning file 'tex_murphy_1_mean_streets\gog_tex_murphy_mean_streets_1.0.0.1.deb'
22:52:41 | orphaning file 'tex_murphy_2_martian_memorandum\gog_tex_murphy_martian_memorandum_1.0.0.1.deb'
22:52:41 | orphaning file 'tex_murphy_2_martian_memorandum\gog_tex_murphy_martian_memorandum_1.0.0.1.tar.gz'
22:52:41 | orphaning file 'tex_murphy_the_pandora_directive\gog_tex_murphy_the_pandora_directive_1.0.0.5.tar.gz'
22:52:41 | orphaning file 'tex_murphy_under_a_killing_moon\gog_tex_murphy_under_a_killing_moon_1.0.0.5.tar.gz'
22:52:41 |
22:52:41 | total size of newly orphaned files: 4.52GB
22:52:41 | orphaned items moved to: t:\gog\!orphaned
22:52:41 | --
22:52:41 | total time: 0:00:02.551700
22:52:41 | exiting...
Doing a clean on an already clean collection:
python gogrepo.py clean t:\gog -dryrun
22:38:50 | loading local manifest...
22:38:50 | scanning local directories within 't:\gog'...
22:38:52 | nothing to clean. nice and tidy!
22:38:52 | --
22:38:52 | total time: 0:00:02.519361
22:38:52 | exiting...