summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmdkupdate9
1 files changed, 6 insertions, 3 deletions
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;