Bug 36353 - lang/python{15,20,21} stomps on man pg, bin/* from lang/python
Summary: lang/python{15,20,21} stomps on man pg, bin/* from lang/python
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Thomas Gellekum
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-27 01:20 UTC by Alan E
Modified: 2002-04-26 11:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan E 2002-03-27 01:20:01 UTC
The old-python ports overwrite the man page and binaries from current python.
I have called this a bug because blowing away files from another port *is* a
bug, when there is no reason for the ports to be mutually-exclusive.

Fix: 

Do not install bin/py{thon,doc}. Patch the dist Makefile(s) to install the
man page with a {15,20,21} suffix.

I'll follow up with actual patches.

I want to get this in the system to get maintainer feedback, plus
feedback from maintainers of ports that fixing this is probably going
to break.

Any ports which require an old python?? explicitly (e.g., Zope) will break.
In particular, this affects the following ports:

databases/zpygresqlda/Makefile:PYTHON_VERSION=        python1.5
mail/mahogany/Makefile:PYTHON_VERSION=                python1.5
print/py-fonttools/Makefile:PYTHON_VERSION=   python2.1
textproc/py-asv/Makefile:PYTHON_VERSION=      python2.1
www/pyweblib/Makefile:PYTHON_VERSION= python2.1
www/zope/Makefile:PYTHON_VERSION=     python2.1

Maintainer of zope, arguably the most "important" port affected by this,
is on the Cc: list.
Comment 1 Alan Eldridge 2002-03-27 01:28:23 UTC
In general I think that two ports that can coexist, should. File
stomping is not excusable. In particular, I should be able to have zope,
python21, and python all installed at the same time, without conflicts.
Comment 2 Pete Fritchman freebsd_committer freebsd_triage 2002-03-28 22:32:36 UTC
Responsible Changed
From-To: freebsd-ports->tg

Over to maintainer
Comment 3 Alan Eldridge 2002-04-09 05:45:11 UTC
I have just PR'd the last change for 2.1-dependent ports.

Zope is the sole port requiring 2.1 and it uses bin/python2.1, not
bin/python, so it is unaffected. Yay! Patch against lang/python2.1
will follow tomorrow, along with list of pending PRs that it must wait
for.

-- 
AlanE
"I wanna be sedated." -- The Ramones
Comment 4 Alan Eldridge 2002-04-09 13:58:31 UTC
The following patch fixes python21. It is dependent on these PRs being
committed:
	
S  Submitted   Tracker     Resp.    Description
o [2002/03/31] ports/36589  ports    www/pyweblib: use current python
o [2002/04/08] ports/36914  wjv      textproc/py-asv: remove
					PYTHON_VERSION=python2.1 restriction

Ports/36589 has the maintainer's approval.
Both contain email from the package author stating that there is no
known restriction against using python 2.2.

This patch:
  * removes bin/pydoc, bin/python
  * removes share/emacs/site-lisp/python-mode.el
  * installs man page as python2.1.1 (do "man python2.1")

With this patch, there are no conflicts between lang/python and
lang/python21.

==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<==
Index: lang/python21/Makefile
===================================================================
RCS file: /home/ncvs/ports/lang/python21/Makefile,v
retrieving revision 1.84
diff -u -3 -r1.84 Makefile
--- lang/python21/Makefile	22 Jan 2002 12:53:28 -0000	1.84
+++ lang/python21/Makefile	5 Apr 2002 15:58:07 -0000
@@ -19,8 +19,8 @@
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-fpectl
 CONFIGURE_ENV=	OPT="${CFLAGS}"
-INSTALL_TARGET=	install
-MAN1=		python.1
+INSTALL_TARGET=	altinstall
+MAN1=		${PYTHON_VERSION}.1
 
 USE_PYTHON=	yes
 PYTHON_VERSION=	python2.1
@@ -76,8 +76,9 @@
 .endfor
 
 post-install:
-	@${MKDIR} ${PREFIX}/share/emacs/site-lisp
-	${INSTALL_DATA} ${WRKSRC}/Misc/python-mode.el ${PREFIX}/share/emacs/site-lisp
+	@${MKDIR} ${MANPREFIX}/man1
+	${INSTALL_MAN} ${WRKSRC}/Misc/python.man \
+		${MANPREFIX}/man1/${PYTHON_VERSION}.1
 	@${MKDIR} ${PYTHON_SITELIBDIR}
 .if !defined(NOPORTDOCS)
 	@cd ${WRKSRC}; tar -c --exclude='*CVS*' -f - Tools | \
Index: lang/python21/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/lang/python21/pkg-plist,v
retrieving revision 1.37
diff -u -3 -r1.37 pkg-plist
--- lang/python21/pkg-plist	22 Jan 2002 12:53:28 -0000	1.37
+++ lang/python21/pkg-plist	31 Mar 2002 12:27:38 -0000
@@ -1,5 +1,3 @@
-bin/pydoc
-bin/python
 bin/%%PYTHON_VERSION%%
 include/%%PYTHON_VERSION%%/Python.h
 include/%%PYTHON_VERSION%%/abstract.h
@@ -1990,7 +1988,6 @@
 lib/%%PYTHON_VERSION%%/zipfile.py
 lib/%%PYTHON_VERSION%%/zipfile.pyc
 lib/%%PYTHON_VERSION%%/zipfile.pyo
-share/emacs/site-lisp/python-mode.el
 %%PORTDOCS%%share/examples/%%PYTHON_VERSION%%/README
 %%PORTDOCS%%share/examples/%%PYTHON_VERSION%%/classes/Complex.py
 %%PORTDOCS%%share/examples/%%PYTHON_VERSION%%/classes/Dates.py
==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<==

-- 
AlanE
Comment 5 Alan Eldridge 2002-04-11 04:53:54 UTC
On Tue, Apr 09, 2002 at 08:58:31AM -0400, Alan E wrote:
>The following patch fixes python21. It is dependent on these PRs being
>committed:

I made an oops in the patch (see where I installed the man page). This
patch corrects the error.

==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<==
Index: lang/python21/Makefile
===================================================================
RCS file: /home/ncvs/ports/lang/python21/Makefile,v
retrieving revision 1.84
diff -u -3 -r1.84 Makefile
--- lang/python21/Makefile	22 Jan 2002 12:53:28 -0000	1.84
+++ lang/python21/Makefile	11 Apr 2002 03:34:26 -0000
@@ -19,8 +19,8 @@
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-fpectl
 CONFIGURE_ENV=	OPT="${CFLAGS}"
-INSTALL_TARGET=	install
-MAN1=		python.1
+INSTALL_TARGET=	altinstall
+MAN1=		${PYTHON_VERSION}.1
 
 USE_PYTHON=	yes
 PYTHON_VERSION=	python2.1
@@ -76,8 +76,9 @@
 .endfor
 
 post-install:
-	@${MKDIR} ${PREFIX}/share/emacs/site-lisp
-	${INSTALL_DATA} ${WRKSRC}/Misc/python-mode.el ${PREFIX}/share/emacs/site-lisp
+	@${MKDIR} ${MANPREFIX}/man1
+	${INSTALL_MAN} ${WRKSRC}/Misc/python.man \
+		${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
 	@${MKDIR} ${PYTHON_SITELIBDIR}
 .if !defined(NOPORTDOCS)
 	@cd ${WRKSRC}; tar -c --exclude='*CVS*' -f - Tools | \
Index: lang/python21/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/lang/python21/pkg-plist,v
retrieving revision 1.37
diff -u -3 -r1.37 pkg-plist
--- lang/python21/pkg-plist	22 Jan 2002 12:53:28 -0000	1.37
+++ lang/python21/pkg-plist	31 Mar 2002 12:27:38 -0000
@@ -1,5 +1,3 @@
-bin/pydoc
-bin/python
 bin/%%PYTHON_VERSION%%
 include/%%PYTHON_VERSION%%/Python.h
 include/%%PYTHON_VERSION%%/abstract.h
@@ -1990,7 +1988,6 @@
 lib/%%PYTHON_VERSION%%/zipfile.py
 lib/%%PYTHON_VERSION%%/zipfile.pyc
 lib/%%PYTHON_VERSION%%/zipfile.pyo
-share/emacs/site-lisp/python-mode.el
 %%PORTDOCS%%share/examples/%%PYTHON_VERSION%%/README
 %%PORTDOCS%%share/examples/%%PYTHON_VERSION%%/classes/Complex.py
 %%PORTDOCS%%share/examples/%%PYTHON_VERSION%%/classes/Dates.py
==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<==

Here is the patch for python15:

==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<==
Index: lang/python15/Makefile
===================================================================
RCS file: /home/ncvs/ports/lang/python15/Makefile,v
retrieving revision 1.74
diff -u -3 -r1.74 Makefile
--- lang/python15/Makefile	7 May 2001 11:56:08 -0000	1.74
+++ lang/python15/Makefile	11 Apr 2002 03:34:28 -0000
@@ -20,9 +20,9 @@
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-fpectl
 CONFIGURE_ENV=	OPT="${CFLAGS}"
-INSTALL_TARGET=	install
+INSTALL_TARGET=	altinstall
 PLIST=		${WRKDIR}/PLIST
-MAN1=		python.1
+MAN1=		${PYTHON_VERSION}.1
 NO_LATEST_LINK=	yes
 
 USE_PYTHON=	yes
@@ -100,10 +100,10 @@
 	@sort -r -o ${PLIST} ${PLIST_GMP} ${PLIST_TOOLS} ${PKGDIR}/pkg-plist
 
 post-install:
-	strip ${PREFIX}/bin/python
+	@${MKDIR} ${MANPREFIX}/man1
+	${INSTALL_MAN} ${WRKSRC}/Misc/python.man \
+		${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
 	@${MKDIR} ${PREFIX}/share/doc/${PYTHON_VERSION}
-	@${MKDIR} ${PREFIX}/share/emacs/site-lisp
-	${INSTALL_DATA} ${WRKSRC}/Misc/python-mode.el ${PREFIX}/share/emacs/site-lisp
 	${INSTALL_DATA} ${WRKSRC}/Misc/COPYRIGHT ${PREFIX}/share/doc/${PYTHON_VERSION}
 	@${MKDIR} ${PYTHON_SITELIBDIR}
 .if !defined(WITHOUT_TOOLS)
Index: lang/python15/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/lang/python15/pkg-plist,v
retrieving revision 1.30
diff -u -3 -r1.30 pkg-plist
--- lang/python15/pkg-plist	10 May 2001 11:12:09 -0000	1.30
+++ lang/python15/pkg-plist	11 Apr 2002 03:20:44 -0000
@@ -1,7 +1,5 @@
 bin/%%PYTHON_VERSION%%
-bin/python
 share/doc/%%PYTHON_VERSION%%/COPYRIGHT
-share/emacs/site-lisp/python-mode.el
 include/%%PYTHON_VERSION%%/Python.h
 include/%%PYTHON_VERSION%%/abstract.h
 include/%%PYTHON_VERSION%%/bitset.h
@@ -1011,4 +1009,3 @@
 @dirrm lib/%%PYTHON_VERSION%%
 @exec mkdir -p %D/lib/%%PYTHON_VERSION%%/site-packages
 @dirrm share/doc/%%PYTHON_VERSION%%
-@unexec rmdir share/emacs/site-lisp 2>/dev/null || true
==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<==

-- 
AlanE
"I wanna be sedated." -- The Ramones
Comment 6 Alan Eldridge 2002-04-11 05:00:37 UTC
Here's the patch for python20. This completes the python-port cleanup.
OK, tg@, can you approve this?

==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<==
Index: lang/python20/Makefile
===================================================================
RCS file: /home/ncvs/ports/lang/python20/Makefile,v
retrieving revision 1.80
diff -u -3 -r1.80 Makefile
--- lang/python20/Makefile	5 Jul 2001 11:21:15 -0000	1.80
+++ lang/python20/Makefile	11 Apr 2002 03:55:51 -0000
@@ -19,9 +19,9 @@
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-fpectl
 CONFIGURE_ENV=	OPT="${CFLAGS}"
-INSTALL_TARGET=	install
+INSTALL_TARGET=	altinstall
 PLIST=		${WRKDIR}/PLIST
-MAN1=		python.1
+MAN1=		${PYTHON_VERSION}.1
 NO_LATEST_LINK=	yes
 
 USE_PYTHON=	yes
@@ -120,10 +120,9 @@
 	@sort -r -o ${PLIST} ${PLIST_GMP} ${PLIST_TOOLS} ${PLIST_DEMO} ${PKGDIR}/pkg-plist
 
 post-install:
-	strip ${PREFIX}/bin/python
-	@${MKDIR} ${PREFIX}/share/emacs/site-lisp
-	${INSTALL_DATA} ${WRKSRC}/Misc/python-mode.el \
-		${PREFIX}/share/emacs/site-lisp
+	@${MKDIR} ${MANPREFIX}/man1
+	${INSTALL_MAN} ${WRKSRC}/Misc/python.man \
+		${MANPREFIX}/man/man1/${PYTHON_VERSION}.1
 	@${MKDIR} ${PYTHON_SITELIBDIR}
 .if !defined(WITHOUT_TOOLS)
 	@cd ${WRKSRC}; tar -c --exclude='*CVS*' -f - Tools | \
Index: lang/python20/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/lang/python20/pkg-plist,v
retrieving revision 1.31
diff -u -3 -r1.31 pkg-plist
--- lang/python20/pkg-plist	5 Jul 2001 11:21:15 -0000	1.31
+++ lang/python20/pkg-plist	11 Apr 2002 03:54:38 -0000
@@ -1,5 +1,4 @@
 bin/%%PYTHON_VERSION%%
-bin/python
 include/%%PYTHON_VERSION%%/Python.h
 include/%%PYTHON_VERSION%%/abstract.h
 include/%%PYTHON_VERSION%%/bitset.h
@@ -1550,7 +1549,6 @@
 lib/%%PYTHON_VERSION%%/zipfile.py
 lib/%%PYTHON_VERSION%%/zipfile.pyc
 lib/%%PYTHON_VERSION%%/zipfile.pyo
-share/emacs/site-lisp/python-mode.el
 @dirrm lib/%%PYTHON_VERSION%%/xml/parsers
 @dirrm lib/%%PYTHON_VERSION%%/xml/sax
 @dirrm lib/%%PYTHON_VERSION%%/xml/dom
==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<==

-- 
AlanE
"I wanna be sedated." -- The Ramones
Comment 7 Thomas Gellekum freebsd_committer freebsd_triage 2002-04-16 12:49:29 UTC
State Changed
From-To: open->closed

Committed, thanks.
Comment 8 johann 2002-04-26 11:33:06 UTC
This actually causes some problems.

With this patch in place, if a port specifies USE_PYTHON, Python 2.2
will be installed from lang/python, *regardless* of whether an earlier
version of Python is already present on the system.  It's down to this
line in bsd.python.mk:

  _PYTHON_VERSION!=   (python -c 'import sys; print sys.version[:3]') 2> /dev/null || echo 2.2

If an older Python is installed (i.e. there's no "python" binary in the
path), the result will always be "2.2".

A typical example:  A user has lang/python21 and www/zope installed.
The use now wishes to install www/zope-zmysqlda.  www/zope-zmysqlda
specifies USE_PYTHON, and even though lang/python21 is installed,
lang/python will now also be installed.  www/zope-zmysqlda *also*
depends on databases/py-MySQLdb, which will now be installed for Python
2.2.  The result is that ZMySQLda will not work, since MySQLdb has been
installed for the wrong version of Python.

I'm looking into how bsd.python.mk may be patched to prevent this
problem.

-- V