Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 1499 - python should include python<major> binary/symlink
Summary: python should include python<major> binary/symlink
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Karl Trygve Kalleberg (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-03 10:42 UTC by Jon Nelson (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Nelson (RETIRED) 2002-04-03 10:42:34 UTC
Traditionally, python provides /usr/bin/python <- currently installed version,
usually a symlink to /usr/bin/python<major>, where <major> is the major number
of the release.  Often there exists as well a python<major>.<minor> when
multiple versions of python are installed. Thus, if one had python1.5.2,
python2.0, and python2.2 installed (with python2.2 the default):

/usr/bin/python -> /usr/bin/python2
/usr/bin/python2 -> /usr/bin/python2.2
/usr/bin/python2.2
/usr/bin/python1.5
/usr/bin/python2.0

Would all exist.
Comment 1 Jon Nelson (RETIRED) 2002-04-09 18:25:03 UTC
May I suggest the following addition as well?
(Which results in:

/usr/bin/python -> /usr/bin/python2
/usr/bin/python2 -> /usr/bin/python2.2
/usr/bin/python2.2


--- python-2.2-r5.ebuild        Mon Apr  8 07:36:57 2002
+++ python-2.2-r6.ebuild        Tue Apr  9 18:29:55 2002
@@ -3,7 +3,8 @@
 # Maintainer: Daniel Robbins <drobbins@gentoo.org>
 # $Header: /home/cvsroot/gentoo-x86/dev-lang/python/python-2.2-r5.ebuild,v 1.4 
2002/04/08 12:36:57 jhhudso Exp $
 
-PYVER="`echo ${PV} | cut -d '.' -f 1,2`"
+PYVER_MAJOR="`echo ${PV} | cut -d '.' -f 1`"
+PYVER_MINOR="`echo ${PV} | cut -d '.' -f 2`"
 S=${WORKDIR}/Python-${PV}
 FCHKSUM="python-fchksum-1.6"
 FCHKSUMP="python-fchksum_1.6-2"
@@ -123,8 +124,9 @@
 src_install() {
        dodir /usr
        make install prefix=${D}/usr || die
-       rm "${D}/usr/bin/python"
-       dosym python${PYVER} /usr/bin/python
+       rm "${D}/usr/bin/python"
+       dosym python${PYVER_MAJOR} /usr/bin/python
+       dosym python${PYVER_MAJOR}.${PYVER_MINOR} /usr/bin/python${PYVER_MAJOR}
        dodoc README
 
        # install our own custom python-config