Skip to content
zoryn/ maintainer-assistant

Hooks

zoryn runs per-package shell scripts from two directories during zoryn up:

DirectoryWhen 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:

SymbolMeaning
$1Clean version derived from $TAG (prefix stripped — see below)
$TAGFull upstream tag name as it exists in git (e.g. v1.2.3, release-1.2.3)
$COMMITFull SHA1 of the commit that $TAG resolves to
$SHORTCOMMITFirst 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:

#!/bin/bash
# $1 = "1.2.3", $TAG = "v1.2.3"
go mod vendor

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

SymbolMeaning
$1The 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:

#!/bin/bash
sed -i "s/VERSION=.*/VERSION=$1/" configure.ac

How $1 is derived from $TAG

$1 is computed from $TAG in four tiers (first match wins):

  1. .gear/version-up [version] mapping. If the file declares a pattern / template (and optionally strip-prefix, filter), the tag is parsed with that DSL and $1 is the rendered template. See [version] in configuration. This always wins if the pattern matches.
  2. Explicit prefix from .gear/rules. If .gear/rules contains tar: <prefix>@version@:. (e.g. tar: v@version@:. or tar: libssh2-@version@:.), <prefix> is stripped from $TAG.
  3. Package-name prefix. If $TAG starts with <pkg-name>- (the name from Name: in the spec), that prefix is stripped.
  4. v/V prefix. A leading v or V is 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/rulesSpec Name:$1
v1.2.3(none)tar: v@version@:.foo1.2.3
1.2.3(none)tar: @name@-@version@:.foo1.2.3
foo-1.2.3(none)tar: @name@-@version@:.foo1.2.3
libssh2-1.11.0(none)tar: libssh2-@version@:.libssh21.11.0
release-2_0_4(none)tar: release-@version@:.foo2.0.4
V1.2.3(none)(none)foo1.2.3
20260514pattern = "{year:4}{month:2}{day:2}", template = "{year}.{month}.{day}"(any)foo2026.5.14
v1_11_0pattern = "v{major:+}_{minor:+}_{patch:+}", template = "{major}.{minor}.{patch}"(any)libssh21.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:

FilePurpose
~/.config/zoryn/syntaxes/*.sublime-syntaxCustom syntax definitions
~/.config/zoryn/theme.tmThemeCustom colour theme

Highlighting is active in:

Automatically disabled when output is not a TTY or NO_COLOR is set.

Environment

SSH aliases in ~/.ssh/config (generated by zoryn gen environment):

Host gitery
    HostName gitery.altlinux.org
    Port 222
    User alt_username

Host gyle
    HostName gyle.altlinux.org
    Port 222
    User alt_username