From: Michael Andres Date: Sun, 22 Feb 2009 14:17:42 +0000 (+0100) Subject: Never refresh repositories from CD/DVD, once they are created. (bnc #476429) X-Git-Tag: 6.6.0~47^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59fdb34aeba2c9dc1a7e924f5766704775cbdb56;p=platform%2Fupstream%2Flibzypp.git Never refresh repositories from CD/DVD, once they are created. (bnc #476429) --- diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index 96657e4..f14291d 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -713,22 +713,25 @@ namespace zypp { MIL << "Going to try to check whether refresh is needed for " << url << endl; - repo::RepoType repokind = info.type(); + // first check old (cached) metadata + Pathname rawpath = rawmetadata_path_for_repoinfo( _pimpl->options, info ); + filesystem::assert_dir(rawpath); + oldstatus = metadataStatus(info); - // if the type is unknown, try probing. - switch ( repokind.toEnum() ) + if ( oldstatus.empty() ) { - case RepoType::NONE_e: - // unknown, probe it - repokind = probe(url); - break; - default: - break; + MIL << "No cached metadata, going to refresh" << endl; + return REFRESH_NEEDED; } - Pathname rawpath = rawmetadata_path_for_repoinfo( _pimpl->options, info ); - filesystem::assert_dir(rawpath); - oldstatus = metadataStatus(info); + { + std::string scheme( url.getScheme() ); + if ( scheme == "cd" || scheme == "dvd" ) + { + MIL << "never refresh CD/DVD" << endl; + return REPO_UP_TO_DATE; + } + } // now we've got the old (cached) status, we can decide repo.refresh.delay if (policy != RefreshForced && policy != RefreshIfNeededIgnoreDelay) @@ -752,9 +755,21 @@ namespace zypp } } - // create temp dir as sibling of rawpath + // To test the new matadta create temp dir as sibling of rawpath filesystem::TmpDir tmpdir( filesystem::TmpDir::makeSibling( rawpath ) ); + repo::RepoType repokind = info.type(); + // if the type is unknown, try probing. + switch ( repokind.toEnum() ) + { + case RepoType::NONE_e: + // unknown, probe it + repokind = probe(url); + break; + default: + break; + } + if ( ( repokind.toEnum() == RepoType::RPMMD_e ) || ( repokind.toEnum() == RepoType::YAST2_e ) ) {