DATADIR recorded as a relative path in plist ?

2011-02-02 Thread Ganael LAPLANCHE
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.laplan...@martymac.org
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac marty...@freebsd.org, http://www.FreeBSD.org
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: DATADIR recorded as a relative path in plist ?

2011-02-02 Thread Anonymous
Ganael LAPLANCHE ganael.laplan...@martymac.org writes:

 # 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 ?

You cannot define DATADIR that's PREFIX-unsafe without using @cwd.
And using @cwd makes `-p/-P' options in pkg_add(1) less useful.

Not sure why portlint even mentions safeness for
DOCSDIR/EXAMPLESDIR/DATADIR as they were never safe for *user* to
override. According to CVS history it was requested by pav@.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: DATADIR recorded as a relative path in plist ?

2011-02-02 Thread Ganael LAPLANCHE
On Wed, 02 Feb 2011 12:17:13 +0300, Anonymous wrote

Hi,

 You cannot define DATADIR that's PREFIX-unsafe without using @cwd.
 And using @cwd makes `-p/-P' options in pkg_add(1) less useful.
 
 Not sure why portlint even mentions safeness for
 DOCSDIR/EXAMPLESDIR/DATADIR as they were never safe for *user* 
 to override.

Yes, I don't know either. I thought DATADIR could be overridden by users
; thanks for clarifying this.

Best regards,

--
Ganael LAPLANCHE ganael.laplan...@martymac.org
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac marty...@freebsd.org, http://www.FreeBSD.org
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org