From a5504a8c1878177972e2fe222dc08f6abea42451 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Sun, 5 Mar 2006 08:18:37 +0000 Subject: do not try to load unionfs module if already loaded; perform a depmod before loading unionfs; fix dump_macros creation bug --- iurt2 | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/iurt2 b/iurt2 index 907508d..246074f 100755 --- a/iurt2 +++ b/iurt2 @@ -307,7 +307,19 @@ dump_rpmmacros("$chroot/home/builder/.rpmmacros") or die "FATAL iurt: could not my $unionfs_dir; if ($run{unionfs}) { # FIXME need to grep /proc/modules not ot try to load it if already loaded - system("sudo /sbin/modprobe -f unionfs"); + open my $modules, '/proc/modules'; + my $ok; + while (my $m = <$modules>) { + if ($m =~ /unionfs/) { + $ok = 1; + last + } + } + if (!$ok) { + print {$run{LOG}} "iurt: adding unionfs module\n" if $run{verbose} > 0; + system("sudo /sbin/depmod -a"); + system("sudo /sbin/modprobe -f unionfs"); + } $unionfs_dir = "$config->{local_home}/iurt_unionfs$debug_tag"; clean_all_unionfs($unionfs_dir); -d $unionfs_dir or mkdir $unionfs_dir @@ -924,7 +936,8 @@ sub perform_command { if ($err || $opt{error_regexp} && $output =~ /$opt{error_regexp}/) { if ($opt{mail} && $config->{sendmail} && !$config->{no_mail}{$opt{mail}}) { if (! ($cache->{warning}{$opt{hash}}{$opt{mail}} % $opt{freq})) { - sendmail($opt{mail}, $opt{cc} , $opt{error} , $output, 0, 0, $opt{debug_mail}); + my $cc = join ',', grep { !$config->{no_mail}{$_} } split ',', $opt{cc}; + sendmail($opt{mail}, $cc, $opt{error} , $output, 0, 0, $opt{debug_mail}); } elsif ($config->{admin}) { sendmail($config->{admin}, '' , $opt{error}, $output, 0, 0, $opt{debug_mail}); } @@ -980,6 +993,7 @@ sub dump_rpmmacros { \%distribution $config->{distribution} \%vendor $config->{vendor} \%packager $config->{packager}}; + close $f; -f $file or return 0; 1 } -- cgit v1.2.1