diff --git a/brp-fix-pyc-reproducibility b/brp-fix-pyc-reproducibility index 95e481b..c6c674d 100644 --- a/brp-fix-pyc-reproducibility +++ b/brp-fix-pyc-reproducibility @@ -26,4 +26,18 @@ fi # Set pipefail so if $path_to_fix does not exist, the build fails set -o pipefail -find "$path_to_fix" -type f -name "*.pyc" -print0 | xargs -0 /usr/bin/marshalparser --fix --overwrite + +extra=() +if [ -n "$automatic" ]; then + extra+=(-name "python2.7" -prune -o) +fi + +# Unset -e so that we can collect the return code below +set +e +find "$path_to_fix" "${extra[@]}" -type f -name "*.pyc" -print0 | xargs -0 /usr/bin/marshalparser --fix --overwrite +ret=$? +if [ "$ret" -eq 123 ]; then + echo "WARNING: some marshalparser invocations failed" + [ -n "$automatic" ] && exit 0 +fi +exit $ret