Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] Things Spells Should Not Do

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Andrew Stitt <afrayedknot AT thefrayedknot.armory.com>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] Things Spells Should Not Do
  • Date: Mon, 17 Jul 2006 15:21:44 -0700

On Tue, Jul 18, 2006 at 12:09:50AM +0300, Juuso Alasuutari wrote:
> I created a wiki page for listing all the things spells shouldn't do [0].
> Please take a look and add your entries. My idea is that it could be used
> as
> a note pad for what kind of pruning the grimoires still need. Now they
> partly
> resemble the Museum of Sorcery Development. It'd be cool if we would have a
> stable grimoire with a new haircut before 1.0.
>
> [0] http://wiki.sourcemage.org/Things_Spells_Should_Not_Do
>

Exporting variables is not "hazardous to sorcery's mental sanity". The
reason not to export variables is sorcery makes no guarantee that they
will be around in another file. Thereforce even if it works, it works
by accident and may break in the future.


Heres suggestions that immediatly come to mind from the sorcery pov:

* call exit
* modify IFS
* call any sorcery function other than those explicitly listed in libapi
* modify any variable provided by sorcery (excluding OPTS and only during
BUILD
and INSTALL)
* persistent_add any non-conditional variable present in DETAILS (eg, VERSION)
* persistent_add any variable provided by sorcery
* use a variable in a spell that is not declared local, persistent, or is
explicitly provided by sorcery (avoid globals)
* fail from a spell file when a non-fatal error occurs (for example,
many spells call install-info in POST_REMOVE)
* use STAGED_INSTALL=off without first consulting the sorcery team
* use relative paths to find files in the section or grimoire
* refer to files in another section

Heres some other obvious ones
* install to the system outside of INSTALL, POST_INSALL, or FINAL.
* have syntax errors :-)
* mismatch the spell's directory name and $SPELL
* do anything time consuming in DETAILS

Many of these things can be enforced, or are already scanned for with
the spell linter I wrote a while back.

-Andrew



--
_________________________________________________________________________
| Andrew D. Stitt | acedit at armory.com | astitt at sourcemage.org |
| irc: afrayedknot | Sorcery Team Lead | ftp://t.armory.com/ |
| 1024D/D39B096C | 76E4 728A 04EE 62B2 A09A 96D7 4D9E 239B D39B 096C |
-------------------------------------------------------------------------




Archive powered by MHonArc 2.6.24.

Top of Page