brp-fix-pyc-reproducibility: suppress python2 files and errors
When %{py_reproducible_pyc_path} is used explicitly, then error our if
marshalparser returns an error. But when running in the automatic mode, only
warn. marshalparser fails for example for python2 pyc files.
Also, filter out the python2.7 directory. In Fedora, it's the major and only
source of python2 pyc files and it doesn't make much sense to try to do anything
with them.
This commit is contained in:
parent
c41028c137
commit
1cf0ae1d4e
1 changed files with 15 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue