summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-08-04 19:55:26 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-08-04 19:55:26 +0000
commiteb0fb524184baa44aef8eba9dfb07cdeaf279343 (patch)
treec2a876de644f8182ef195e2e26af3b4a4ab07547
parentf2f4bf26ce9d5890a01f1a3b2eddfa211209a5f2 (diff)
Allow for string comparison of git IDs.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11488 e03df62e-2008-0410-955e-edbf42e46eb7
-rwxr-xr-xmodulemanager9
1 files changed, 9 insertions, 0 deletions
diff --git a/modulemanager b/modulemanager
index 255257f6b..96d58834d 100755
--- a/modulemanager
+++ b/modulemanager
@@ -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;