Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Apr 2003 16:53:30 +0400
From:      Sergey Matveychuk <sem@ciam.ru>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        ports@freebsd.org
Subject:   Re: Recent bsd.port.mk changes
Message-ID:  <3EA53B4A.4030700@ciam.ru>
In-Reply-To: <20030422001917.GA60080@rot13.obsecurity.org>
References:  <000501c3074c$e5c2be80$0a2da8c0@sem> <20030421210257.GA58574@rot13.obsecurity.org> <3EA48724.3080602@ciam.ru> <20030422001917.GA60080@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Kris Kennaway пишет:
> On Tue, Apr 22, 2003 at 04:04:52AM +0400, Sergey Matveychuk wrote:
> 
>>Kris Kennaway wrote:
>>
>>
>>>If you compile e.g. python modules against multiple versions of
>>>python, they will have different package names and install in
>>>different places (so the packages do not conflict at all), but the
>>>same origin.  The new check will not allow the user to do this.
>>
>>I'v never seen this case. How looks like its names in PKG_DBDIR?
> 
> 
> They set a different PKGNAMEPREFIX: e.g. py-, py22-, ...
> 
> Look at bsd.python.mk for the implementation.
> 
> Kris

Here is a patch. Take a look. I'v added deinstall target there too. I 
guess it's looks better than a first one.

--- bsd.port.mk.orig	Wed Apr  9 12:37:24 2003
+++ bsd.port.mk	Tue Apr 22 04:34:33 2003
@@ -2894,8 +2894,11 @@
  .if !target(check-already-installed)
  check-already-installed:
  .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
-    @if [ -d ${PKG_DBDIR}/${PKGNAME} -o \
-			"x`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`" != "x" ]; then \
+    @found_pkgs=`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null | ${SED} 
-e 's#\(.*\)-.*$$#\1#'`; \
+    for i in $${found_pkgs}; do \
+	   if [ "$$i" = "${PKGBASE}" ]; then found=1; break; fi \
+    done; \
+	if [ -d ${PKG_DBDIR}/${PKGNAME} -o "$${found}" ]; then \
  		${ECHO_CMD} "===>  ${PKGNAME} is already installed - perhaps an 
older version?"; \
  		${ECHO_CMD} "      If so, you may wish to \`\`make deinstall'' and 
install"; \
  		${ECHO_CMD} "      this port again by \`\`make reinstall'' to 
upgrade it properly."; \
@@ -3238,8 +3241,11 @@

  .if !target(deinstall)
  deinstall:
-	@deinstall_name=`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`; \
-	${TEST} -z $${deinstall_name} && deinstall_name=${PKGNAME}; \
+	@if ${PKG_INFO} -e ${PKGNAME}; then \
+		deinstall_name=${PKGNAME}; \
+	else \
+		deinstall_name=`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`; \
+	fi; \
  	${ECHO_MSG} "===>  Deinstalling for ${PKGORIGIN} ($${deinstall_name})"; \
  	if ${PKG_INFO} -e $${deinstall_name} 2> /dev/null; then \
  		${PKG_DELETE} -f $${deinstall_name}; \


-- 
Sem.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EA53B4A.4030700>