Autodist
Autodist is a batch build and distribution management suite for the openmamba RPM-based Linux distribution.
Table of Contents
Prerequisites and configuration
All scripts source /etc/autodist/config at startup, which defines the core environment variables:
| Variable | Description |
|---|---|
AUTODIST_ARCHS |
Supported architectures (e.g. i586 x86_64) |
AUTODIST_REPOSITORIES_LOCAL_REPS |
Available local repositories |
AUTODIST_REPOSITORIES_REMOTE_REPS |
Available remote repositories |
LOCAL_REPS_BASE_DIR |
Base directory for local repositories (default: /var/autodist) |
AUTOBUILD_MAXNUM |
Maximum number of batch builds |
AUTOBUILD_SKIP_DAYS |
Days to wait before retrying a failed build |
The file /var/autodist/.autospec holds FTP/HTTPS credentials and repository URLs used for package upload.
autodist-git additionally requires /etc/autodist/config-git in ConfigObj format, containing:
GITEA_URL, GITEA_TOKEN, GITEA_ORGANIZATION, REPO_DIR, ARCHIVE_DIR, SRPMS_DIR, COMMITTER_USER, COMMITTER_EMAIL.
Tools
autodist
Main batch build orchestrator. Reads job/package lists from distdb and invokes autospec through the prepare, update, build, and send pipeline for each package.
autodist [operations ...] [options ...] [job ...] [-- autospec_args] [--- script_args]
Operations
| Option | Description |
|---|---|
-a, --autobuild |
Start full batch build (implies -p -u -b -s --severity 1) |
-p, --prepare |
Prepare packages (download sources and prepare for update) |
-u, --update |
Update packages (bump version in spec file) |
-b, --build |
Build packages via rpmbuild |
-i, --install |
Install packages on the local system |
-s, --send |
Send packages to the repository via FTP/HTTPS |
--list-jobs |
List configured jobs from distdb |
--list-pkgs job |
List packages for the specified job |
Options
| Option | Description |
|---|---|
-c, --cleanlogs |
Clean all logs before starting |
-d, --debug |
Enable debug output |
-h, --help |
Print help and exit |
-t, --test |
Simulate execution without running programs |
-q, --quiet |
Quiet mode (suppress tail of error logs) |
-r, --rebuild |
Force package rebuild |
-v, --verbose |
Verbose output |
--force |
Pass --force to autospec |
--repository REP |
Use the given repository as base for operations |
--repository-strict |
Only prepare packages from the repository specified with --repository |
--server NUM |
Pass the given server number to autospec for the send operation |
--severity NUM |
Error handling level: 0=don't stop, 1=skip current job (default), 2=abort |
--arch ARCH |
Build packages for the specified target architecture |
--user USER |
Calling user name for Webbuild social messages |
--rebuild-srpms |
Rebuild SRPMs when sending |
Specifying jobs
autodist -b glibc#2.11.1 # build glibc at version 2.11.1
autodist -b kernel-extra # build the kernel-extra job
autodist -b kernel-packages/lirc # build lirc package within the kernel-packages job
Build logs are written to /var/autodist/log/.
autodist-tool
Helper for patch creation, job scheduling, and skipping.
autodist-tool makepatch package [auto|build|update|remove]
autodist-tool schedule [job_regexp]
autodist-tool unschedule [job_regexp]
autodist-tool skip job_regexp
Commands
| Command | Description |
|---|---|
makepatch package |
Show existing patches for the package |
makepatch package auto |
Automatically create the appropriate patch (update or build) based on current state |
makepatch package build |
Create a patch for the build phase |
makepatch package update |
Create a patch for the update phase |
makepatch package remove |
Remove all patches for the package |
schedule |
List manually scheduled jobs |
schedule job |
Schedule a job for automatic update or rebuild |
unschedule |
List scheduled jobs |
unschedule job |
Remove a job from the manual schedule |
skip job |
Exclude a job from automatic builds |
Patches are stored under autoupdate/spec-patches-update/ and autoupdate/spec-patches-build/, and if configured, synchronized to the remote repository via curl.
autodist-repository
RPM repository management: archiving, importing, releasing, verifying, searching, and more.
autodist-repository archive REPOSITORY PKGS ...
autodist-repository diff REPOSITORY [PKGS ...] [-d REPOSITORY]
autodist-repository distromatic REPOSITORY
autodist-repository import REPOSITORY [PKGS ...] [-d REPOSITORY] [-s] [-y]
autodist-repository inspect REPOSITORY PKGS ... [-d REPOSITORY]
autodist-repository install REPOSITORY [PKGS ...] [-f]
autodist-repository list
autodist-repository query REPOSITORY PKGS ...
autodist-repository release REPOSITORY [PKGS ...] [-d REPOSITORY] [-s] [-y]
autodist-repository restore REPOSITORY PKGS ...
autodist-repository search [-i] [-r regexp] STRING
autodist-repository setwarning REPOSITORY PKG ... -t "TEXT"
autodist-repository verify REPOSITORY [PKGS ...]
Commands
| Command | Description |
|---|---|
archive REP PKGS |
Archive the specified packages (backup to the old/ directory) |
diff REP [PKGS] |
Show differences between packages across two repositories (spec, requires, provides, files) |
distromatic REP |
Extract spec files from SRPMs for the distromatic repository |
import REP [PKGS] |
Import packages from one repository to another (with backup of the previous version) |
inspect REP PKGS |
Show spec, requires, and provides of a package in the repository |
install REP [PKGS] |
Install packages from the local repository onto the system |
list |
List available repositories |
query REP PKGS |
Show detailed information about a package in the repository |
release REP [PKGS] |
Release packages from one repository to another (no backup of the original) |
restore REP PKGS |
Restore a package from a backup in the old/ directory |
search STRING |
Search for a package by name across all repositories |
setwarning REP PKGS -t "TEXT" |
Set a warning message for a package in distromatic |
verify REP [PKGS] |
Verify the integrity of RPM and SRPM files in the repository |
Options
| Option | Description |
|---|---|
-d REPOSITORY |
Destination repository (default: base) |
-f |
Force the operation |
-i |
Case-insensitive search (with search only) |
-r REGEXP |
Filter repositories matching the given regular expression (with search only) |
-s |
Simulation mode (no changes made) |
-t "TEXT" |
Warning message text (with setwarning only) |
-y |
Assume yes to all questions (use with care) |
autodist-inspect
Quick package lookup across distromatic sources, distdb, the legacy list, and all local repositories.
autodist-inspect <package_name>
Output is organized in sections: distromatic sources, distdb, legacy, and for each local repository the matching SRPMs and RPMs.
autodist-upstream-updates
Checks for upstream package version updates by querying Repology and other sources, and generates the list of packages that need to be updated.
autodist-upstream-updates [-h|-m] [-s] [-u] [-q] [-r repository] [-o repository]
Options
| Option | Description |
|---|---|
-h |
Generate distromatic-compatible HTML output |
-m |
Report missing packages only |
-s |
Skip fetching and parsing upstream updates (use cached data) |
-u |
Output not-up-to-date packages only |
-q |
Quiet output |
-r REPOSITORY |
Distromatic base repository (default: base) |
-o REPOSITORY |
Repository for output data (default: same as -r) |
Results are written to autoupdate/upstream-updates.in (list of packages to update) and autoupdate/upstream-updates.missing (upstream packages not present in the repository).
autodist-git
Syncs RPM package releases to a Gitea instance. Creates or updates a git repository for each package, commits spec files and patches, and creates a tag for each release.
Requires /etc/autodist/config-git with valid Gitea credentials.
Package names containing + are mapped to Plus (e.g. gtk++ → gtkPlusPlus) since + is not valid in git repository names.
autodist-git [-v] <command> [options]
Commands
| Command | Description |
|---|---|
syncpkg PKGNAME [PKGVER] |
Sync a single package to Gitea |
archiverepo PKGNAME |
Archive the Gitea repository for a package |
syncrepo |
Sync the entire base repository to Gitea |
Global options
| Option | Description |
|---|---|
-v, --verbose |
Verbose output |
syncpkg options
| Option | Description |
|---|---|
-d, --delete |
Delete and recreate the existing repository |
syncrepo options
| Option | Description |
|---|---|
--from PKGNAME |
Start synchronization from this package name |
--to PKGNAME |
Stop synchronization at this package name |
-d, --delete |
Delete and recreate existing repositories |
autodist-launcher
Daemon wrapper with PID-file locking for starting autodist in a controlled way from cron or a system service.
autodist-launcher <autodist_conf>
autodist_conf is the configuration index defined in /etc/autodist/autoport (via AUTOPORT_* arrays). Prevents duplicate instances by checking a PID file under /run/autodist/. Before starting the build it automatically runs:
- distromatic update and srcpkglist generation
- Remote metadata fetch via
rclone autodist-upstream-updatesautodist -a --server ...
autodist-distroquery
Distroquery API helper used by autodist-repository to query the distroquery REST API and output bash-compatible variable assignments for use with eval. Not normally invoked directly by users.
autodist-distroquery package REPO PKG [ARCH]
autodist-distroquery repository REPO
DISTROQUERY_API_URL is read directly from /etc/autodist/config; the script exits with an error if the variable is not set or empty.
Commands
| Command | Description |
|---|---|
package REPO PKG [ARCH] |
Query GET /package/{repo}/{pkg} and output pkg_name, pkg_version, pkg_release, pkg_summary, pkg_group, pkg_license, pkg_url, pkg_description, pkg_size, pkg_buildtime, pkg_arch, pkg_archs, pkg_builds. The effective RPM arch (e.g. noarch) is resolved via a secondary call to GET /package/{repo}/{binarypackage}/{arch} |
repository REPO |
Query GET /repository/{repo} and output pkg_list with all source package names |
Activated by setting DISTROQUERY_API_URL in /etc/autodist/config.
autodist-cleanold
Periodic cleanup of stale build artifacts from build, source, RPMS, and SRPMS directories. Takes no command-line arguments; age thresholds are read from /etc/autodist/config.
Relevant configuration variables:
| Variable | Description |
|---|---|
RPMS_CTIME_OLD |
Minimum age in days before removing old RPMs |
SRPMS_CTIME_OLD |
Minimum age in days before removing old SRPMs |
SOURCES_CTIME_OLD |
Minimum age before removing source files |
SOURCES_ARCHIVES_CTIME_OLD |
Minimum age before removing source archives (tar.xz, tar.bz2, tar.gz) |
SOURCES_PATCH_CTIME_OLD |
Minimum age before removing source patches |
BUILD_CTIME_OLD |
Minimum age before removing build directories |
TMP_CTIME_OLD |
Minimum age before removing temporary files |
Also handles cleanup inside autoport chroot environments and clears ccache and yarn caches.
autodist-vercmp
RPM EVR (Epoch:Version-Release) version comparison using the standard RPM algorithm. Compatible with both Python 2 and Python 3.
autodist-vercmp <EVR1> <EVR2>
autodist-vercmp <epoch1> <ver1> <release1> <epoch2> <ver2> <release2>
autodist-vercmp # interactive mode (prompts for input)
Exit codes
| Code | Meaning |
|---|---|
0 |
Versions are equal |
11 |
First version is newer |
12 |
Second version is newer |
automaint
Automatic batch repository maintenance. Compares package versions between a staging/source repository and a destination repository, automatically importing updated packages.
automaint -s SOURCE_REPOSITORY -d DEST_REPOSITORY [-p PORT_REPOSITORY] [-t] [-v] [-h]
Options
| Option | Description |
|---|---|
-s REPOSITORY |
Source (staging/autobuild) repository |
-d REPOSITORY |
Main destination repository |
-p REPOSITORY |
Porting repository |
-t |
Test mode (no changes made) |
-v |
Verbose output |
-h |
Show help and exit |
Imports are performed only for safe updates (minor version bumps, release increments); major version upgrades and dubious beta versions are skipped.
autoport-chroot
Access to cross-arch chroot environments for building packages on architectures different from the host.
autoport-chroot <chroot_target> [command [args...]]
- If a command is specified, it is executed inside the chroot as the configured user.
- If no command is given, an interactive shell is opened inside the chroot.
Chroot environments are defined in /etc/autodist/autoport via the AUTOPORT_CHROOT, AUTOPORT_ARCH, and AUTOPORT_CHROOT_USER arrays. On x86_64 hosts, chroots for 32-bit architectures are automatically started with linux32.
distdb job format
Jobs are defined as Bash arrays in distdb files under /etc/autodist/distdb.d/:
# job_name=(packages %flag1,%flag2,...)
qt6=(qt6-qtbase,qt6-qt3d %build_and_install,%continue_on_error)
- Packages are comma-separated in the first array element.
- Flags in the second element control build behaviour.
Key runtime paths
| Path | Content |
|---|---|
/etc/autodist/config |
Main configuration sourced by all Bash scripts |
/etc/autodist/config-git |
autodist-git configuration (Gitea credentials and paths) |
/etc/autodist/distdb |
Main distribution database |
/etc/autodist/distdb.d/ |
Distribution database fragments (.db files) |
/etc/autodist/blacklist |
Packages excluded from automatic updates |
/var/autodist/.autospec |
FTP credentials and repository URLs for package upload |
/var/autodist/RPM/SPECS/ |
RPM spec files (~5,000+) |
/var/autodist/log/ |
Build, update, prepare, and send logs |
/var/autodist/{repo}/ |
Per-repository state (distdb, srcpkglist, metadata) |
/var/autodist/{repo}/autoupdate/ |
Scheduling files, spec patches, upstream update lists |
/var/autodist/distromatic/ |
Generated repository metadata |
/run/autodist/ |
PID files for autodist-launcher and autodist |
RPM spec conventions
- The
Releasefield uses theNmambasuffix (e.g.4mamba). AUTOBUILDREQ-BEGIN/AUTOBUILDREQ-ENDblocks are auto-managed byautospec— never edit between them manually.VendorandDistributionare set toopenmamba.
License
Copyright (C) 2006-2026 Silvan Calarco <silvan.calarco@mambasoft.it> Released under the terms of the GNU GPL version 3.