Skip to content

Commit

Permalink
Add NOCHECK and DEBUG options to repro
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxboron committed May 1, 2020
1 parent b739737 commit e179bb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/repro.conf.5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down
7 changes: 4 additions & 3 deletions repro.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e179bb7

Please sign in to comment.