depends / optional_depends / Linux_PAM

Duncan Gibson duncan.gibson at xs4all.nl
Sat Feb 5 14:23:54 CET 2011


There have just been a couple of module submissions that replace BUILD
code like:

-  if  module_installed  Linux-PAM;  then
-    OPTS+=" --with-libpam"
-  else
-    OPTS+=" --without-libpam"
-  fi &&
-

with code in DEPENDS like:

+optional_depends Linux-PAM              \
                  "--with-libpam"        \
                  "--without-libpam"     \
                  "for Linux-PAM support"

This looked to be so logical that I wondered why such a simplification
hadn't been done before. I tracked back through the git history for
shadow/BUILD and couldn't find any explanation, so I asked on #lunar:

engelsman | Is there a reason why shadow/BUILD uses
          | "if module_installed Linux-PAM; then OPTS+=" --with-libpam"..."?
engelsman | there's a submission which replaces this with an
          | optional_depends
engelsman | it seems such an obvious simplification I wonder why someone
          | hasn't done it before unless there's a good reason for it.
engelsman | hence the question.

   Ratler | engelsman: We should never depend on Linux-PAM
   Ratler | All modules that do does it wrong
   Ratler | With optional_depend you might end up in a stupid loop if
          | you decide to lrm Linux-PAM
   Ratler | Thus we have special functions in the core tool to discover
          | pam related things

   Ratler | openssh for example should be fixed not to use
          | optional_depends of Linux-PAM :)

So the moral of the story: Modules should not depend on Linux-PAM

This message is the first step in documenting this issue somewhere
(and so I can provide a link to it when I reject the submissions).

Cheers
Duncan



More information about the Lunar-dev mailing list