From owner-freebsd-ports@FreeBSD.ORG Tue Apr 22 05:53:32 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDA0237B401 for ; Tue, 22 Apr 2003 05:53:32 -0700 (PDT) Received: from hueymiccailhuitl.mtu.ru (hueytecuilhuitl.mtu.ru [195.34.32.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA9AF43F75 for ; Tue, 22 Apr 2003 05:53:31 -0700 (PDT) (envelope-from sem@ciam.ru) Received: from ciam.ru (ppp133-20.dialup.mtu-net.ru [62.118.133.20]) by hueymiccailhuitl.mtu.ru (Postfix) with ESMTP id 90DBDFA331; Tue, 22 Apr 2003 16:52:45 +0400 (MSD) (envelope-from sem@ciam.ru) Message-ID: <3EA53B4A.4030700@ciam.ru> Date: Tue, 22 Apr 2003 16:53:30 +0400 From: Sergey Matveychuk User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.3) Gecko/20030309 X-Accept-Language: ru-ru, ru MIME-Version: 1.0 To: Kris Kennaway References: <000501c3074c$e5c2be80$0a2da8c0@sem> <20030421210257.GA58574@rot13.obsecurity.org> <3EA48724.3080602@ciam.ru> <20030422001917.GA60080@rot13.obsecurity.org> In-Reply-To: <20030422001917.GA60080@rot13.obsecurity.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit cc: ports@freebsd.org Subject: Re: Recent bsd.port.mk changes X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 12:53:33 -0000 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.