[svn-commits] tzafrir: trunk r778 - /trunk/contrib/menuselect-dummy
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Jun 16 12:09:22 CDT 2010
Author: tzafrir
Date: Wed Jun 16 12:09:18 2010
New Revision: 778
URL: http://svnview.digium.com/svn/menuselect?view=rev&rev=778
Log:
better handling of missing deps (TEST_FRAMEWORK)
TEST_FRAMEWORK and other flags from the cflags-devmode.xml would only be
available if you configured asterisk with --enable-dev-mode. Yet some
modules depend on them. This breaks our sanity check that a missing
dependency is probably the result of a typo or a bug.
* Don't allow enabling a module if a dependency is missing.
* Add some information about it to our DB.
Modified:
trunk/contrib/menuselect-dummy
Modified: trunk/contrib/menuselect-dummy
URL: http://svnview.digium.com/svn/menuselect/trunk/contrib/menuselect-dummy?view=diff&rev=778&r1=777&r2=778
==============================================================================
--- trunk/contrib/menuselect-dummy (original)
+++ trunk/contrib/menuselect-dummy Wed Jun 16 12:09:18 2010
@@ -443,6 +443,21 @@
}
}
+# We found a dependency we don't know about. Warn the user, and add
+# information about it:
+sub handle_unknown_dep($$) {
+ my ($dep_mod, $mod) = @_;
+
+ my $mod_info = {
+ Type => 'Unknown',
+ Avail => 0,
+ Checked => 0,
+ };
+ $ModInfo{$dep_mod} = $mod_info;
+
+ warning "Unknown dependency module $dep_mod (for e.g. $mod)\n";
+}
+
# recursively check dependency for a module.
#
# We run a scan for modules. Modules marked as 'Checked' are ones we
@@ -481,9 +496,8 @@
foreach my $dep_mod (@{$ModInfo{$mod}{Depend}} ) {
if (!exists ${ModInfo}{$dep_mod}) {
- # TODO: die here? This should never happen.
- warning "module $mod depends on $dep_mod that does not exist.";
- next;
+ handle_unknown_dep($dep_mod, $mod);
+ return 0;
}
$deps_checked &= check_module($dep_mod);
last if(!$deps_checked) # no point testing further if we failed.
More information about the svn-commits
mailing list