\n"; # Untar the perl module $mod_dir = &transname($dirs[$i]); ($mod_par = $mod_dir) =~ s/\/[^\/]+$//; system("rm -rf $mod_dir >/dev/null 2>&1"); &show_output($text{'install_untar'}, $mod_par, "gunzip -c $pfile[$i] | tar xvf -"); if (-r "$mod_dir/Makefile.PL") { # Run Makefile.PL and make &show_output($text{'install_make'}, $mod_dir, "$perl_path Makefile.PL $in{'args'} && make") || &build_error(); # Run make test (if requested) if ($in{'act'} == 1 || $in{'act'} == 3) { &show_output($text{'install_test'}, $mod_dir, "make test") || &build_error(); } # Run make install (if requested) if ($in{'act'} == 2 || $in{'act'} == 3) { &show_output($text{'install_install'}, $mod_dir, "make install") || &build_error(); } } else { # Run Build.PL and Build &show_output($text{'install_make'}, $mod_dir, "$perl_path Build.PL $in{'args'} && ./Build") || &build_error(); # Run Build test (if requested) if ($in{'act'} == 1 || $in{'act'} == 3) { &show_output($text{'install_test'}, $mod_dir, "./Build test") || &build_error(); } # Run Build install (if requested) if ($in{'act'} == 2 || $in{'act'} == 3) { &show_output($text{'install_install'}, $mod_dir, "./Build install") || &build_error(); } } # Clean up files print "
",&text('install_done_'.$in{'act'}, "$mods[$i]"), "
\n"; system("rm -rf $mod_dir") if ($mod_dir && -d $mod_dir); } &clean_up(1); # clean_up(success) sub clean_up { system("rm -rf $mod_dir") if ($mod_dir && -d $mod_dir); unlink(@pfile) if ($in{'need_unlink'} && (!$config{'save_partial'} || $_[0])); &ui_print_footer($in{'return'}, $in{'returndesc'} || $text{'index_return'}); } # show_output(desc, dir, command) sub show_output { local (%seen, $endless_loop); print &ui_table_start($_[0], undef, 2); local $msg = "
".&text('install_exec', $_[2])."\n"; $msg .= (" " x 100)."\n"; open(CMD, "(cd $_[1] ; $_[2]) 2>&1 ) { if ($seen{$_}++ > 100) { $endless_loop = 1; $msg .= "\n$text{'install_loop'}\n"; last; } while(length($_) > 100) { s/^(.{100})//; $msg .= &html_escape($1)."\n"; } $msg .= &html_escape($_); } close(CMD); $msg .= "
",&text('install_err', "$mods[$i]"),"\n"; if ($in{'source'} == 3) { print &text('install_err2', "perl -MCPAN -e shell"),"\n"; } print "
\n"; if ($in{'need_unlink'} && $config{'save_partial'}) { # File needs to be deleted print &text('install_needunlink', "delete_file.cgi?". join("&", map { "file=".&urlize($_) } @pfile)),"
\n"; } &clean_up(0); exit; }