From dc7a05051d98990d658078e59124147a02354888 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 8 Dec 2008 16:27:53 +0000 Subject: log more stuff --- mdkupdate | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mdkupdate') diff --git a/mdkupdate b/mdkupdate index c91e8bf7..8b8a5ec2 100755 --- a/mdkupdate +++ b/mdkupdate @@ -85,17 +85,20 @@ my $in; $noX and $in = interactive->vnew; --e $logfile and system "/bin/rm", $logfile; +-e $logfile and rm_rf($logfile); my $ret = update_pkgs(); - $ret == 1 or output_p($logfile, "[mdkupdate] Error 100: Packages failed to upgrade"); + if ($ret != 1) { + output_p($logfile, "[mdkupdate] Error 100: Packages failed to upgrade"); + log::explanations("[mdkupdate] Error 100: Packages failed to upgrade"); + } clean_dir(); sub update_pkgs { my (@pkgs) = @_; eval { - system '/usr/sbin/urpmi', '--auto-update', '--auto', '--keep', '--update', map { if_(/(.*)-[^-]*-[^-]*\.[^-.]*?\.rpm$/, $1) } @pkgs; + run_program::run('/usr/sbin/urpmi', '--auto-update', '--auto', '--keep', '--update', map { if_(/(.*)-[^-]*-[^-]*\.[^-.]*?\.rpm$/, $1) } @pkgs); $? == 0 or die N("Unable to update packages from update_source medium.\n"); }; $@ and output_p($logfile, "[mdkupdate] Error 99: $@"), return 0; -- cgit v1.2.1