diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2004-02-20 11:22:30 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2004-02-20 11:22:30 +0000 |
commit | 93606256c71233d2472ca4be7dccf10f1b759c16 (patch) | |
tree | c604b9fa974556c75d2b77ac97b40742eb08a742 | |
parent | 1603d08dffc96d21ea7056acaa8588431fdd394a (diff) | |
download | rpmdrake-93606256c71233d2472ca4be7dccf10f1b759c16.tar rpmdrake-93606256c71233d2472ca4be7dccf10f1b759c16.tar.gz rpmdrake-93606256c71233d2472ca4be7dccf10f1b759c16.tar.bz2 rpmdrake-93606256c71233d2472ca4be7dccf10f1b759c16.tar.xz rpmdrake-93606256c71233d2472ca4be7dccf10f1b759c16.zip |
lock urpmi database while running (#6828)
-rwxr-xr-x | edit-urpm-sources.pl | 25 | ||||
-rw-r--r-- | rpmdrake.spec | 1 |
2 files changed, 20 insertions, 6 deletions
diff --git a/edit-urpm-sources.pl b/edit-urpm-sources.pl index 46ad56ab..62293fc2 100755 --- a/edit-urpm-sources.pl +++ b/edit-urpm-sources.pl @@ -164,7 +164,7 @@ really want to replace it?"), yesno => 1) or return 0; $urpm->remove_selected_media; } add_medium_and_check($urpm, - { probe_with => $probe }, + { probe_with => $probe, nolock => 1 }, $i{name}, $make_url{$type}, $i{hdlist}, update => $type eq 'security'); return 1; } @@ -179,7 +179,7 @@ sub remove_callback { standalone::explanations("Removing medium $name"); $urpm->select_media($name); $urpm->remove_selected_media; - $urpm->update_media(noclean => 1); + $urpm->update_media(noclean => 1, nolock => 1); remove_wait_msg($wait); } @@ -212,14 +212,14 @@ sub edit_callback { standalone::explanations("Removing medium $name"); $urpm->select_media($name); $urpm->remove_selected_media; - add_medium_and_check($urpm, {}, $name, $url, $with_hdlist, update => $update); + add_medium_and_check($urpm, { nolock => 1 }, $name, $url, $with_hdlist, update => $update); return 1; } return 0; } sub update_callback { - update_sources_interactive($urpm, transient => $mainw->{rwindow}); + update_sources_interactive($urpm, transient => $mainw->{rwindow}, nolock => 1); } sub proxy_callback { @@ -605,11 +605,11 @@ sub mainwindow { my %action2fun; %action2fun = ( update_source => sub { slow_func(N("Please wait, updating media..."), - sub { $urpm->update_media(noclean => 1) }); + sub { $urpm->update_media(noclean => 1, nolock => 1) }); }, generate_hdlist => sub { slow_func(N("Please wait, generating hdlist..."), - sub { $urpm->update_media(noclean => 1, force => 1) }); + sub { $urpm->update_media(noclean => 1, force => 1, nolock => 1) }); }); $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label($text)), activate => sub { @@ -677,6 +677,19 @@ or to perform updates.")), yesno => 1) or myexit -1; push @$already_splashed, basename($0); } +{ + $urpm = urpm->new; + 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; + }; + $urpm->exlock_urpmi_db; +} + mainwindow(); $urpm->write_config; diff --git a/rpmdrake.spec b/rpmdrake.spec index 259951a6..665166b1 100644 --- a/rpmdrake.spec +++ b/rpmdrake.spec @@ -121,6 +121,7 @@ rm -rf $RPM_BUILD_ROOT * Thu Feb 19 2004 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1.2-6mdk - edit-urpm-media: fix broken media reordering (program crashed) - rpmdrake: hide password in logs (#6260) +- edit-urpm-media: lock urpmi database while running (#6828) * Fri Feb 13 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.1.2-5mdk - make it embeddable |