fptools/configure thinks happy 1.10 < 1.9

Volker Stolz stolz at I2.Informatik.RWTH-Aachen.DE
Fri Jan 26 08:57:58 EST 2001


My happy is 1.10, everything fresh from cvs:
--->
checking for happy... /home/stolz/Linux/haskell/ghc-4.08.1/bin/happy
checking for version of happy... 
Happy version 1.9 or later is required to compile GHC.
<---

And in a sense, it is right. I'd really like to come up with a fix, but
I guess...

@split0 = split(/\./,$ARGV[0]);
@split1 = split(/\./,$ARGV[1]);

@bools = zipWith(\@split0,\@split1);
$lt   = fold(\&oder,\@bools);
exit $lt;

sub zipWith {
  my ($l1,$l2) = @_;
  $h1 = shift @$l1;
  $h2 = shift @$l2;
  if ((defined($h1)) || (defined($h2))){
    return (($h1 < $h2),zipWith($l1,$l2));
  } else {
    return ();
  }
}

sub fold {
  my ($f,$args) = @_;
  my $tmp = 0;
  foreach $arg (@$args) {
    $tmp = &$f($tmp,$arg);
  }
  return $tmp;
}

sub oder {
  return ($_[0] || $_[1]);
}

...is too long for a perl one-liner in configure. Or would anyone like to
go for "ghc -e -n 'foldl ... (zipWith ... (split ...))'"? It should be even
smaller; I didn't manage to inline all the things I wanted to in the perl
script. Anyway, it works, it checks if the first argument is less than the
second:

> perl vers.pl "1.9" "1.10" ; echo $?
1
> perl vers.pl "4.08.1" "4.08"; echo $?
0 

Got to take my pills now,
   Volker
-- 
Volker Stolz * stolz at i2.informatik.rwth-aachen.de * PGP + S/MIME




More information about the Glasgow-haskell-bugs mailing list