Commit 70ee99d
committed
Split tools.func into five parts behind an unchanged loader
tools.func was 10,449 lines and 134 functions, a third of the whole engine in
one unsectioned file. The implementations now sit in shared/tools/ by domain --
system, forge, runtime, db, hwaccel -- and shared/tools.func is an 80-line
loader, so every caller still sources exactly one file.
Nothing about the API changed. The split was done by segmenting on top-level
definitions and proven lossless two ways: concatenating the segments in original
order reproduces the file byte for byte, and sourcing the loader yields the same
133 functions with byte-identical bodies as sourcing the original.
That proof mattered. get_current_ip looks like a 134th top-level definition but
is payload inside a heredoc that setup_local_ip_helper writes to disk. Splitting
on brace balance would have cut that function in half; splitting on the next
definition kept it whole, and it happened to land in the same part as its
parent. Had it been classified elsewhere, the heredoc would have been torn
across two files and the generated helper truncated -- visible only on a user's
host, at install time.
So shared/tools/API.txt records the exported set and a workflow diffs against it
on any change under shared/tools/, alongside a parse check of every part.
Two pre-existing documentation errors surfaced while cross-checking the
published reference: it lists get_current_ip, which is heredoc payload and not
an API at all, and is_alpine, which exists in core.func and alpine-tools.func
rather than here.1 parent e6ad1b3 commit 70ee99d
9 files changed
Lines changed: 10697 additions & 10400 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
236 | 244 | | |
237 | 245 | | |
238 | 246 | | |
| |||
0 commit comments