mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-08-12 11:49:53 +00:00
use local devtools configs instead of global ones
This commit is contained in:
@@ -7,16 +7,19 @@ usage() {
|
||||
echo "Usage: $cmd [options] -- [archbuild args]"
|
||||
echo " -r <repository> Repository name"
|
||||
echo " -a <architecture> Repository architecture"
|
||||
echo " -c <directory> Read devtools pacman configurations from this directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
repository=
|
||||
architecture=
|
||||
pacman_config_dir=
|
||||
|
||||
while getopts ":r:a:" arg; do
|
||||
while getopts ":r:a:c:" arg; do
|
||||
case "$arg" in
|
||||
r) repository="$OPTARG" ;;
|
||||
a) architecture="$OPTARG" ;;
|
||||
c) pacman_config_dir="$OPTARG" ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
@@ -28,6 +31,17 @@ fi
|
||||
source "/usr/share/devtools/lib/archroot.sh"
|
||||
check_root "SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,NPROC,MAKEFLAGS,PACKAGER,GNUPGHOME" "${BASH_SOURCE[0]}" "$@"
|
||||
|
||||
# because devtools doesn't allow to read configuration from custom path
|
||||
# here is a workaround, which uses unshare to bind-mount directory with configuration files
|
||||
# for specific process
|
||||
if [[ -n $pacman_config_dir && -z ${AHRIMAN_ARCHBUILD_MOUNTED:-} ]]; then
|
||||
export AHRIMAN_ARCHBUILD_MOUNTED=1
|
||||
exec unshare --mount --propagation private bash -e -c '
|
||||
mount --bind "$0" /usr/share/devtools/pacman.conf.d
|
||||
exec "$@"
|
||||
' "$(readlink -f "$pacman_config_dir")" "${BASH_SOURCE[0]}" "$@"
|
||||
fi
|
||||
|
||||
exec bash -c '
|
||||
source "$1" "${@:2}"
|
||||
' "${repository}-${architecture}-build" "archbuild" "${@:$OPTIND}"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[settings]
|
||||
; Relative path to directory with configuration files overrides. Overrides will be applied in alphabetic order.
|
||||
include = ahriman.ini.d $HOME/.config/ahriman.ini.d
|
||||
include = ahriman.ini.d ${repository:root}/.config/ahriman/ahriman.ini.d
|
||||
; Relative path to configuration used by logging package.
|
||||
logging = ahriman.ini.d/logging.ini
|
||||
; Perform database migrations on the application start. Do not touch this option unless you know what you are doing.
|
||||
@@ -34,6 +34,8 @@ retry_backoff = 1.0
|
||||
[build]
|
||||
; List of additional flags passed to archbuild command.
|
||||
;archbuild_flags =
|
||||
; Path to local directory with devtools configuration files, which will be bind-mounted for devtools.
|
||||
devtools_configs = ${repository:root}/.config/ahriman/pacman.conf.d
|
||||
; Path to build command.
|
||||
devtools_wrapper = ahriman-archbuild
|
||||
; List of packages to be ignored during automatic updates.
|
||||
|
||||
Reference in New Issue
Block a user