From 79f1dcddfacb7c9f6acf2c760c06dc97183b18d9 Mon Sep 17 00:00:00 2001 From: Stanislav Visnovsky Date: Tue, 25 Apr 2006 14:39:22 +0000 Subject: [PATCH] - in source refresh, clean up the cache dir if fails - do not require repomd.xml.asc when creating a cache (#163765) --- package/libzypp.changes | 7 +++++++ zypp/source/SourceImpl.cc | 12 +++++++++++- zypp/source/yum/YUMSourceImpl.cc | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/package/libzypp.changes b/package/libzypp.changes index e91b78b..9d8d9ce 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Apr 25 16:34:50 CEST 2006 - visnov@suse.cz + +- in source refresh, clean up the cache dir if fails +- do not require repomd.xml.asc when creating a cache (#163765) +- rev 3224 + +------------------------------------------------------------------- Tue Apr 25 15:17:15 CEST 2006 - dmacvicar@suse.de - Check if a file exists before providing it, and just handling the diff --git a/zypp/source/SourceImpl.cc b/zypp/source/SourceImpl.cc index ef91297..e408fbe 100644 --- a/zypp/source/SourceImpl.cc +++ b/zypp/source/SourceImpl.cc @@ -547,7 +547,17 @@ namespace zypp { // TODO: will this work in chroot? // TODO: better download somewhere else and then copy over - storeMetadata( _cache_dir ); + try{ + storeMetadata( _cache_dir ); + } + catch( const zypp::Exception & excpt ) + { + ERR << "Unable to refresh the source cache" << endl; + if( ! _cache_dir.empty() && _cache_dir != "/" ) + filesystem::clean_dir( _cache_dir ); + + ZYPP_RETHROW( excpt ); + } } void SourceImpl::redirect(unsigned media_nr, const Url & new_url) diff --git a/zypp/source/yum/YUMSourceImpl.cc b/zypp/source/yum/YUMSourceImpl.cc index 5b43ea5..2700d7e 100644 --- a/zypp/source/yum/YUMSourceImpl.cc +++ b/zypp/source/yum/YUMSourceImpl.cc @@ -229,6 +229,9 @@ namespace zypp MIL << "Checking repomd.xml integrity" << endl; Pathname asc_local; try { + media::SilentMediaChange report; + callback::TempConnect< media::MediaChangeReport > nochange(report); + asc_local = provideFile(_path + "/repodata/repomd.xml.asc"); } catch (const Exception & excpt_r) @@ -318,6 +321,9 @@ namespace zypp MIL << "Checking repomd.xml integrity" << endl; Pathname asc_local; try { + media::SilentMediaChange report; + callback::TempConnect< media::MediaChangeReport > nochange(report); + asc_local = provideFile(_path + "/repodata/repomd.xml.asc"); } catch (Exception & excpt_r) -- 2.7.4