Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] test-sorcery and linux spell

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 AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] test-sorcery and linux spell
  • Date: Tue, 19 Oct 2004 19:21:20 -0700

On Tue, Oct 19, 2004 at 06:38:51PM -0700, Seth Alan Woolley wrote:
> Well, that fixed something else, but not the actual problem you're
> having. Andrew and I spent our afternoon debugging it until we found
> (Andrew found) the fabled IFS finagling in linux's PREPARE had been the
> culprit. As I understand it, a workaround has been added to sorcery to
> make list_add a bit more robust to avoid the issue.
>
> Anybody willing to modify the spell to eliminate the use of IFS, feel
> free to submit a patch.
>
> And let this be a lesson to us all... IFS finagling or the lack of
> quotes, or even worse, the creation of a function that depends a the
> certain status of IFS... all these are Bad Interactions that we should
> avoid in bash where alternatives are available. (Not only do you have
> to protect your IFS finagling from bothering code after you've messed
> with it, but you have to protect subroutines run while you've finagled
> IFS.)

I think dufflebunk sums it up well here [0]. When it comes to playing
with IFS, just say no. Setting IFS made it very difficult to track down
this problem and reproduce it outside of the linux spell because then
everything worked fine. It becomes exceedingly non-obvious why things
are misbehaving when IFS is different. Also, if the code forgets to set
IFS back to its normal value the calling code will still have a strange
value for IFS and act strangely further down the line where its even
less obvious why its happening.

Furthermore, the iterator function is available so that you dont have
to adjust IFS, and that we adjust IFS in exactly one place and one
place only. Iterator is very easy to use, please see me or dufflebunk
if you need help using it.

Just to be clear:

DONT CHANGE IFS. I wont look at any spell/sorcery bug if any of the
spells involved set IFS anywhere. Treat IFS as if it were an internal
sorcery variable.

The following spell files appear to touch IFS
display/directfb/CONFIGURE
http/apache2/CONFIGURE
kernels/boot-theme/CONFIGURE
kernels/linux/PREPARE
kernels/linux/UPDATE_BOOTLOADER
libs/glibc/CONFIGURE
net/samba/DETAILS
net/net-tools/ifup
net/net-tools/ifdown

Id like it if they were all fixed, most of them dont seem to set IFS
for any good reason.

Thanks
Andrew

[0] https://lists.ibiblio.org/sympa/arc/sm-sorcery-bugs/2004-April/003103.html

Attachment: pgppo2eODNygN.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page