Skip to content

New tool local language repositories - #186

Merged
alfsb merged 3 commits into
php:masterfrom
alfsb:languages
Dec 9, 2024
Merged

New tool local language repositories#186
alfsb merged 3 commits into
php:masterfrom
alfsb:languages

Conversation

@alfsb

@alfsbalfsb commented Nov 23, 2024

Copy link
Copy Markdown
Member

This is a small tool I made for creating and maintaining manual language clones. I got tired of searching outside of doc-base for listings of languages that builds and publishes, that builds only revcheck, their cloning end points, and so on, to later include/use in other scripts. After a while, it grew into a complete tool for creating and maintaining local language repositories for editors and tool makers.

Current usage:

usage: [--clone] [--undo] [--pull] [--mark] [--quiet]
[--list-cvs] [--list-ssv] [--rev] [--all]
[lang] [lang] ...
Options that operates on local repositories:
--clone Clone a sibling language repo, if not exists
--undo Restore and clean up repositories to a pristine state
--pull Executes git pull
--mark Creates/deletes marking files
--quiet Set this option on git commands
Options that output simple listings:
--list-csv List selected langcodes separated with commas
--list-ssv List selected langcodes separated with spaces
Options that select more languages to operate:
--rev Include languages with revcheck flag
--all Include all languages

Need a complete new checkout of all publishing languages for testing purposes? Git clone doc-base and do php doc-base/languages.php --clone. Boom, done.

Also need the revchecking ones? languages.php --clone --rev. Need all repositories? languages.php --clone --all.

Has one set of clones that need pulling for a test? languages.php --pull --all. After a test, need to revert them to pristine state? languages.php --undo --all. Two or three in particular? languages.php --undo --pull dir1 dir2 dir3.

Need to know what are the building languages? languages.php --list-csv. Space separated for shell scripts? languages.php --list-ssv. And also use --all/--rev for listings beyond building publishing ones.

Prefer to have this information as files, instead doing string path manipulations? languages.php --mark creates BUILDMAN / BUILDREV files that contain the respective language label as contents, so any new command can simple traverse all directories for lang/BUILDMAN file existence.

@alfsb

Copy link
Copy Markdown
MemberAuthor

@jimwins , if you are interested, I can add an --prune option, so this tool can create, restore, update and remove local language repositories, in one go:

php doc-base/languages.php --clone --prune --undo --pull --mark --rev

The --mark option is to be possible to test what langDirs are buildable or genrevdb only by examining for lang/BUILDMAN and lang/BUILDREV file, instead of using --list-csv/ --list-ssv. The --rev option is to include genrevdb langDirs, beyond buildable ones.

@GirgiasGirgias mentioned this pull request Dec 5, 2024
47 tasks
@alfsb

alfsb commented Dec 5, 2024

Copy link
Copy Markdown
MemberAuthor

If are no objections, I plan to merge this PR by next week, as I'm really calling into this code every time there something that need to be tested on all languages.

@alfsb

alfsb commented Dec 9, 2024

Copy link
Copy Markdown
MemberAuthor

Merged. Let me know if there are any bugs or surprising behaviors. This might be a step into moving the list of active languages (build-able list, revcheck list) to doc-base.

@alfsb
alfsb merged commit 1c3fbf6 into php:masterDec 9, 2024
@alfsb
alfsb deleted the languages branch December 12, 2024 13:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@alfsb