Dependency check themes too
authorJamie Cameron <jcameron@webmin.com>
Wed, 24 Sep 2008 23:21:23 +0000 (23:21 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 24 Sep 2008 23:21:23 +0000 (23:21 +0000)
install-module.pl
webmin/webmin-lib.pl

index 839493d..f45abb5 100755 (executable)
@@ -63,6 +63,7 @@ if (ref($rv)) {
                }
        }
 else {
+       $rv =~ s/<[^>]+>//g;
        print STDERR "Install failed : $rv\n";
        }
 
index 69d9dd6..e167980 100644 (file)
@@ -241,18 +241,20 @@ else {
                return $text{'install_enone'};
                }
 
-       # Get the module.info files to check dependancies
+       # Get the module.info or theme.info files to check dependancies
        local $ver = &get_webmin_version();
        local $tmpdir = &transname();
        mkdir($tmpdir, 0700);
        local $err;
        local @realmods;
        foreach $m (keys %mods) {
-               next if (!$hasfile{$m,"module.info"});
+               next if (!$hasfile{$m,"module.info"} &&
+                        !$hasfile{$m,"theme.info"});
                push(@realmods, $m);
                local %minfo;
-               system("cd $tmpdir ; tar xf \"$file\" $m/module.info ./$m/module.info >/dev/null 2>&1");
-               if (!&read_file("$tmpdir/$m/module.info", \%minfo)) {
+               system("cd $tmpdir ; tar xf \"$file\" $m/module.info ./$m/module.info $m/theme.info ./$m/theme.info >/dev/null 2>&1");
+               if (!&read_file("$tmpdir/$m/module.info", \%minfo) &&
+                   !&read_file("$tmpdir/$m/theme.info", \%minfo)) {
                        $err = &text('install_einfo', "<tt>$m</tt>");
                        }
                elsif (!&check_os_support(\%minfo)) {