tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PLIST_VARS



> If I understand the intention and the comment in plist.mk correctly,
> it's ${_var_} to be check if defined or not, not ${PLIST.${_var}}.

Rethinking of this, what we do here is to select a subset.  Why not
pass it as a whole.  E.g.:

        PLIST_VARS=     foo bar baz
        #foo=           # defined
        bar=            # defined
        #baz=           # defined
        :
        .for _var_ ${PLIST_VARS}
        PLIST_SUBST+=   ${${_var_}:DPLIST.${_var_}=:UPLIST.${_var_}="@comment "}
        .endfor

vs.

        PLIST_VARS=     foo bar baz
        PLIST_ENABLED_VARS=     bar             # XXX better name?
        :
        .for _var_ ${PLIST_VARS}
        .if !empty(PLIST_ENABLED_VARS:M${_var_})
        PLIST_SUBST+=   PLIST.${_var_}=
        .else
        PLIST_SUBST+=   PLIST.${_var_}="@comment "
        .endfor

In the latter code, although the pkgsrc infrastructure (plist.mk) has
to iterate and check the condition due to the fact that make(1) lacks
set operation, the pkgsrc user (package makefiles) can simply pass a
single variable (PLIST_ENABLED_VARS), so this is better IMO. :)

(This is also similar to how PKG_OPTIONS works.)

Masao


Home | Main Index | Thread Index | Old Index