summaryrefslogtreecommitdiffstats
path: root/t/helper.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-03-23 10:55:09 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-03-23 10:55:09 +0000
commit9d4665648bb9efd087fdcd5de36a7dfa75479f85 (patch)
tree2ac9b5fa7a7bb367089be330db845add06224075 /t/helper.pm
parent7b3158360b025839218a4716c228fd270cb8c17f (diff)
downloadurpmi-9d4665648bb9efd087fdcd5de36a7dfa75479f85.tar
urpmi-9d4665648bb9efd087fdcd5de36a7dfa75479f85.tar.gz
urpmi-9d4665648bb9efd087fdcd5de36a7dfa75479f85.tar.bz2
urpmi-9d4665648bb9efd087fdcd5de36a7dfa75479f85.tar.xz
urpmi-9d4665648bb9efd087fdcd5de36a7dfa75479f85.zip
catch "module Net::Server::Simple is missing" case
Diffstat (limited to 't/helper.pm')
-rw-r--r--t/helper.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/helper.pm b/t/helper.pm
index fe8bfb57..58499a7f 100644
--- a/t/helper.pm
+++ b/t/helper.pm
@@ -23,11 +23,13 @@ sub need_root_and_prepare() {
isnt(-d 'root', "test root dir can not be removed $!");
mkdir 'root';
$using_root = 1;
+ $ENV{LC_ALL} = 'C';
}
my $server_pid;
sub httpd_port { 6969 }
sub start_httpd() {
+ system('perl -MNet::Server::Single -e 1') == 0 or die "module Net::Server::Simple is missing (package perl-Net-Server)\n";
$server_pid = fork();
if ($server_pid == 0) {
exec './simple-httpd', $::pwd, "$::pwd/tmp", httpd_port();
@@ -44,8 +46,9 @@ my $urpmi_debug_opt = '-q';
#$urpmi_debug_opt = '-v --debug';
sub urpm_cmd {
- my ($prog) = @_;
- "perl -I.. ../$prog --urpmi-root $::pwd/root";
+ my ($prog, $o_perl_para) = @_;
+ $o_perl_para ||= '';
+ "perl $o_perl_para -I.. ../$prog --urpmi-root $::pwd/root";
}
sub urpmi_cmd() { urpm_cmd('urpmi') }