diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-23 08:33:45 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-23 08:33:45 +0000 |
commit | 60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab (patch) | |
tree | d20074bef1523c17e8b69e39099ad7c9e5f7e4ec /gurpmi2 | |
parent | a331f6da8a7d9384093c1b3a95a682fd9a2e98be (diff) | |
download | urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.tar urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.tar.gz urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.tar.bz2 urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.tar.xz urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.zip |
don't have a global variable to hold locks, otherwise code can't lock twice
non-exclusive
Diffstat (limited to 'gurpmi2')
-rwxr-xr-x | gurpmi2 | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -91,6 +91,8 @@ my @ask_unselect = urpm::select::unselected_packages($urpm, $state); $mainw->show_all; Gtk2->main; +my ($rpm_lock, $urpmi_lock); + #- Creates and configure an urpm object for this application to use. sub configure_urpm() { my $urpm = new urpm; @@ -119,8 +121,8 @@ sub configure_urpm() { $w->run; $w->destroy; }; - urpm::sys::lock_rpm_db($urpm, 'exclusive'); - urpm::sys::lock_urpmi_db($urpm); + $rpm_lock = urpm::sys::lock_rpm_db($urpm, 'exclusive'); + $urpmi_lock = urpm::sys::lock_urpmi_db($urpm); urpm::media::configure($urpm, root => $gurpmi::options{root}, media => $gurpmi::options{media}, @@ -337,7 +339,7 @@ sub do_install_3 () { } else { $progress_label->set_label(N("Installation finished")); } - urpm::sys::unlock_urpmi_db($urpm); - urpm::sys::unlock_rpm_db($urpm); + urpm::sys::unlock($urpmi_lock); + urpm::sys::unlock($rpm_lock); urpm::removable::try_umounting_removables($urpm); } |