Metatools 1.0.5 is a major release which was released on 28 May 2022.
The 1.0.5 release of metatools has a number of significant functionality improvements and bug fixes.
Allow Generators To Be Used in Overlays
This is an implementation of the feature request described in FL-9827.
doit now allows the use of official generators such as github-1 to be used outside of kit-fixups. The way this works is that doit will now detect if it is being run inside kit-fixups or not. If it is not, then it will clone/update a kit-fixups repository to
~/repo_tmp/source-trees/kit-fixups to have access to the official generators.
New options have been added to
- Can be used to point to a kit-fixups to clone if you want to use a non-standard kit-fixups for access to custom generators.
- If you are using "doit" outside of kit-fixups, doing a git pull on ~/repo_tmp/source-trees/kit-fixups can take a bit of time. This option tells "doit" to use the already-cloned kit-fixups as-is without trying to update it by hand first.
Simply run "doit" in an arbitrary overlay -- it will "just work". The extra options are there if needed but are not normally required.
github-1 Generator to Lock Version
This implements functionality described in FL-9855. Add a mechanism for github.py and github-1 generator to autogen a specific tag version. This allows us to lock down certain autogens and leverage the github-1 generator even for static ebuilds (I am using this for the containerd ebuild). Before this, it was tricky/impossible to use the generator with tags to generate anything but the latest version.
This commit is being made to both kit-fixups (github-1.py) and metatools.
To use this feature, simply specify a literal version in
version pkginfo. It will be used instead of grabbing the latest version.
Add GitHub Tag Transforms
This implements functionality described in FL-9440:
transform= keyword argument to github.py tag methods to allow tags to be arbitrarily modified before they are searched for version strings. The keyword argument should be a single-argument function/lambda. Note that this functionality can only be used directly from Python, not
YAML, as you must specify a function as an argument.
- Adding missing
Various logging improvements (thanks: User:s4uliu5
Improve JSON Decode
With httpx, sometimes escaping was broken (related to backslashes in strings.) It turns out that with httpx, the most reliable way to get proper json back is to use the json() method on the response object directly rather than rolling your own JSON decoding.
Improve Fetch Cache Consistency
Refactor of the fetch cache, so that
is_json settings are stored in the fetch cache data, and are also used to construct the hash key for the fetch cache, to ensure we always get back JSON when we stored JSON, etc. This completes the work related to robustifying JSON by using httpx's response.json() method, which now ensures we get back the format we originally requested from the fetch cache. Before we were relying on good behavior (no changes between JSON vs no) for a URL, whereas now we can handle this kind of change without returning incorrect format data in some rare cases.
--prod mode, have any locally-cloned destination tree create local branches for any remote branches. This should allow mirroring of the tree to work properly (so the remote won't be asked to delete branches)