On Fri, May 24, 2013 at 12:14:16PM +0200, Petr Baudis wrote:
> On Fri, May 24, 2013 at 11:06:12AM +0100, John Keeping wrote:
> > I don't see anything wrong with having a template file documenting the
> > parameters, but I think it's important that there are sensible defaults
> > in place when the user's configuration file does not specify a value for
> > a parameter.  It wasn't clear to me from your definition that there were
> > defaults to be overridden by the user's configuration file, as opposed
> > to forcing the user to define certain values and causing an error if
> > those are not defined.
> 
> That's the case in plenty of situations - when specifying usernames and
> passwords and server hostnames, paths to cross-compiling environments
> that pretty much everyone has at a different place, and so on.

Yeah, I didn't mean to say that everything can have a sensible default.

Going back to where this started, in the omxplayer Makefile, I would map
my suggestion to a change like this:

    * Change most of the ":=" in Makefile.include to "=" so that the
      order of variable definition matters less
    * Move Makefile.include to Makefile.defaults
    * Change the "include Makefile.include" at the top of Makefile to:

        include Makefile.defaults
        -include Makefile.config
    
    * Add Makefile.config to .gitignore

So that it continues to Just Work for people using buildroot but you can
create Makefile.config to override those defaults.

I agree that this isn't possible in all cases, and your template
approach is certainly useful for configuration files - particularly
because those templates can be included in end-user documentation or the
installation as they are likely to be needed in the installed
application and not just development.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to