rpm-build/scripts/brp-hardlink_pyo_pyc.in
Vitaly Kuznetsov ca5b17e03c introduce brp-hardlink_pyo_pyc (splitted from brp-bytecompile_python)
Hardlinking identical .pyo and .pyc files splitted from brp-bytecompile_python to
brp-hardlink_pyo_pyc to make this brp work for python3 files (generated by separate
brp-bytecompile_python3).
2012-01-25 14:23:12 +00:00

19 lines
331 B
Bash
Executable File

#!/bin/sh -e
#
# brp-hardlink_pyo_pyc - hardlink identical .pyc and .pyo files.
#
. @RPMCONFIGDIR@/functions
ValidateBuildRoot
cd "$RPM_BUILD_ROOT"
echo "Hardlinking identical .pyc and .pyo files"
find -type f -name '*.pyc' |
while read -r pyc; do
pyo=${pyc%c}o
if cmp -s "$pyc" "$pyo"; then
ln -f -v "$pyc" "$pyo"
fi
done