Date: Mon, 19 May 2014 20:32:43 -0400 (EDT) From: Adam Weinberger <adamw@FreeBSD.org> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/189976: [patch] Add a keyword to create empty directories Message-ID: <20140520003243.AE63611F8FB@apnoea.adamw.org> Resent-Message-ID: <201405200040.s4K0e0Wr081773@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 189976 >Category: ports >Synopsis: [patch] Add a keyword to create empty directories >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue May 20 00:40:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Adam Weinberger >Release: FreeBSD 10.0-STABLE i386 >Organization: >Environment: System: FreeBSD apnoea.adamw.org 10.0-STABLE FreeBSD 10.0-STABLE #7: Tue May 13 23:19:06 EDT 2014 root@apnoea.adamw.org:/usr/obj/usr/src/sys/PEEP i386 >Description: Many ports need to pre-create directories but don't need anything in them. Particularly common examples are things in /var. pkg* only registers directories that have stuff in them. This means that to intentionally create empty directories, we have to resort to "tricks", such as making a wrapper that creates dirs then executes the "real" program, or adding .keepme files. It would be nice to have the ability to intentionally create empty directories. One option would be to make pkg-create(8) honour any @dirrm{,try}, including empty ones. As another option, this patch introduces an @emptydir keyword. It's only half-baked, as it doesn't allow specifying owner/group/mode. I don't really know YAML, but if it allows variables you could do some sort of install -d -o $OWNER thing. Either way, it'd be nice to cut down on the number of things we have to do to "outsmart" pkg*. >How-To-Repeat: >Fix: --- emptydir.yaml begins here --- actions: [dirrmtry] post-install: | if echo %@|grep -q '^/'; then mkdir %@ else mkdir %D/%@ fi --- emptydir.yaml ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140520003243.AE63611F8FB>