From owner-freebsd-ports@FreeBSD.ORG Wed Feb 2 08:24:31 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11176106573E for ; Wed, 2 Feb 2011 08:24:27 +0000 (UTC) (envelope-from ganael.laplanche@martymac.org) Received: from data.galacsys.net (webmail.galacsys.net [217.24.81.215]) by mx1.freebsd.org (Postfix) with ESMTP id A0DB38FC0A for ; Wed, 2 Feb 2011 08:24:27 +0000 (UTC) Received: from martymac.org (webmail.galacsys.net [217.24.81.215]) by data.galacsys.net (Postfix) with ESMTP id 55931171546 for ; Wed, 2 Feb 2011 09:05:43 +0100 (CET) From: "Ganael LAPLANCHE" To: freebsd-ports@freebsd.org X-Openwebmail-Date: Wed, 2 Feb 2011 10:05:43 +0200 Message-Id: <20110202075517.M86909@martymac.org> X-Mailer: Open WebMail 2.01 20030425 X-OriginatingIP: 157.99.64.43 (ganael.laplanche@martymac.org) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Date: Wed, 2 Feb 2011 09:05:43 +0100 (CET) Subject: DATADIR recorded as a relative path in plist ? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2011 08:24:31 -0000 Hi ! While struggling with DATADIR-safety messages from portlint, I've noticed something very odd : DATADIR, which is supposed to be an absolute path, is recorded as a relative path (to ${PREFIX}, I suppose) in pkg-plist. This leads to being unable to deinstall a port which has been installed with a different DATADIR. Here is a very simple example, easy to reproduce. It implies misc/pciids, which is supposed to be DATADIR-safe as it uses the %%DATADIR%% macro in its plist. Its 'do-install' target is as simple as : do-install: ${MKDIR} ${DATADIR} ${INSTALL_DATA} ${WRKSRC}/pci.ids ${DATADIR} So there is no special trick here, everything should go fine, but it does not : # cd /usr/ports/misc/pciids && make DATADIR=/tmp/pciids install ===> Vulnerability check disabled, database not found ===> License BSD GPLv2 GPLv3 accepted by the user ===> Extracting for pciids-20101124 => SHA256 Checksum OK for pciids-20101124.tar.bz2. ===> Patching for pciids-20101124 ===> Configuring for pciids-20101124 ===> Installing for pciids-20101124 ===> Generating temporary packing list ===> Checking if misc/pciids already installed /bin/mkdir -p /tmp/pciids install -o root -g wheel -m 444 /files/Ports/ports/misc/pciids/work/pciids-20101124/pci.ids /tmp/pciids ===> Registering installation for pciids-20101124 # ls /tmp/pciids pci.ids So far, so good : DATADIR is handled as an *absolute* path and pci.ids has been installed into /tmp/. Unfortunately, here is the content of the plist : # pkg_info -L pciids-20101124 Information for pciids-20101124: Files: /usr/local//tmp/pciids/pci.ids /usr/local/share/licenses/pciids-20101124/catalog.mk /usr/local/share/licenses/pciids-20101124/LICENSE /usr/local/share/licenses/pciids-20101124/BSD /usr/local/share/licenses/pciids-20101124/GPLv2 /usr/local/share/licenses/pciids-20101124/GPLv3 DATADIR has been recorded as a *relative* path to ${PREFIX}. Obviously, everything goes wrong when you try to uninstall the package : # make DATADIR=/tmp/pciids deinstall ===> Deinstalling for misc/pciids ===> Deinstalling pciids-20101124 pkg_delete: file '/usr/local//tmp/pciids/pci.ids' doesn't exist pkg_delete: file '/usr/local//tmp/pciids' doesn't exist pkg_delete: unable to completely remove directory '/usr/local//tmp/pciids' pkg_delete: couldn't entirely delete package (perhaps the packing list is incorrectly specified?) Am I missing something here ? Best regards, -- Ganael LAPLANCHE http://www.martymac.org | http://contribs.martymac.org FreeBSD: martymac , http://www.FreeBSD.org