From a115cb04b75b27c661551b6395e79b4d96d0fdef Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 12 Mar 2010 00:12:51 +0000 Subject: 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 --- modulemanager | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modulemanager') 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 => [], -- cgit v1.2.3