Subject: Re: PYTHON_VERSION_DEFAULT no longer works correctly
To: None <mlh@goathill.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-pkg
Date: 04/28/2004 22:06:33
This is a multipart MIME message.

--==_Exmh_25354244439160
Content-Type: text/plain; charset=us-ascii


mlh@goathill.org said:
> The current situation breaks the case where one version of Python is
> updated, so is removed, resulting in all modules to be replaced being
> built for the other version, which is incorrect.

This is a deficiency in the "update" handling in general. It has
been there all the time: eg if one did a "make update" for a python
pkg which required a non-standard python version, the dependencies
were rebuilt for the default version (which was installed as well).
You might try the appended patch. It is quite invasive, so I was
hesitating to publish it, but is probably a step into the right
direction.
It causes the name of a pkg to be recorded additional to the
directory it lives in. Python packages draw the information which
version to use from that; I can imagine that this information
could be useful to detect pkg renaming problems too.

beat regards
Matthias



--==_Exmh_25354244439160
Content-Type: text/plain ; name="pkgname.txt"; charset=us-ascii
Content-Description: pkgname.txt
Content-Disposition: attachment; filename="pkgname.txt"

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1454
diff -u -r1.1454 bsd.pkg.mk
--- bsd.pkg.mk	27 Apr 2004 22:35:47 -0000	1.1454
+++ bsd.pkg.mk	28 Apr 2004 19:53:47 -0000
@@ -3527,16 +3527,18 @@
 		${MAKE} ${MAKEFLAGS} ${UPDATE_TARGET} KEEP_WRKDIR=YES	\
 			DEPENDS_TARGET=${DEPENDS_TARGET:Q}
 	${_PKG_SILENT}${_PKG_DEBUG}					\
-	[ ! -s ${DDIR} ] || for dep in `${CAT} ${DDIR}` ; do		\
+	[ ! -s ${DDIR} ] || ${CAT} ${DDIR} | while read p dep; do	\
 		(if cd ../.. && cd "$${dep}" ; then			\
-			${ECHO_MSG} "${_PKGSRC_IN}> Installing in $${dep}" && \
+			${ECHO_MSG} "${_PKGSRC_IN}> Installing for $${p} in $${dep}" && \
 			if [ "(" "${RESUMEUPDATE}" = "NO" -o 		\
 			     "${REINSTALL}" != "NO" ")" -a		\
 			     "${UPDATE_TARGET}" != "replace" ] ; then	\
-				${MAKE} ${MAKEFLAGS} deinstall;		\
+				${MAKE} ${MAKEFLAGS} deinstall		\
+				    PKGNAME_REQD=$${p} ;		\
 			fi &&						\
 			${MAKE} ${MAKEFLAGS} ${UPDATE_TARGET}		\
 				DEPENDS_TARGET=${DEPENDS_TARGET:Q} ;	\
+				PKGNAME_REQD=$${p} ;			\
 		else							\
 			${ECHO_MSG} "${_PKGSRC_IN}> Skipping removed directory $${dep}"; \
 		fi) ;							\
@@ -3552,9 +3554,10 @@
 	${_PKG_SILENT}${_PKG_DEBUG}${MAKE} ${MAKEFLAGS} ${DDIR}
 	${_PKG_SILENT}${_PKG_DEBUG}					\
 	if [ -s ${DDIR} ] ; then					\
-		for dep in `${CAT} ${DDIR}` ; do			\
+		${CAT} ${DDIR} | while read p dep; do			\
 			(if cd ../.. && cd "$${dep}" ; then		\
-				${MAKE} ${MAKEFLAGS} clean ;		\
+				${MAKE} ${MAKEFLAGS} clean		\
+				PKGNAME_REQD=$${p} ;			\
 			else						\
 				${ECHO_MSG} "${_PKGSRC_IN}> Skipping removed directory $${dep}";\
 			fi) ;						\
@@ -3593,8 +3596,8 @@
 ${DDIR}: ${DLIST}
 	${_PKG_SILENT}${_PKG_DEBUG}					\
 	ddir=`${SED} 's:-[^-]*$$::' ${DLIST}`;				\
-	${ECHO} >${DDIR};						\
 	for pkg in $${ddir} ; do					\
+		${ECHO} -n "$${pkg} " >> ${DDIR};			\
 		if ${PKG_INFO} -b "$${pkg}" >/dev/null 2>&1 ; then	\
 			${PKG_INFO} -b "$${pkg}" | ${SED}	-ne	\
 			    's,\([^/]*/[^/]*\)/Makefile:.*,\1,p' | 	\

--==_Exmh_25354244439160--