https://bugzilla.novell.com/show_bug.cgi?id=266179 ------- Comment #2 from locilka@novell.com 2007-04-19 07:45 MST ------- Using opendir, readdir, closedir rather than 'find' It cheaper to use Perl built-in functions Index: UsersPlugins.pm =================================================================== --- UsersPlugins.pm (revision 37587) +++ UsersPlugins.pm (working copy) @@ -29,21 +29,18 @@ # + initialize the hash of plugin interface BEGIN { $TYPEINFO{Read} = ["function", "boolean"]; } sub Read { - - my $find = "/usr/bin/find ".Directory->moduledir(); - $find .= " -name 'UsersPlugin*.*'"; #TODO use some variable for the name - my $out = SCR->Execute (".target.bash_output", $find); - my $modules = $out->{"stdout"} || ""; - - foreach my $module (split (/\n/, $modules)) { - my @mod = split (/\//, $module); - my $m = $mod[-1] || ""; - $m =~ s/\.ycp$//g; # YCP modules cannot be called as variables... - $m =~ s/\.pm$//g; - if ($m ne "" && $m ne "UsersPlugins") { - push @available_plugins, $m; + opendir (MODULEDIR, Directory->moduledir()) || do { + y2error ("Cannot open directory '".Directory->moduledir()."'"); + return 0; + }; + my $module = ""; + foreach $module (readdir(MODULEDIR)) { + if ($module =~ s/^(UsersPlugin.+)\..+$/$1/ && + $module ne 'UsersPlugins') { + push @available_plugins, $module; } } + close (MODULEDIR); foreach my $module (@available_plugins) { y2milestone ("Available plugin: $module"); -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.