Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tool local language repositories #186

Merged
merged 3 commits into from
Dec 9, 2024
Merged

New tool local language repositories #186

merged 3 commits into from
Dec 9, 2024

Conversation

alfsb
Copy link
Member

@alfsb alfsb commented Nov 23, 2024

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
Member Author

alfsb commented Nov 25, 2024

@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.

@Girgias Girgias mentioned this pull request Dec 5, 2024
27 tasks
@alfsb
Copy link
Member Author

alfsb commented Dec 5, 2024

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
Copy link
Member Author

alfsb commented Dec 9, 2024

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:master Dec 9, 2024
8 of 12 checks passed
@alfsb alfsb deleted the languages branch December 12, 2024 13:03
Sign up for free to 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