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

Skip to content

Commit 7caafe7

Browse files
author
Sean Reifschneider
committed
Changing the idle wrapper to use Python and execvp() to pass arguments to
idle.
1 parent 6065d32 commit 7caafe7

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Misc/RPM/python-2.4.spec

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
%define name python
3636
%define version 2.4
3737
%define libvers 2.4
38-
%define release 1pydotorg
38+
%define release 2pydotorg
3939
%define __prefix /usr
4040

4141
# kludge to get around rpm <percent>define weirdness
@@ -131,6 +131,9 @@ formats.
131131
%endif
132132

133133
%changelog
134+
* Mon Dec 20 2004 Sean Reifschneider <[email protected]> [2.4-2pydotorg]
135+
- Changing the idle wrapper so that it passes arguments to idle.
136+
134137
* Tue Oct 19 2004 Sean Reifschneider <[email protected]> [2.4b1-1pydotorg]
135138
- Updating to 2.4.
136139

@@ -257,8 +260,11 @@ fi
257260

258261
########
259262
# Tools
260-
echo '#!/bin/bash' >${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
261-
echo 'exec %{__prefix}/bin/python%{binsuffix} %{__prefix}/%{libdirname}/python%{libvers}/idlelib/idle.py' >>$RPM_BUILD_ROOT%{__prefix}/bin/idle%{binsuffix}
263+
echo '#!%{__prefix}/bin/env python%{binsuffix}' >${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
264+
echo 'import os, sys' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
265+
echo 'os.execvp("%{__prefix}/bin/python%{binsuffix}", ["%{__prefix}/bin/python%{binsuffix}", "%{__prefix}/lib/python%{libvers}/idlelib/idle.py"] + sys.argv[1:])' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
266+
echo 'print "Failed to exec Idle"' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
267+
echo 'sys.exit(1)' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
262268
chmod 755 $RPM_BUILD_ROOT%{__prefix}/bin/idle%{binsuffix}
263269
cp -a Tools $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers}
264270

0 commit comments

Comments
 (0)