On Wed, 16 Nov 2016 16:37:15 -0600
William Hubbs <[email protected]> wrote:

> # @FUNCTION: tmpfiles_process
> # @USAGE: tmpfiles_process <filename> <filename> ...
> # @DESCRIPTION:
> # Call a tmpfiles.d implementation to create new volatile and temporary
> # files and directories.
> # Specific files and directories can be listed, but if they are not, all
> # tmpfiles.d files will be processed.

This contradicts the code. And I'd prefer the code, since allowing
empty list will only encourage developers to be lazy, and I'm not
really convinced that unconditionally running every tmpfiles.d file
(esp. that user may be overriding some of them) at runtime is a good
idea.

> tmpfiles_process() {
>       debug-print-function "${FUNCNAME}" "$@"
> 
>       [[ ${EBUILD_PHASE} == postinst ]] || die "${FUNCNAME}: Only valid in 
> pkg_postinst"
>       [[ ${#} -gt 0 ]] || die "${FUNCNAME}: Must specify at least one 
> filename"
>       [[ ${ROOT} == / ]] || return 0
> 
>       if type systemd-tmpfiles &> /dev/null; then
>               systemd-tmpfiles --create "$@"
>       elif type opentmptmpfiles &> /dev/null; then

You have double 'tmp' here.

>               opentmpfiles --create "$@"
>       fi
> }

Also, I'm wondering if we should have any specific error handling here.
Maybe we should ewarn if something fails? Mike?

Also, possibly 'else' branch with big fat warning if for some reason
dependencies are missing?

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

Attachment: pgp_8f520aL4q.pgp
Description: OpenPGP digital signature

Reply via email to