diff options
author | Pascal Terjan <pterjan@mageia.org> | 2012-03-12 18:13:57 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2012-03-12 18:13:57 +0000 |
commit | e5fefd376242c7024cce11b6b2e62749aed53bd9 (patch) | |
tree | 1e6dbca5288acca174a672b4cb217679abe6980b /lib/Iurt | |
parent | 795d8a847ba15ee5d5d8fd1eda8742e41b4d90e5 (diff) | |
download | iurt-e5fefd376242c7024cce11b6b2e62749aed53bd9.tar iurt-e5fefd376242c7024cce11b6b2e62749aed53bd9.tar.gz iurt-e5fefd376242c7024cce11b6b2e62749aed53bd9.tar.bz2 iurt-e5fefd376242c7024cce11b6b2e62749aed53bd9.tar.xz iurt-e5fefd376242c7024cce11b6b2e62749aed53bd9.zip |
Never manually write to log file
Diffstat (limited to 'lib/Iurt')
-rw-r--r-- | lib/Iurt/Config.pm | 6 | ||||
-rw-r--r-- | lib/Iurt/DKMS.pm | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/Iurt/Config.pm b/lib/Iurt/Config.pm index c2fbe6d..33d822f 100644 --- a/lib/Iurt/Config.pm +++ b/lib/Iurt/Config.pm @@ -137,7 +137,7 @@ sub init_cache { my $cachefile = "$config->{cache_home}/$program_name.cache"; my $cache; if (-f $cachefile) { - $run->{LOG}->("$program_name: loading cache file $cachefile\n"); + plog('DEBUG', "loading cache file $cachefile"); $cache = eval(cat_($cachefile)) or print "FATAL $program_name: could not load cache $cachefile ($!)\n"; } else { $cache = $empty; @@ -166,9 +166,9 @@ sub dump_cache { $Data::Dumper::Terse = 1; print $file Data::Dumper->Dump([ $cache ], [ "cache" ]); # flock does not work on network files and lockf seems to fail too - $run->{LOG}->("$program_name: locking to dump the cache in $filename\n"); + plog('DEBUG', "locking to dump the cache in $filename"); if (-f "$filename.lock") { - $run->{LOG}->("ERROR iurt: manual file lock exist, do not save the cache\n"); + plog('ERROR', 'ERROR: manual file lock exist, do not save the cache'); } else { open my $lock, ">$filename.lock"; print $lock $$; diff --git a/lib/Iurt/DKMS.pm b/lib/Iurt/DKMS.pm index 535e822..d5613e8 100644 --- a/lib/Iurt/DKMS.pm +++ b/lib/Iurt/DKMS.pm @@ -238,7 +238,7 @@ sub dkms_compile { plog('DEBUG', "symlink from $modules_build_dir to /usr/src/$sourcedir"); if (system("sudo ln -sf /usr/src/$sourcedir $modules_build_dir")) { - plog('ERROR', "linking failed ($!)"); + plog('ERROR', "ERROR: linking failed ($!)"); next; } } @@ -282,13 +282,13 @@ sub dkms_compile { if (system("cp $rpms $dkms_spool/$media/ &>/dev/null") == 0) { $copied = 1; sudo($run, $config, '--rm', $rpms) - or $run->{LOG}->("ERROR: could not delete dkms packages from $rpms ($!)\n"); + or plog('ERROR', "ERROR: could not delete dkms packages from $rpms ($!)"); last; } } - $run->{LOG}->("ERROR: could not copy dkms packages from " . + plog('ERROR', "ERROR: could not copy dkms packages from " . join(" or ", map { "$chroot_tmp$_/*.rpm" } @dkms_rpm_dirs) . - " to $dkms_spool/$media ($!)\n") if !$copied; + " to $dkms_spool/$media ($!)") if !$copied; process_dkms_queue($self, 0, 0, $media, "$dkms_spool/$media"); # compile dkms modules |