DATADIR recorded as a relative path in plist ?

Ganael LAPLANCHE ganael.laplanche at martymac.org
Wed Feb 2 08:24:31 UTC 2011


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 <ganael.laplanche at martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac at FreeBSD.org>, http://www.FreeBSD.org


More information about the freebsd-ports mailing list