------------------ @exec install -d -o root -g wheel -m 711 /var/spool/prelude @unexec rmdir /var/spool/prelude 2>/dev/null || true ------------------ WARN: /mnt/home/koobs/repos/freebsd/ports/security/libprelude/pkg-plist: [96]: use "%D" or "%B" to specify prefix. WARN: /mnt/home/koobs/repos/freebsd/ports/security/libprelude/pkg-plist: [96]: use "@dirrmtry" instead of "@unexec rmdir". Changing it to: ------------------ @exec install -d -o root -g wheel -m 711 /var/spool/prelude @dirrmtry /var/spool/prelude ------------------ WARN: /mnt/home/koobs/repos/freebsd/ports/security/libprelude/pkg-plist: [96]: Using @dirrmtry with absolute path will not work as you expected in most cases. Use pkg-deinstall or @unexec rmdir ... if you want to remove a direc tory such as /var/${PORTNAME} An unambiguous case for handling & detecting directory removals for paths outside of prefix is needed, if we know what the current best-practice method is for doing that. (independent of pkg_* removal)
As per IRC conversation with antoine@ 16:50:45 antoine_ | either use 16:50:58 antoine_ | @exec install -d -o root -g wheel -m 711 /var/spool/prelude | @unexec rmdir /var/spool/prelude 2>/dev/null || true 16:51:01 antoine_ | or 16:51:06 antoine_ | @exec install -d -o root -g wheel -m 711 /var/spool/prelude | @dirrmtry /var/spool/prelude 16:51:39 antoine_ | i will put a commit hook killing everybody putting @cwd in plist 16:51:44 antoine_ | in a few days portlint ought to work within these constraints
More ambiguity fail, from Mk/Scripts/check-stagedir.sh ===> Checking for items in STAGEDIR missing from pkg-plist Error: Orphaned: @unexec rmdir "/var/spool/prelude" >/dev/null 2>&1 || :
over to marcus
I'm not sure I clearly understand the ask. Is it to check for @cwd and flag that as an error?
No, as long as pkg_install is supported @cwd is legitimate. @dirrmtry with full path should work fine with pkg_install since http://svnweb.freebsd.org/changeset/ports/358636
(In reply to Kubilay Kocak from comment #1) > As per IRC conversation with antoine@ ... > 16:51:39 antoine_ | i will put a commit hook killing everybody putting @cwd > in plist > 16:51:44 antoine_ | in a few days @cwd won't be needed for files but it will still be needed for @[un]exec and other keywords using %D. I had not been using @cwd in my ports at work and realized this. All keywords need to be checked for %D usage. For example, @shell and @sample depend on @cwd being right for %D. You would need to expand %D for all these uses in plists from the current @cwd. Pkg is *not* safe without %D in execs. It will gladly run the command in the current directory you are in. So mkdir %D/dir -> mkdir dir. We could fix Pkg to cd into prefix but I still see people running 1.1.
This has been fixed in 2.16.0.