[BACK]Return to pkg-config CVS log [TXT][DIR] Up to [local] / src / usr.bin / pkg-config

Diff for /src/usr.bin/pkg-config/pkg-config between version 1.47 and 1.48

version 1.47, 2011/06/06 11:16:59 version 1.48, 2011/06/06 11:18:55
Line 588 
Line 588 
         while (@a && @b) { #so long as both lists have something          while (@a && @b) { #so long as both lists have something
                 if (!(@suffix_a || @suffix_b)) {                  if (!(@suffix_a || @suffix_b)) {
                         # simple comparison when no suffixes are in the game.                          # simple comparison when no suffixes are in the game.
                         return 1 if $a[0] > $b[0];                          my $rc = compare_numeric($a[0], $b[0], 0);
                         return -1 if $a[0] < $b[0];                          return $rc if defined($rc);
                 } else {                  } else {
                         # extended comparison.                          # extended comparison.
                         if (((scalar(@a) == 1) || (scalar(@b) == 1)) &&                          if (((scalar(@a) == 1) || (scalar(@b) == 1)) &&
Line 607 
Line 607 
                                         # suffixes are equal, compare on numeric                                          # suffixes are equal, compare on numeric
                                         if (&$first_char($suffix_a[0]) eq                                          if (&$first_char($suffix_a[0]) eq
                                             &$first_char($suffix_b[0])) {                                              &$first_char($suffix_b[0])) {
                                                 return 0 if ($suffix_a[1] == $suffix_b[1]);                                                  return compare_numeric($suffix_a[1], $suffix_b[1], 1);
                                                 return 1 if ($suffix_a[1] > $suffix_b[1]);  
                                                 return -1 if ($suffix_a[1] < $suffix_b[1]);  
                                         }                                          }
   
                                         # rc beats beta beats alpha                                          # rc beats beta beats alpha
Line 637 
Line 635 
                                 }                                  }
   
                         } else {                          } else {
                                 return 1 if $a[0] > $b[0];                                  my $rc = compare_numeric($a[0], $b[0], 0);
                                 return -1 if $a[0] < $b[0];                                  return $rc if defined($rc);
                         }                          }
   
                 }                  }
Line 647 
Line 645 
         return 1 if @a;          return 1 if @a;
         return -1 if @b;          return -1 if @b;
         return 0;          return 0;
   }
   
   # simple numeric comparison, with optional equality test.
   sub compare_numeric
   {
           my ($x, $y, $eq) = @_;
   
           return 1 if $x > $y;
           return -1 if $x < $y;
           return 0 if (($x == $y) and ($eq == 1));
           return undef;
 }  }
   
 # got a package meeting the requested specific version?  # got a package meeting the requested specific version?

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48