Create a metadata cache and use it to drive merges, updates and search #66
template_list_cache into master This is a huge commit (for the script size). I have not split it up because everything is connected to a change is design. The center of the script is now a template information cache. That is a simple text file with lines in the format: template|version_revision|repo|restricted This is used by merge_xtra_templates(), search_template(), discover_updates() and created by build_template_index(). Some related changes use other small caches with similar formats. awk is used for many of the new functions.
- use xbps-src show-sys-upgrades for upgrade discovery - use awk to also sort results - enable system sw upgrades with the -U arguments
b05e1ecbf7
to 7a670f565d
e82edf1c08
to a9eb3a8023
A lot of heavy lifting is done in awk, and at this point, it would make a bit more sense to move this code elsewhere for clarity.
The rest of the comments are observations; feel free to disregard them. Overall, this feels more powerful.
@ -193,4 +198,3 @@
sum=1ドル
# decimal → hex using POSIX printf
hash=$(printf "%x" "$sum")
Is this a literal that needs to be single-quoted?
There is certainly a bug in the vicinity, but %x is the printf format specifier/specification. I have to fix this is more ways than one.
Some cksums will disappear as they are overkill.
@ -218,0 +212,4 @@
msg debug "template_index missing, building it"
build_template_index
else
msg debug "template_index already exists"
The value could be passed here just for completeness:
msg debug "template_index already exists: $template_index"
Nice suggestion, thanks 😉
@ -218,0 +269,4 @@
BEGIN { OFS="|" }
FNR==1 {
v = ""
Perhaps more descriptive names would help.
These are awk syntax. They are short because they are ancient. They remain powerful though!
@AngMits wrote in #66 (comment):
A lot of heavy lifting is done in awk, and at this point, it would make a bit more sense to move this code elsewhere for clarity.
The rest of the comments are observations; feel free to disregard them. Overall, this feels more powerful.
Thanks for the review and recommendations!
The awk parts should be pulled out of the main script. In fact I believe that most of the sh functions should be in separate files, sourced by the xut script.
Awk is separate though. It can be an executable helper with the awk shebang called with arguments to do whatever is needed. Much cleaner that the current state of affairs.
BTW, I will also need to document a dependency on gawk or rewrite parts of the code. Maybe add local variables in the shell parts (supported by ash, dash, bb ash, bash, zsh, mksh...).
8be1b60d64
to f37dc6610a
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?