diff --git a/docs/repro.conf.5.txt b/docs/repro.conf.5.txt index 4907f8e..6747a53 100644 --- a/docs/repro.conf.5.txt +++ b/docs/repro.conf.5.txt @@ -47,6 +47,8 @@ Options **ARCH_ARCHIVE_CACHE=**"https://archive.archlinux.org/packages":: Configure the archive mirror to use when downloading archived packages. +**NOCHECK=**0:: + Decide if makepkg should be run with or without --nocheck inside the container. See Also -------- diff --git a/repro.in b/repro.in index d272749..7d46688 100755 --- a/repro.in +++ b/repro.in @@ -21,15 +21,16 @@ trap "{ rm -r $IMGDIRECTORY; }" EXIT DIFFOSCOPE="diffoscope" # Turn on/off check in repro -NOCHECK=0 +NOCHECK=${NOCHECK:-0} # Desc: Escalates privileges orig_argv=("$0" "$@") src_owner=${SUDO_USER:-$USER} function check_root() { + local keepenv=$1 (( EUID == 0 )) && return if type -P sudo >/dev/null; then - exec sudo -- "${orig_argv[@]}" + exec sudo --preserve-env=$keepenv -- "${orig_argv[@]}" else exec su root -c "$(printf ' %q' "${orig_argv[@]}")" fi @@ -422,7 +423,7 @@ done # Save command args (such as path to .pkg.tar.xz file) shift $((OPTIND-1)) -check_root +check_root NOCHECK,MAKEFLAGS,DEBUG init_gnupg test -d "$BUILDDIRECTORY"/root || get_bootstrap_img init_chroot