New version of the fakeroot patch

Tijl Coosemans tijl at coosemans.org
Thu Dec 24 12:22:44 UTC 2009


On Thursday 24 December 2009 06:43:02 Ulrich Spörlein wrote:
> On Tue, 15.12.2009 at 10:00:18 +0100, Tijl Coosemans wrote:
>> On Tuesday 15 December 2009 09:10:47 Matthew Seaman wrote:
>>> Uh -- is it actually possible to create an empty directory when
>>> installing from a pkg tarball?
>>> 
>>> I ran into this problem with the phpMyAdmin port, and the only good
>>> way I found to solve it was to add a stub file into any empty
>>> directories.  You could use a post install script or an mtree file,
>>> but that seems like overkill for such a trivial operation.
>> 
>> If you want to create ${PREFIX}/somedir you can add this line
>> to pkg-plist:
>> 
>> @exec mkdir -p %D/somedir
> 
> ... and then you still need to chmod/chown to fix permissions. I
> wonder why that doesn't work with tar. Is that a limitation of the
> format, should we perhaps use cpio (with bsdtar, it would be
> transparent anyway).

Ownership and permissions are restored by tar. It's just that empty
directories aren't added to the archive by pkg_create.

Also, if you have to change ownership/permissions you should be careful
not to create any race conditions where too many permissions are given
to the wrong users. Removing permissions should happen before chown and
adding permissions should happen after chown.


More information about the freebsd-ports mailing list