Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3c810e

Browse files
committed
Patch #892673: Replace /usr/local/bin/python with
/usr/bin/env python'%{binsuffix} Backported to 2.3.
1 parent a79449e commit d3c810e

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

Misc/RPM/python-2.3.spec

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#################################
3131

3232
%define name python
33-
%define version 2.3.2
33+
%define version 2.3.3
3434
%define libvers 2.3
3535
%define release 1pydotorg
3636
%define __prefix /usr
@@ -127,6 +127,11 @@ formats.
127127
%endif
128128

129129
%changelog
130+
* Sat Feb 07 2004 Sean Reifschneider <[email protected]> [2.3.3-2pydotorg]
131+
- Adding code to remove "#!/usr/local/bin/python" from particular files and
132+
causing the RPM build to terminate if there are any unexpected files
133+
which have that line in them.
134+
130135
* Mon Oct 13 2003 Sean Reifschneider <[email protected]> [2.3.2-1pydotorg]
131136
- Adding code to detect wether documentation is available to build.
132137

@@ -261,6 +266,38 @@ mkdir -p "$RPM_BUILD_ROOT"/var/www/html/python
261266
)
262267
%endif
263268

269+
# fix the #! line in installed files
270+
for file in \
271+
usr/lib/python2.3/Tools/scripts/parseentities.py \
272+
usr/lib/python2.3/cgi.py \
273+
usr/lib/python2.3/Tools/faqwiz/faqw.py
274+
do
275+
sed 's|^#!.*python|#!/usr/bin/env python'"%{binsuffix}"'|' \
276+
"$RPM_BUILD_ROOT"/"$file" >/tmp/fix-python-path.$$
277+
cat /tmp/fix-python-path.$$ >"$RPM_BUILD_ROOT"/"$file"
278+
rm -f /tmp/fix-python-path.$$
279+
done
280+
281+
# check to see if there are any straggling #! lines
282+
find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
283+
| grep ':1:#!' >/tmp/python-rpm-files.$$ || true
284+
if [ -s /tmp/python-rpm-files.$$ ]
285+
then
286+
echo '*****************************************************'
287+
cat /tmp/python-rpm-files.$$
288+
cat <<@EOF
289+
*****************************************************
290+
There are still files referencing /usr/local/bin/python in the
291+
install directory. They are listed above. Please fix the .spec
292+
file and try again. If you are an end-user, you probably want
293+
to report this to [email protected] as well.
294+
*****************************************************
295+
@EOF
296+
rm -f /tmp/python-rpm-files.$$
297+
exit 1
298+
fi
299+
rm -f /tmp/python-rpm-files.$$
300+
264301
########
265302
# CLEAN
266303
########

0 commit comments

Comments
 (0)