Author: jkupec Date: Wed Mar 19 13:42:40 2008 New Revision: 9200 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9200&view=rev Log: - don't detect devices multiple times after ejecting Modified: trunk/libzypp/zypp/MediaSetAccess.cc Modified: trunk/libzypp/zypp/MediaSetAccess.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/MediaSetAccess.cc?rev=9200&r1=9199&r2=9200&view=diff ============================================================================== --- trunk/libzypp/zypp/MediaSetAccess.cc (original) +++ trunk/libzypp/zypp/MediaSetAccess.cc Wed Mar 19 13:42:40 2008 @@ -232,18 +232,25 @@ catch ( media::MediaException & excp ) { ZYPP_CAUGHT(excp); - media::MediaChangeReport::Action user; + media::MediaChangeReport::Action user = media::MediaChangeReport::ABORT; + unsigned int devindex = 0; + vector<string> devices; + media_mgr.getDetectedDevices(media, devices, devindex); + do { - DBG << "Media couldn't provide file " << file << " , releasing." << endl; - try + if (user != media::MediaChangeReport::EJECT) // no use in calling this again { - media_mgr.release (media); - } - catch (const Exception & excpt_r) - { - ZYPP_CAUGHT(excpt_r); - MIL << "Failed to release media " << media << endl; + DBG << "Media couldn't provide file " << file << " , releasing." << endl; + try + { + media_mgr.release(media); + } + catch (const Exception & excpt_r) + { + ZYPP_CAUGHT(excpt_r); + MIL << "Failed to release media " << media << endl; + } } // set up the reason @@ -260,14 +267,11 @@ reason = media::MediaChangeReport::WRONG; } - unsigned int devindex = 0; - vector<string> devices; if (checkonly) user = media::MediaChangeReport::ABORT; else { - media_mgr.getDetectedDevices(media, devices, devindex); // release all media before requesting another (#336881) media_mgr.releaseAll(); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org