ca5b17e03c
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).
19 lines
331 B
Bash
Executable File
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
|