From owner-freebsd-ports@FreeBSD.ORG Thu Apr 17 23:14:53 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 BCAF437B401; Thu, 17 Apr 2003 23:14:53 -0700 (PDT) Received: from ms-smtp-03.southeast.rr.com (ms-smtp-03.southeast.rr.com [24.93.67.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BEDF43F3F; Thu, 17 Apr 2003 23:14:52 -0700 (PDT) (envelope-from marcus@marcuscom.com) Received: from mail4.nc.rr.com (fe4 [24.93.67.51])h3I6DWMq005516; Fri, 18 Apr 2003 02:13:32 -0400 (EDT) Received: from creme-brulee.marcuscom.com ([66.57.17.158]) by mail4.nc.rr.com with Microsoft SMTPSVC(5.5.1877.757.75); Fri, 18 Apr 2003 02:16:41 -0400 Received: from [192.168.1.4] (shumai.marcuscom.com [192.168.1.4]) h3I6DMaa080331; Fri, 18 Apr 2003 02:13:22 -0400 (EDT) (envelope-from marcus@marcuscom.com) From: Joe Marcus Clarke To: Kris Kennaway In-Reply-To: <20030418045754.GA94741@rot13.obsecurity.org> References: <1050640352.58286.22.camel@shumai.marcuscom.com> <20030418045754.GA94741@rot13.obsecurity.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-EV4J1CM8vOysuuTdwzbt" Organization: MarcusCom, Inc. Message-Id: <1050646484.58286.108.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.3.2 (Preview Release) Date: 18 Apr 2003 02:14:44 -0400 X-Spam-Status: No, hits=-22.4 required=5.0 tests=BAYES_00,IN_REP_TO,PGP_SIGNATURE_2,REFERENCES autolearn=ham version=2.50 X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) 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: Fri, 18 Apr 2003 06:14:54 -0000 --=-EV4J1CM8vOysuuTdwzbt Content-Type: multipart/mixed; boundary="=-unoyvTcUpUSGvpvD8q8f" --=-unoyvTcUpUSGvpvD8q8f Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2003-04-18 at 00:57, Kris Kennaway wrote: > On Fri, Apr 18, 2003 at 12:32:32AM -0400, Joe Marcus Clarke wrote: > > Kris, I don't think I agree with one of the changes that went in to > > bsd.port.mk today. I'm trying to do an upgrade of libgtkhtml from 2.2.= 2 > > to 2.2.3. When I do such things, I install the new port to an alternat= e > > PREFIX while keeping the old version around. With the recent changes, = I > > can no longer do this. The ports system informs me that: > >=20 > > =3D=3D=3D> Installing for libgtkhtml-2.2.3 > > =3D=3D=3D> libgtkhtml-2.2.3 is already installed - perhaps an older ve= rsion? > > If so, you may wish to ``make deinstall'' and install > > this port again by ``make reinstall'' to upgrade it properly. > > If you really wish to overwrite the old port of libgtkhtml-2.2.3 > > without deleting it first, set the variable "FORCE_PKG_REGISTER" > > in your environment or the "make install" command line. > > *** Error code 1 > >=20 > > When, in fact, it is not installed. libgtkhtml-2.2.2 is installed. Th= e > > change in question is at line 2879 (the check to see if another port > > with this ports origin is installed [ports/48646]). Yes, I can set > > FORCE_PKG_REGISTER, but when I go to make deinstall, it now removes > > _both_ ports. I'd like to request this, and possibly the smarter make > > deinstall be backed out. >=20 > Hmm..but previously if you had libgtkhtml-2.2.3 installed (i.e. the > same version) this would also have failed. Right, and I accept that. Except this wasn't the case, nor is it usually in what I do. >=20 > The major benefit of this change is that it prevents people from > installing one copy of the port over an older version, thereby > screwing up their /var/db/pkg and possibly leaving orphan files lying > around. I think that is important enough that it should stay in, in > some form. Yes, I can see the advantage, but it now adds extra work (for me, maybe others). The reason I Cc'd ports was to get an idea if others thought the same way I did. >=20 > In your case since the PREFIX is different they don't actually > conflict so one might argue that it should be allowed. I suppose > that's something that could be checked in bsd.port.mk by extracting > the prefix for the existing package from the contents file and > comparing to PREFIX. This would be acceptable. However, the make deinstall would still remove both versions. What about keeping make deinstall the same as it was with one exception: if you type make deinstall in a port directory, and the version specified by that port's Makefile is not installed (but another version with the same origin is), then the other version would be deinstalled. However, if a package is found that matches the version specified in the port's Makefile, then only that version is removed. We could then add a make deinstall-all target to handle deinstalling all packages with the same origin. Something like what's attached. Joe >=20 > Kris --=20 PGP Key : http://www.marcuscom.com/pgp.asc --=-unoyvTcUpUSGvpvD8q8f Content-Disposition: attachment; filename=bsd.port.mk.diff Content-Type: text/plain; name=bsd.port.mk.diff; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable --- bsd.port.mk.orig Fri Apr 18 00:22:02 2003 +++ bsd.port.mk Fri Apr 18 02:11:53 2003 @@ -2875,12 +2875,24 @@ .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`" !=3D "x" ]; then \ - ${ECHO_CMD} "=3D=3D=3D> ${PKGNAME} is already installed - perhaps an ol= der version?"; \ + @already_installed=3D`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`; \ + found_package=3D""; \ + check_name=3D""; \ + if [ -n "$${already_installed}" ]; then \ + for p in $${already_installed}; do \ + if [ "x${PREFIX}" =3D "x`${PKG_INFO} -q -p $${p} | ${SED} -e 's|^@cwd |= |'`" ]; then \ + found_package=3D$${p}; \ + check_name=3D$${p}; \ + fi; \ + done; \ + fi; \ + ${TEST} -z $${check_name} && check_name=3D${PKGNAME}; \ + if [ -d ${PKG_DBDIR}/${PKGNAME} -o \ + -n "$${found_package}" ]; then \ + ${ECHO_CMD} "=3D=3D=3D> ${PKGORIGIN} is already installed ($${check_nam= e})- perhaps an older version?"; \ ${ECHO_CMD} " If so, you may wish to \`\`make deinstall'' and insta= ll"; \ ${ECHO_CMD} " this port again by \`\`make reinstall'' to upgrade it= properly."; \ - ${ECHO_CMD} " If you really wish to overwrite the old port of ${PKG= NAME}"; \ + ${ECHO_CMD} " If you really wish to overwrite the old port of ${PKG= ORIGIN}"; \ ${ECHO_CMD} " without deleting it first, set the variable \"FORCE_P= KG_REGISTER\""; \ ${ECHO_CMD} " in your environment or the \"make install\" command l= ine."; \ exit 1; \ @@ -3228,14 +3240,34 @@ =20 .if !target(deinstall) deinstall: + @if ${PKG_INFO} -e ${PKGNAME}; then \ + deinstall_name=3D${PKGNAME}; \ + else \ + deinstall_name=3D`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`; \ + fi; \ + ${ECHO_MSG} "=3D=3D=3D> Deinstalling for ${PKGORIGIN} ($${deinstall_name= })"; \ + if ${PKG_INFO} -e $${deinstall_name}; then \ + ${PKG_DELETE} -f $${deinstall_name}; \ + else \ + ${ECHO_MSG} "=3D=3D=3D> ${PKGORIGIN} not installed, skipping"; \ + fi + @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE} +.endif + +# Deinstall-all +# +# Special target to remove installation of all ports of the same origin + +.if !target(deinstall-all) +deinstall-all: @deinstall_name=3D`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`; \ ${TEST} -z $${deinstall_name} && deinstall_name=3D${PKGNAME}; \ ${ECHO_MSG} "=3D=3D=3D> Deinstalling for ${PKGORIGIN} ($${deinstall_name= })"; \ if ${PKG_INFO} -e $${deinstall_name}; then \ ${PKG_DELETE} -f $${deinstall_name}; \ - else \ - ${ECHO_MSG} "=3D=3D=3D> ${PKGORIGIN} not installed, skipping"; \ - fi + else \ + ${ECHO_MSG} "=3D=3D=3D> ${PKGORIGIN} not installed, skipping"; \ + fi @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE} .endif =20 --=-unoyvTcUpUSGvpvD8q8f-- --=-EV4J1CM8vOysuuTdwzbt Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+n5fUb2iPiv4Uz4cRAuEpAJ97QlcxbEyueRS7kV18FzbBQF0ghgCfQqLB 0HQ4j2mqYDWCVzeE+AOi+M8= =s7Pj -----END PGP SIGNATURE----- --=-EV4J1CM8vOysuuTdwzbt--