Author: jkupec Date: Sat Oct 6 12:16:31 2007 New Revision: 7449 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7449&view=rev Log: - don't check if to refresh cd/dvd repos even on user request unless forced Modified: trunk/zypper/src/zypper-sources.cc trunk/zypper/src/zypper-utils.cc Modified: trunk/zypper/src/zypper-sources.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-sources.cc?rev=7449&r1=7448&r2=7449&view=diff ============================================================================== --- trunk/zypper/src/zypper-sources.cc (original) +++ trunk/zypper/src/zypper-sources.cc Sat Oct 6 12:16:31 2007 @@ -560,19 +560,32 @@ continue; } + // do the refresh + + // raw metadata refresh bool error = false; if (!copts.count("build-only")) { bool force_download = copts.count("force") || copts.count("force-download"); + // without this a cd is required to be present in the drive on each refresh + // (or more 'refresh needed' check) + bool is_cd = is_changeable_media(*repo.baseUrlsBegin()); + if (!force_download && is_cd) + { + MIL << "Skipping refresh of a changeable read-only media." << endl; + continue; + } + MIL << "calling refreshMetadata" << (force_download ? ", forced" : "") << endl; error = refresh_raw_metadata(repo, force_download); } + // db rebuild if (!(error || copts.count("download-only"))) { bool force_build = @@ -657,7 +670,6 @@ // ---------------------------------------------------------------------------- -//! \todo handle zypp exceptions static int add_repo(RepoInfo & repo) { Modified: trunk/zypper/src/zypper-utils.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-utils.cc?rev=7449&r1=7448&r2=7449&view=diff ============================================================================== --- trunk/zypper/src/zypper-utils.cc (original) +++ trunk/zypper/src/zypper-utils.cc Sat Oct 6 12:16:31 2007 @@ -52,6 +52,7 @@ bool is_changeable_media(const zypp::Url & url) { + MIL << "Checking if this is a changeable medium" << endl; bool is_cd = false; try { @@ -63,7 +64,7 @@ catch (const media::MediaException & e) { ZYPP_CAUGHT(e); - WAR << "Could not determine if the URL points to a changeable media" << endl; + WAR << "Could not determine if the URL points to a changeable medium" << endl; } return is_cd; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org