summaryrefslogtreecommitdiff
path: root/makerepropkg.in
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2019-12-08 15:07:00 -0500
committerLevente Polyak <anthraxx@archlinux.org>2020-02-27 14:49:54 +0100
commit51842a16769e63cd5a2eee5b540b903bf5eba1e5 (patch)
treeb572a21af857cc074553bd49da27cf1e192dff77 /makerepropkg.in
parent53fe5c67a121a993666dfbef98eaba1c27a882c8 (diff)
downloaddevtools32-51842a16769e63cd5a2eee5b540b903bf5eba1e5.tar.xz
makerepropkg: support checking multiple split packages
By specifying multiple package files, we assume they are all from the same PKGBUILD, and try to check them all against the produced artifacts. Since the buildinfo should be comparable for all of them, we simply use the first one passed on the command line. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'makerepropkg.in')
-rwxr-xr-xmakerepropkg.in40
1 files changed, 23 insertions, 17 deletions
diff --git a/makerepropkg.in b/makerepropkg.in
index 674f624..bd064a4 100755
--- a/makerepropkg.in
+++ b/makerepropkg.in
@@ -117,10 +117,13 @@ check_root
if [[ -n $1 ]]; then
pkgfile="$1"
- if ! bsdtar -tqf "${pkgfile}" .BUILDINFO >/dev/null 2>&1; then
- error "file is not a valid pacman package: '%s'" "${pkgfile}"
- exit 1
- fi
+ splitpkgs=("$@")
+ for f in "${splitpkgs[@]}"; do
+ if ! bsdtar -tqf "${f}" .BUILDINFO >/dev/null 2>&1; then
+ error "file is not a valid pacman package: '%s'" "${f}"
+ exit 1
+ fi
+ done
else
error "no package file specified. Try '${BASH_SOURCE[0]##*/} -h' for more information. "
exit 1
@@ -176,23 +179,26 @@ arch-nspawn "${buildroot}/${chroot}" \
--bind="${PWD}:/startdir" \
--bind="${SRCDEST}:/srcdest" \
/chrootbuild -C --noconfirm --log --holdver --skipinteg
+ret=$?
-if (( $? == 0 )); then
+if (( ${ret} == 0 )); then
msg2 "built succeeded! built packages can be found in ${buildroot}/${chroot}/pkgdest"
msg "comparing artifacts..."
- comparefiles=("${pkgfile}" "${buildroot}/${chroot}/pkgdest/${pkgfile##*/}")
- if cmp -s "${comparefiles[@]}"; then
- msg2 "Package successfully reproduced!"
- exit 0
- else
- warning "Package is not reproducible. :("
- sha256sum "${comparefiles[@]}"
- if (( diffoscope )); then
- diffoscope "${comparefiles[@]}"
+ for pkgfile in "${splitpkgs[@]}"; do
+ comparefiles=("${pkgfile}" "${buildroot}/${chroot}/pkgdest/${pkgfile##*/}")
+ if cmp -s "${comparefiles[@]}"; then
+ msg2 "Package '%s' successfully reproduced!" "${pkgfile}"
+ else
+ ret=1
+ warning "Package '%s' is not reproducible. :(" "${pkgfile}"
+ sha256sum "${comparefiles[@]}"
+ if (( diffoscope )); then
+ diffoscope "${comparefiles[@]}"
+ fi
fi
- fi
+ done
fi
-# the package either failed to build, or was unreproducible
-exit 1
+# return failure from chrootbuild, or the reproducibility status
+exit ${ret}