From 1499cc65dbbaa08485adbaa5a5f70dfee66d39e4 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 14 Feb 2008 16:17:09 +0000 Subject: (run) do not exit if urpmi db, just return so that rpmdrake doesn't exit then (no behavior change for edit-urpm-sources) --- Rpmdrake/edit_urpm_sources.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Rpmdrake/edit_urpm_sources.pm') diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm index 2222b644..12e4a3a2 100644 --- a/Rpmdrake/edit_urpm_sources.pm +++ b/Rpmdrake/edit_urpm_sources.pm @@ -1164,16 +1164,21 @@ sub run() { my $lock; { $urpm = fast_open_urpmi_db(); + my $err_msg = "urpmdb locked\n"; local $urpm->{fatal} = sub { interactive_msg('rpmdrake', N("Packages database is locked. Please close other applications working with packages database (do you have another media manager on another desktop, or are you currently installing packages as well?).")); - myexit -1; + die $err_msg; }; # lock urpmi DB - $lock = urpm::lock::urpmi_db($urpm, 'exclusive', wait => $urpm->{options}{wait_lock}); + eval { $lock = urpm::lock::urpmi_db($urpm, 'exclusive', wait => $urpm->{options}{wait_lock}) }; + if (my $err = $@) { + return if $err eq $err_msg; + die $err; + } } my $res = mainwindow(); -- cgit v1.2.1