Hooks¶
zoryn runs per-package shell scripts from two directories during zoryn up:
| Directory | When it runs |
|---|---|
.gear/merge-up.d/ | After merge with upstream tag, before spec update |
.gear/up.d/ | After spec file update, before commit |
Scripts are executed in lexicographic order. Make them executable (chmod +x).
.gear/merge-up.d/¶
Scripts run after the upstream tag is merged but before the spec file is updated. Useful for regenerating vendored dependencies that need to match the new version.
Interface:
| Symbol | Meaning |
|---|---|
$1 | Clean version derived from $TAG (prefix stripped — see below) |
$TAG | Full upstream tag name as it exists in git (e.g. v1.2.3, release-1.2.3) |
$COMMIT | Full SHA1 of the commit that $TAG resolves to |
$SHORTCOMMIT | First 7 characters of $COMMIT |
Use $1 (or $VERSION if you export VERSION="$1" first) when you need the RPM Version: value. Use $TAG when you need to query git, download a tarball, or anything else that takes the original tag string.
Example .gear/merge-up.d/01-vendor.sh:
.gear/up.d/¶
Scripts run after the spec file has been updated, before the commit. Useful for keeping companion files in sync with the spec version.
Interface:
| Symbol | Meaning |
|---|---|
$1 | The new version that was just written to Version: in the spec (same value as $1 in merge-up.d) |
up.d hooks receive only the positional $1 — they do not get $TAG, $COMMIT, or $SHORTCOMMIT. By the time up.d runs, the merge is finished and only the version is meaningful.
Example .gear/up.d/10-version.sh:
How $1 is derived from $TAG¶
$1 is computed from $TAG in four tiers (first match wins):
.gear/version-up[version]mapping. If the file declares apattern/template(and optionallystrip-prefix,filter), the tag is parsed with that DSL and$1is the renderedtemplate. See[version]in configuration. This always wins if the pattern matches.- Explicit prefix from
.gear/rules. If.gear/rulescontainstar: <prefix>@version@:.(e.g.tar: v@version@:.ortar: libssh2-@version@:.),<prefix>is stripped from$TAG. - Package-name prefix. If
$TAGstarts with<pkg-name>-(the name fromName:in the spec), that prefix is stripped. v/Vprefix. A leadingvorVis stripped unconditionally as a last resort.
After stripping (tiers 2–4), separators - and _ are normalised to . so the result is a valid RPM version. Tier 1 emits template verbatim — the template is responsible for its own punctuation.
$TAG | [version] in .gear/version-up | .gear/rules | Spec Name: | $1 |
|---|---|---|---|---|
v1.2.3 | (none) | tar: v@version@:. | foo | 1.2.3 |
1.2.3 | (none) | tar: @name@-@version@:. | foo | 1.2.3 |
foo-1.2.3 | (none) | tar: @name@-@version@:. | foo | 1.2.3 |
libssh2-1.11.0 | (none) | tar: libssh2-@version@:. | libssh2 | 1.11.0 |
release-2_0_4 | (none) | tar: release-@version@:. | foo | 2.0.4 |
V1.2.3 | (none) | (none) | foo | 1.2.3 |
20260514 | pattern = "{year:4}{month:2}{day:2}", template = "{year}.{month}.{day}" | (any) | foo | 2026.5.14 |
v1_11_0 | pattern = "v{major:+}_{minor:+}_{patch:+}", template = "{major}.{minor}.{patch}" | (any) | libssh2 | 1.11.0 |
Sandboxing¶
By default hooks run under hybrid sandbox (bubblewrap + hasher chroot) so a malicious or buggy hook can't read your ~/.ssh or ~/.gnupg. See Sandbox for details on the three runner modes and how to pick one.
Syntax highlighting¶
zoryn highlights log output using the sublime-syntax format. The built-in log.sublime-syntax (from bat) highlights log levels, dates, times, IP addresses, URLs, quoted strings, numbers, and key=value pairs.
Colour themes use the .tmTheme format (TextMate/Sublime Text compatible). The default theme is Monokai.
Custom files override the defaults:
| File | Purpose |
|---|---|
~/.config/zoryn/syntaxes/*.sublime-syntax | Custom syntax definitions |
~/.config/zoryn/theme.tmTheme | Custom colour theme |
Highlighting is active in:
zoryn build— log tail outputzoryn task log/zoryn task manage— TUI log viewer
Automatically disabled when output is not a TTY or NO_COLOR is set.
Environment¶
SSH aliases in ~/.ssh/config (generated by zoryn gen environment):