feat: get rid of sudoers modification during setup command

This commit introduces small shell wrapper, which calls archbuild
mimicing symlinked command. It allows to distribute static sudoers file.

Additionally build_command option has been renamed to devtools_wrapper
in order to allow to keep backward compatibility
This commit is contained in:
2026-08-09 17:37:38 +03:00
parent 9c3d1471e0
commit e182e110d4
18 changed files with 123 additions and 160 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
set -euo pipefail
usage() {
local cmd="${0##*/}"
echo "Usage: $cmd [options] -- [archbuild args]"
echo " -r <repository> Repository name"
echo " -a <architecture> Repository architecture"
exit 1
}
repository=
architecture=
while getopts ":r:a:" arg; do
case "$arg" in
r) repository="$OPTARG" ;;
a) architecture="$OPTARG" ;;
*) usage ;;
esac
done
if [[ -z $repository || -z $architecture ]]; then
usage
fi
source "/usr/share/devtools/lib/archroot.sh"
check_root "SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,NPROC,MAKEFLAGS,PACKAGER,GNUPGHOME" "${BASH_SOURCE[0]}" "$@"
exec bash -c '
source "$1" "${@:2}"
' "${repository}-${architecture}-build" "archbuild" "${@:$OPTIND}"
@@ -35,7 +35,7 @@ retry_backoff = 1.0
; List of additional flags passed to archbuild command.
;archbuild_flags =
; Path to build command.
;build_command =
devtools_wrapper = ahriman-archbuild
; List of packages to be ignored during automatic updates.
;ignore_packages =
; Include debug packages.