Blame SOURCES/brp-fix-pyc-reproducibility

396caf
#!/bin/bash -e
396caf
396caf
# If using normal root, avoid changing anything.
396caf
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
396caf
  exit 0
396caf
fi
396caf
396caf
# Defined as %py_reproducible_pyc_path macro and passed here as
396caf
# the first command-line argument
396caf
path_to_fix=$1
396caf
396caf
# First, check that the parser is available:
396caf
if [ ! -x /usr/bin/marshalparser ]; then
396caf
  echo "ERROR: If %py_reproducible_pyc_path is defined, you have to also BuildRequire: /usr/bin/marshalparser !"
396caf
  exit 1
396caf
fi
396caf
396caf
find "$path_to_fix" -type f -name "*.pyc" | xargs /usr/bin/marshalparser --fix --overwrite