python-rpm-macros/brp-python-rpm-in-distinfo
Gordon Messmer a74d2bb5c9 Minor style fixes suggested by ShellCheck. Mostly, these consist
of preferring '[[' to '[' in bash scripts.  Other changes include
quoting unquoted variables, and explicitly specifying bash as the
interpreter for scripts that use features not defined in POSIX sh

Fixes SC2046, SC3001, and SC2292
2025-06-29 13:32:22 +00:00

15 lines
434 B
Bash
Executable file

#!/usr/bin/bash
set -eu
# If using normal root, avoid changing anything.
if [[ "${RPM_BUILD_ROOT:-/}" = "/" ]] ; then
exit 0
fi
find "$RPM_BUILD_ROOT" -name 'INSTALLER' -type f -print0|grep -z -E "/usr/lib(64)?/python3\.[0-9]+/site-packages/[^/]+\.dist-info/INSTALLER" | while read -d "" installer ; do
if cmp -s <(echo pip) "$installer" ; then
echo "rpm" > "$installer"
rm -f "$(dirname "$installer")/RECORD"
fi
done
exit 0