Skip to content

Commit

Permalink
(check-update) remove unconditional comment lines. Add quick escape f…
Browse files Browse the repository at this point in the history
…rom sub CompareVersion_make_equal_length()
  • Loading branch information
makoto-fujiwara committed May 1, 2017
1 parent fcf0eaf commit 995f0ec
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions check-update
Expand Up @@ -1401,18 +1401,17 @@ sub CompareVersion_make_equal_length($$) {
my $a = shift;
my $b = shift;
my $diff = length($a) - length($b);
if (substr($a, 0, 1 ) ne '0' ) { return ($a, $b);}
if (substr($b, 0, 1 ) ne '0' ) { return ($a, $b);}
if ($diff == 0) {}
else {
if (substr($a, 0, 1 ) eq 0 &&
substr($b, 0, 1 ) eq 0 ) {
if ($diff > 0 ) {
while ($diff--) {
$b .='0';
}
} else {
while ($diff++ < 0) {
$a .='0';
}
if ($diff > 0 ) {
while ($diff--) {
$b .='0';
}
} else {
while ($diff++ < 0) {
$a .='0';
}
}
}
Expand Down Expand Up @@ -1440,19 +1439,18 @@ sub CompareVersion($$){
if ($a[0] > $b[0]) { return 1;}
if ($a[0] < $b[0]) { return -1;}
if ($a[0] == $b[0]) {
# if ( $max_count = 1 ) {return 0;}
# if ( $max_count == 1 ) {return 0;}
if ( $max_count == 2 ) {
print STDERR sprintf("%4d ", __LINE__), 'max count: ', $max_count, 'a: ', $a, ' b: ',$b,"\n";
# print STDERR sprintf("%4d ", __LINE__), 'max count: ', $max_count, 'a: ', $a, ' b: ',$b,"\n";
($a[1], $b[1]) = CompareVersion_make_equal_length($a[1], $b[1]); # 0.043 > 0.0301
# above line is harmfull for (pango) 1.40.3 -> 1.40.5 or 1.9.1
}
if ($a[1] > $b[1]) { return 1;}
if ($a[1] < $b[1]) { return -1;}
if ($a[1] ne $b[1]) {
# print STDERR sprintf("%4d ", __LINE__ ), ' ', '$a[1]: ', $a[1], ' $b[1]: ', $b[1], "\n";
return $a[1] cmp $b[1];} # arc-5.21[op]
if ($a[1] == $b[1]) {
# if ( $max_count = 1 ) { return 0;}
# if ( $max_count == 1 ) { return 0;}
if ($a[2] =~ /rc/ ) {$a[2] =~ s/rc.*//;}
if ($b[2] =~ /rc/ ) {$b[2] =~ s/rc.*//;}
# print STDERR sprintf("%4d ", __LINE__ ), ' ', '$a[2]: ', $a[2], ' $b[2]: ', $b[2], "\n";
Expand Down Expand Up @@ -4593,8 +4591,8 @@ print STDERR sprintf("%4d ", __LINE__ ),
($Github_no_release, $returnCode, @CANDIDATE) = GitHubSpecial($DISTBASE, $HOMEPAGE, $dir, $PackageName);
push(@candidate, @CANDIDATE);
if ($Github_no_release) {
print STDERR sprintf("%4d <", __LINE__ ), (caller 0)[3], '>:', (caller 0)[2], ': ', "\n",join ("\n", @candidate ), "\n";
print STDERR sprintf("%4d <", __LINE__ ), (caller 0)[3], '>:', (caller 0)[2], ': ', $PKGVERSION,"\n";
# print STDERR sprintf("%4d <", __LINE__ ), (caller 0)[3], '>:', (caller 0)[2], ': ', "\n",join ("\n", @candidate ), "\n";
# print STDERR sprintf("%4d <", __LINE__ ), (caller 0)[3], '>:', (caller 0)[2], ': ', $PKGVERSION,"\n";
push(@candidate, $PKGVERSION); # add current version onto @candidate, if no release on github
}
print STDERR sprintf("%4d <", __LINE__ ), (caller 0)[3], '>:', " -------------\n", (caller 0)[2], ': ', "\n",join ("\n", @candidate),"\n" if $DEBUG_CANDIDATE ;
Expand Down

0 comments on commit 995f0ec

Please sign in to comment.