Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] adding a temporary is_depends_enabled to test

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] adding a temporary is_depends_enabled to test
  • Date: Thu, 19 Oct 2006 08:31:17 -0700


There should already be something in libcompat that always
returns true or false or something.

Its fine by me, so long as its annotated that its should be removed at
some point and make it clear people shouldn't copy or attempt to re-use
the code inside the function for alternate purposes...

Lastly, if its this useful you should file a bug for integration
into test/stable sorcery. I thought I did that already, but maybe not.

For future reference, simple api accessors typically aren't a problem
to integrate.

-Andrew

On Thu, Oct 19, 2006 at 03:13:08PM +0300, Juuso Alasuutari wrote:
> First of all, let me confess an embarrassing and stupid mistake: I've
> already
> used is_depends_enabled in a few spells in the test grimoire. (Somehow I
> must've thought that seeing the commit message about adding
> is_depends_enabled to stable sorcery meant that it's actually available to
> users right away. By now I'm hoping I really _did_ see that message, and am
> not completely tripping.)
>
> I though I'd fix the spells today using alternative config_query hacks, but
> lazy as I am, I figured I'd ask this first: Could we add an
> is_depends_enabled.function to the test grimoire, and source that in spells
> until it's in stable sorcery? That would help avoid complex manouvres to
> maintain compatibility. Not being able to use is_depends_enabled is also
> complicating things for other people than myself, or at least sobukus
> complained about it earlier today.
>
> I looked at the function in devel sorcery's libstate, modified it a bit,
> and
> ran succesful tests with stable sorcery. I only needed to replace the
> search_depends_status_simple call with a more generic grep approach, as
> that
> function isn't in stable either. Here's what I've got, please tell me if
> it's
> safe for temporary use. As you see it will only load the function when it's
> not available.
>
> if ! declare -f is_depends_enabled &>/dev/null; then
> function is_depends_enabled() {
> local dep_status
> if [[ $3 ]] ; then
> dep_status=$DEPENDS_STATUS
> else
> dep_status=$(hash_get uncommitted_hash $1)
> [[ $dep_status ]] || dep_status=$DEPENDS_STATUS
> fi
> grep -q "^[[:space:]]*$1:$2:on" $dep_status
> }
> fi
>
>
> --
> Juuso Alasuutari
> [[ Source Mage GNU/Linux ]]



> _______________________________________________
> SM-Discuss mailing list
> SM-Discuss AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/sm-discuss


--
_________________________________________________________________________
| 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