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
15 lines
434 B
Bash
Executable file
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
|