diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-12 00:12:51 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-12 00:12:51 +0000 |
commit | a115cb04b75b27c661551b6395e79b4d96d0fdef (patch) | |
tree | 50dd9ba88e8c26f324ba4ab7e74290b1283caf70 /modulemanager | |
parent | 516da6a00f6c45171eec385bd8b1bd1f1f88cc32 (diff) |
Filter out modules not applicable to the installed inspircd version
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12625 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'modulemanager')
-rwxr-xr-x | modulemanager | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modulemanager b/modulemanager index 8b7108123..41c2c872c 100755 --- a/modulemanager +++ b/modulemanager @@ -101,6 +101,18 @@ getmodules(1); # determine core version `./src/version.sh` =~ /InspIRCd-([0-9.]+)/ or die "Cannot determine inspircd version"; $installed{core} = $1; +for my $mod (keys %modules) { + MODVER: for my $mver (keys %{$modules{$mod}}) { + for my $dep (@{$modules{$mod}{$mver}{depends}}) { + next unless $dep =~ /^core (.*)/; + if (!ver_in_range($installed{core}, $1)) { + delete $modules{$mod}{$mver}; + next MODVER; + } + } + } + delete $modules{$mod} unless %{$modules{$mod}}; +} $modules{core}{$1} = { url => 'NONE', depends => [], |