feat(makerepropkg): Add option to skip running check for speedup
Add -n to allow running makepkg with --nocheck. This is useful to reduce the time required to reproduce a package, as they should not depend on running the check function for being reproducible. Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
parent
cc369e86d2
commit
ae14c246b8
|
@ -42,6 +42,7 @@ complete -F _makechrootpkg makechrootpkg
|
||||||
_makerepropkg_args=(
|
_makerepropkg_args=(
|
||||||
-h
|
-h
|
||||||
-d
|
-d
|
||||||
|
-n
|
||||||
-c
|
-c
|
||||||
-M
|
-M
|
||||||
)
|
)
|
||||||
|
|
|
@ -230,6 +230,7 @@ _offload_build_args=(
|
||||||
|
|
||||||
_makerepropkg_args=(
|
_makerepropkg_args=(
|
||||||
'-d[Run diffoscope if the package is unreproducible]'
|
'-d[Run diffoscope if the package is unreproducible]'
|
||||||
|
'-n[Do not run the check() function in the PKGBUILD]'
|
||||||
'-c[Set pacman cache]:pacman_cache:_files -/'
|
'-c[Set pacman cache]:pacman_cache:_files -/'
|
||||||
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
|
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
|
||||||
'-h[Display usage]'
|
'-h[Display usage]'
|
||||||
|
|
|
@ -42,6 +42,9 @@ Options
|
||||||
*-d*::
|
*-d*::
|
||||||
If packages are not reproducible, compare them using diffoscope.
|
If packages are not reproducible, compare them using diffoscope.
|
||||||
|
|
||||||
|
*-n*::
|
||||||
|
Do not run the check() function in the PKGBUILD.
|
||||||
|
|
||||||
*-c*::
|
*-c*::
|
||||||
Set the pacman cache directory.
|
Set the pacman cache directory.
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ declare -a buildenv buildopts installed installpkgs
|
||||||
archiveurl='https://archive.archlinux.org/packages'
|
archiveurl='https://archive.archlinux.org/packages'
|
||||||
buildroot=/var/lib/archbuild/reproducible
|
buildroot=/var/lib/archbuild/reproducible
|
||||||
diffoscope=0
|
diffoscope=0
|
||||||
|
makepkg_options=()
|
||||||
|
|
||||||
chroot=$USER
|
chroot=$USER
|
||||||
[[ -n ${SUDO_USER:-} ]] && chroot=$SUDO_USER
|
[[ -n ${SUDO_USER:-} ]] && chroot=$SUDO_USER
|
||||||
|
@ -116,6 +117,7 @@ For more details see https://reproducible-builds.org/
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-d Run diffoscope if the package is unreproducible
|
-d Run diffoscope if the package is unreproducible
|
||||||
|
-n Do not run the check() function in the PKGBUILD
|
||||||
-c <dir> Set pacman cache
|
-c <dir> Set pacman cache
|
||||||
-M <file> Location of a makepkg config file
|
-M <file> Location of a makepkg config file
|
||||||
-l <chroot> The directory name to use as the chroot namespace
|
-l <chroot> The directory name to use as the chroot namespace
|
||||||
|
@ -128,9 +130,10 @@ __EOF__
|
||||||
# save all args for check_root
|
# save all args for check_root
|
||||||
orig_args=("$@")
|
orig_args=("$@")
|
||||||
|
|
||||||
while getopts 'dM:c:l:h' arg; do
|
while getopts 'dnM:c:l:h' arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
d) diffoscope=1 ;;
|
d) diffoscope=1 ;;
|
||||||
|
n) makepkg_options+=(--nocheck) ;;
|
||||||
M) archroot_args+=(-M "$OPTARG") ;;
|
M) archroot_args+=(-M "$OPTARG") ;;
|
||||||
c) cache_dirs+=("$OPTARG") ;;
|
c) cache_dirs+=("$OPTARG") ;;
|
||||||
l) chroot="$OPTARG" ;;
|
l) chroot="$OPTARG" ;;
|
||||||
|
@ -254,7 +257,7 @@ install -d -o "${SUDO_UID:-$UID}" -g "$(id -g "${SUDO_UID:-$UID}")" "${namespace
|
||||||
arch-nspawn "${namespace}/build" \
|
arch-nspawn "${namespace}/build" \
|
||||||
--bind="${PWD}:/startdir" \
|
--bind="${PWD}:/startdir" \
|
||||||
--bind="${SRCDEST}:/srcdest" \
|
--bind="${SRCDEST}:/srcdest" \
|
||||||
/chrootbuild -C --noconfirm --log --holdver --skipinteg
|
/chrootbuild -C --noconfirm --log --holdver --skipinteg "${makepkg_options[@]}"
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
||||||
if (( ${ret} == 0 )); then
|
if (( ${ret} == 0 )); then
|
||||||
|
|
Loading…
Reference in New Issue