ref: refs/heads/master
commit 59fdb34aeba2c9dc1a7e924f5766704775cbdb56
Author: Michael Andres
Date: Sun Feb 22 15:17:42 2009 +0100
Never refresh repositories from CD/DVD, once they are created. (bnc #476429)
---
zypp/RepoManager.cc | 41 ++++++++++++++++++++++++++++-------------
1 files changed, 28 insertions(+), 13 deletions(-)
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 ) )
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org