ports/189976: [patch] Add a keyword to create empty directories

Adam Weinberger adamw at FreeBSD.org
Tue May 20 00:40:00 UTC 2014


>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 at 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:


More information about the freebsd-ports-bugs mailing list