diff options
-rwxr-xr-x | mdkupdate | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; |