mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
Allow for string comparison of git IDs.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11488 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
f2f4bf26ce
commit
eb0fb52418
@ -102,6 +102,15 @@ my %todo = %installed;
|
||||
|
||||
sub ver_cmp {
|
||||
($a,$b) = @_ if @_;
|
||||
|
||||
# string versions first, git IDs
|
||||
if ($a =~ /[a-z0-9]{40}/ or $b =~ /[a-z0-9]{40}/)
|
||||
{
|
||||
# it's a string version. compare them as such.
|
||||
return $a ne $b;
|
||||
}
|
||||
|
||||
# else it's probably a numerical type version.. i.e. 1.0
|
||||
my @a = split /\./, $a;
|
||||
my @b = split /\./, $b;
|
||||
push @a, 0 while $#a < $#b;
|
||||
|
Loading…
x
Reference in New Issue
Block a user