Don't complain about deletion when dependency is also being removed
authorJamie Cameron <jcameron@webmin.com>
Mon, 12 May 2008 20:32:19 +0000 (20:32 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 12 May 2008 20:32:19 +0000 (20:32 +0000)
usermin/delete_mod.cgi

index ce065c8..d7edbe2 100755 (executable)
@@ -12,11 +12,14 @@ $access{'umods'} || &error($text{'acl_ecannot'});
 local %miniserv;
 &get_usermin_miniserv_config(\%miniserv);
 
-# check if any other module depends on those to be deleted
+# Check if any other module depends on those to be deleted
+# %depends maps module dirs to the descriptions of those that depend on them
 foreach $minfo (&list_modules()) {
        if (&check_usermin_os_support($minfo)) {
                foreach $d (split(/\s+/, $minfo->{'depends'})) {
-                       $depends{$d} = $minfo->{'desc'};
+                       if (&indexof($minfo->{'dir'}, @mods) < 0) {
+                               $depends{$d} = $minfo->{'desc'};
+                               }
                        }
                }
        }