summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@cohens.org.il>2010-06-16 19:58:15 +0300
committerTzafrir Cohen <tzafrir@cohens.org.il>2010-06-16 19:58:15 +0300
commitaa6678805fe18eb6d22a63295f393368c4b3fb2b (patch)
treee6c2f946975fec98c98c658de38a6bf1a9bbe732
parent0769405b9fc35c396996a238fb8330ac8bc00db8 (diff)
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.
-rwxr-xr-xmenuselect/menuselect20
1 files changed, 17 insertions, 3 deletions
diff --git a/menuselect/menuselect b/menuselect/menuselect
index 20daead..0530a8b 100755
--- a/menuselect/menuselect
+++ b/menuselect/menuselect
@@ -443,6 +443,21 @@ sub apply_default_enabled() {
}
}
+# 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 @@ sub check_module($) {
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.