diff --git a/devel/container/containerbuild b/devel/container/containerbuild index 3ed12c0a..9bec6f04 100644 --- a/devel/container/containerbuild +++ b/devel/container/containerbuild @@ -3,4 +3,4 @@ set -e export LOGDEST=$PWD SRCPKGDEST=$PWD SRCDEST=$PWD PKGDEST=$PWD BUILDDIR=/build export BUILDTOOL=makecontainerbuild BUILDTOOLVER="0.0.1" chown builduser:builduser "$PWD" -sudo --preserve-env=LOGDEST,SRCPKGDEST,SRCDEST,PKGDEST,BUILDDIR,BUILDTOOL,BUILDTOOLVER --user builduser makepkg +sudo --preserve-env=LOGDEST,SRCPKGDEST,SRCDEST,PKGDEST,BUILDDIR,BUILDTOOL,BUILDTOOLVER --user builduser diff --git a/devel/container/makecontainerpkg b/devel/container/makecontainerpkg index 6039f9df..03a0774a 100755 --- a/devel/container/makecontainerpkg +++ b/devel/container/makecontainerpkg @@ -1,6 +1,11 @@ #!/bin/bash set -e +# make tool to invoke configurable via environment variable to be able to invoke +# other tools like `repo-add` or `updpkgsums` as well +tool=${TOOL:-makepkg} +[[ $tool == 'makepkg' ]] && single_run= no_sync= || single_run=1 no_sync=1 + # make basic arguments for cre if [[ $CONTAINER ]]; then name=$CONTAINER @@ -12,17 +17,17 @@ else pkgname=$(echo "$pkgname" | tr '+' 'p') fi uuid=$(cat /proc/sys/kernel/random/uuid) - name=makechrootpkg-$pkgname-$uuid + name=$tool-$pkgname-$uuid fi cre_args=(--name "$name" --workdir "/startdir" -v "$PWD":/startdir -it) # parse arguments -script_args= read_script_args= no_sync= single_run= +script_args= read_script_args= for arg in "$@"; do if [[ $read_script_args ]]; then if [[ $arg == '--nodeps' ]] || [[ $arg == '-d' ]]; then no_sync=1 - elif [[ $arg == '--printsrcinfo' ]]; then + elif [[ $arg == '--printsrcinfo' ]] || [[ $arg == '--help' ]] || [[ $arg == '-h' ]]; then no_sync=1 single_run=1 fi @@ -61,14 +66,14 @@ if ! [[ $CONTAINER ]]; then image=${CRE_IMAGE:-archlinux-base-devel} if [[ $single_run ]]; then "$cre" container run "${cre_args[@]}" "$image" bash \ - -c "$script_sync $script $script_args" || ec=$? + -c "$script_sync $script '$tool' $script_args" || ec=$? exit $ec fi "$cre" container create "${cre_args[@]}" "$image" "$cre" container start "$name" fi "$cre" container exec "$name" bash \ - -c "$script_sync $script $script_args" || ec=$? + -c "$script_sync $script '$tool' $script_args" || ec=$? # stop and remove container unless we want to keep it for debugging [[ $ec == 0 && $DEBUG == on-failure || -z $DEBUG ]] && \