]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (usage): Rewrote code to handle columnization.
authorTom Tromey <tromey@redhat.com>
Sun, 15 Jul 2001 22:17:18 +0000 (22:17 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 15 Jul 2001 22:17:18 +0000 (22:17 +0000)
From Alexey Mahotkin and Maxim Sinev.

ChangeLog
THANKS
automake.in

index e39f0a28b61f53e2817382bc8a03a987d2c9512b..c5dd148f47d59503cda9f1ff811f030be6b30b7e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-07-15  Tom Tromey  <tromey@redhat.com>
 
+       * automake.in (usage): Rewrote code to handle columnization.
+       From Alexey Mahotkin and Maxim Sinev.
+
        Report from Ralf Corsepius:
        * automake.in (TARGET_PATTERN): Add `+' as valid character.
        (SUFFIX_RULE_PATTERN): Likewise.
diff --git a/THANKS b/THANKS
index 96291e921da18082be05d394be4726d279d2762c..9d9709075677c21140347ae0eea8b07d1578b316 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -7,6 +7,7 @@ Akim Demaille           akim@freefriends.org
 Alex Hornby            alex@anvil.co.uk
 Alexandre Duret-Lutz   duret_g@epita.fr
 Alexander V. Lukyanov  lav@yars.free.net
+Alexey Mahotkin                alexm@hsys.msk.ru
 Andreas Schwab         schwab@lamothe.informatik.uni-dortmund.de
 Andrew Cagney          cagney@tpgi.com.au
 Andris Pavenis         pavenis@lanet.lv
@@ -93,6 +94,7 @@ Markus F.X.J. Oberhumer       k3040e4@wildsau.idv-edu.uni-linz.ac.at
 Matt Leach             mleach@cygnus.com
 Matthew D. Langston    langston@SLAC.Stanford.EDU
 Matthias Clasen                clasen@mathematik.uni-freiburg.de
+Maxim Sinev            good@goods.ru
 Michael Brantley       Michael-Brantley@deshaw.com
 Michel de Ruiter       mdruiter@cs.vu.nl
 Miles Bader            miles@ccs.mt.nec.co.jp
index 63f33920cec86d37df2a46e0f99d30841add1356..471a2350e4f078b62f48522970fcccb5a88dff24 100755 (executable)
@@ -7878,31 +7878,41 @@ EOF
        $last = $iter;
     }
 
-    my ($one, $two, $three, $four, $max);
+    my @four;
     print "\nFiles which are automatically distributed, if found:\n";
     format USAGE_FORMAT =
   @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<   @<<<<<<<<<<<<<<<<
-  $one,               $two,               $three,             $four
+  $four[0],           $four[1],           $four[2],           $four[3]
 .
     $~ = "USAGE_FORMAT";
-    $max = int (($#lcomm + 1) / 4);
 
-    for (my $i = 0; $i < $max; ++$i)
+    my $cols = 4;
+    my $rows = int(@lcomm / $cols);
+    my $rest = @lcomm % $cols;
+
+    if ($rest)
     {
-       $one = $lcomm[$i];
-       $two = $lcomm[$max + $i];
-       $three = $lcomm[2 * $max + $i];
-       $four = $lcomm[3 * $max + $i];
-       write;
+       $rows++;
+    }
+    else
+    {
+       $rest = $cols;
     }
 
-    my $mod = ($#lcomm + 1) % 4;
-    if ($mod != 0)
+    for (my $y = 0; $y < $rows; $y++)
     {
-       $one = $lcomm[$max];
-       $two = ($mod > 1) ? $lcomm[2 * $max] : '';
-       $three = ($mod > 2) ? $lcomm[3 * $max] : '';
-       $four = ($mod > 3) ? $lcomm[4 * $max] : '';
+       @four = ("", "", "", "");
+       for (my $x = 0; $x < $cols; $x++)
+       {
+           last if $y + 1 == $rows && $x == $rest;
+
+           my $idx = (($x > $rest)
+                      ?  ($rows * $rest + ($rows - 1) * ($x - $rest))
+                      : ($rows * $x));
+
+           $idx += $y;
+           $four[$x] = $lcomm[$idx];
+       }
        write;
     }