Skip to Content.
Sympa Menu

sm-discuss - [SM-Discuss] meta spells

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Juuso Alasuutari <iuso AT sourcemage.org>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: [SM-Discuss] meta spells
  • Date: Sat, 16 Dec 2006 23:14:12 +0200

I'm still in the blue about what's the best way to handle grouped optional
dependencies. I mean cases where one optional compile flag, if enabled, will
require more than one dependency to be added.

Here are some ways to solve this:

1) The oft-used approach is to config_query about the option, then do 'if
VAR;
then depends foo && depends bar'. This has the problem
that 'dispel --dispel-parent yes foo' will treat the parent as broken, not as
recastable.

2) Another solution is to do 'optional_depends foo && if is_depends_enabled
foo; then depends bar'. Although this causes the first dependency to get
marked as optional, the rest of them still suffer from the same issue as in
1).

3) Adding a meta spell (i.e. dedicated profile spell) is something that would
actually seem to work. If the parent spell optionally depends on "meta",
which only pulls in foo and bar, then all is well. In that
case 'dispel --dispel-parent yes foo' will dispel meta, and that in turn will
prompt to recast the parent spell without the optional dependency "meta".

But we don't seem to have any tradition of using "meta spells" like this. The
profile spells out there are for pulling together big stuff like e.g. the
basesystem. The idea of adding a new profile spell (of the present kind) for
a single optional dependency is certainly a bit of a turn-off.

Yet I can't help but wonder if we could indeed use "meta spells" for handling
grouped optional dependencies. Let's say we add a section called meta in the
grimoire. We'll make use of the soon-to-be spell file inheritance scheme and
put dummy PRE_BUILD, BUILD, and INSTALL files in the section directory. The
spells could have a naming scheme that distinguishes them from the rest, for
instance they could all begin with _. They could be more liberally disposed
of when the occasion arises, i.e. when they're not needed by any spells
anymore.

Although I can't completely wash away the taste of ad-hoc from my mouth when
I
ponder the option, I think it's at least worth a discussion, as it would fit
in well with our present practices. I don't know if I'm alone with my
concern, but I do feel that we should somehow address the problem I've
outlined, be it through "meta spells" or some other means.

--
Juuso Alasuutari
[[ Source Mage GNU/Linux ]]

Attachment: pgptIH34tpZ2V.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page