Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] section build files

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Andrew <afrayedknot AT thefrayedknot.armory.com>
  • To: sm-discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] section build files
  • Date: Sun, 25 Apr 2004 13:15:31 -0700

On Sun, Apr 25, 2004 at 10:09:36PM +0200, Arwed von Merkatz wrote:
> On Sun, Apr 25, 2004 at 01:00:35PM -0700, Andrew wrote:
> > On Sun, Apr 25, 2004 at 09:56:32PM +0200, Arwed von Merkatz wrote:
> > > On Sun, Apr 25, 2004 at 03:40:11PM -0400, Sergey A. Lipnevich wrote:
> > > > I believe the name would be misleading, it shouldn't be negative.
> > > > Maybe
> > > > SECTION_FUNCTIONS=[on|off]. I believe that a default should be "on"
> > > > to
> > > > always check for <spell>/../FUNCTIONS and source it, unless
> > > > SECTION_FUNCTIONS=off. I believe this is cheap and consistent with
> > > > usage
> > > > of other files, such as PRE_INSTALL or POST_REMOVE (you don't tell
> > > > sorcery anything to use these). Other variants: SECTION_INHERIT, or
> > > > even
> > > > SECTION_LIB.
> > >
> > > You're right, that makes more sense. I'd say SECTION_FUNCTIONS is the
> > > best name to go with a file named FUNCTIONS.
> > >
> > Is this something that should only exist on a per section basis? Why
> > not have the option for overriding everything for the grimoire, then
> > have the section level override that if necessary (its only one more
> > line of code for me anyways).
> >
> > That would make SECTION_FUNCTIONS a rather confusing variable name. So
> > why not "USE_FUNCTIONS" And we can have a FUNCTIONS file optionally
> > exist (and be executable at the grimoire and section level, just like
> > with API_VERSION.
>
> That's even better. What about the semantics if both one at the grimoire
> level and one at the section level exist? Imo it would be best to first
> source the grimoire wide one and then the section level one, that would
> make it possible to provide stuff like a default_python_build at the
> grimoire level that does the usual python install stuff (python
> setup.py, ...).
>
So it goes like this:

source default build api stuff (see load_build_api)
USE_FUNCTION=${USE_FUNCTION:-on}
if [ $USE_FUNCTIONS == "on" ] ; then
[ -x $GRIMOIRE/FUNCTIONS ] && . $GRIMOIRE/FUNCTIONS
[ -x $SECTION_DIRECTORY/FUNCTIONS ] && . $GRIMOIRE/FUNCTIONS
fi

So if theres a file at the grimoire level it overrides whatever it wants from
the standard library, then if the section level file exists then it
overrides anything from both the standard library and the grimoire
functions (regardlesss of whether or not it existed). That is of course
in the case when USE_FUNCTIONS is on, if its off, then we only use
the standard library.

The semantics should be identical to how API_VERSION + BUILD_API works.

-Andrew

--
__________________________________________________________________________
|Andrew D. Stitt | astitt at sourcemage.org |
|irc: afrayedknot | afrayedknot at t.armory.com |
|aim: thefrayedknot or iteratorplusplus | |
|Sorcery Team Lead, Porting Team Lead | |
|Grimoire Guru ham/smgl | ftp://t.armory.com |
|Author and Maintainer of Prometheus | |
--------------------------------------------------------------------------




Archive powered by MHonArc 2.6.24.

Top of Page