[EMAIL PROTECTED] wrote:

> True. I just noticed this afternoon that the install script will uncomment
> the line 
> 
> ;extension=midgard.so 
> 
> if it is present, but will do nothing if it is not there. Don't know how
> to solve that gracefully yet.

I don't think the attached script would fall in the 'graceful'
category, but maybe it could qualify for the 'useful' category.

Emile
#!/bin/sh
exec perl -x $0 $@

#!perl

$phpini = $ARGV[0];

-f $phpini || die "Cannot find init file '$phpini'\n";

open(F,"<$phpini") || die "Cannot open '$phpini': $!\n";

while (<F>) {
   print;
   /^\[PHP\]/ && last;
}

while (<F>) {
   if (/^;*extension=midgard.so/) {
      $mgdpresent = 1;
   }
   if (/^\[/) {
      if (!$mgdpresent) {
         print ";extension=midgard.so\n";
         $mgdpresent = 1;
      }
      print;
      last;
   }

   print;
}

if (!$mgdpresent) { print ";extension=midgard.so\n"; }

while (<F>) { print; }
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to