ref: refs/heads/master
commit 942ff60c7a9e08ccc7102eaacae5649945ca7906
Author: Duncan Mac-Vicar P
Date: Thu Feb 26 19:07:18 2009 +0100
- susetags keys and signatures added as optional resources
- make sure Fetcher pass optional files as non-interactive
- Fixes file does not exist error when key/sig does not exist
---
zypp/Fetcher.cc | 2 +-
zypp/MediaSetAccess.cc | 3 ++-
zypp/repo/susetags/Downloader.cc | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/zypp/Fetcher.cc b/zypp/Fetcher.cc
index ed89a5d..90827e7 100644
--- a/zypp/Fetcher.cc
+++ b/zypp/Fetcher.cc
@@ -555,7 +555,7 @@ namespace zypp
// try to get the file from the net
try
{
- Pathname tmp_file = media.provideFile(resource);
+ Pathname tmp_file = media.provideFile(resource, resource.optional() ? MediaSetAccess::PROVIDE_NON_INTERACTIVE : MediaSetAccess::PROVIDE_DEFAULT );
Pathname dest_full_path = dest_dir + resource.filename();
diff --git a/zypp/MediaSetAccess.cc b/zypp/MediaSetAccess.cc
index 93b559d..0689cb7 100644
--- a/zypp/MediaSetAccess.cc
+++ b/zypp/MediaSetAccess.cc
@@ -226,7 +226,7 @@ IMPL_PTR_TYPE(MediaSetAccess);
try
{
- DBG << "Going to try to provide file " << file
+ DBG << "Going to try to provide " << (resource.optional() ? "optional" : "") << " file " << file
<< " from media number " << media_nr << endl;
// try to attach the media
if ( ! media_mgr.isAttached(media) )
@@ -281,6 +281,7 @@ IMPL_PTR_TYPE(MediaSetAccess);
// otherwise propagate the error
if ( ( options & PROVIDE_NON_INTERACTIVE ) && reason != media::MediaChangeReport::WRONG)
{
+ MIL << "Can't provide file. Non-Interactive mode." << endl;
ZYPP_RETHROW(excp);
}
else
diff --git a/zypp/repo/susetags/Downloader.cc b/zypp/repo/susetags/Downloader.cc
index 1b19733..e83514a 100644
--- a/zypp/repo/susetags/Downloader.cc
+++ b/zypp/repo/susetags/Downloader.cc
@@ -52,7 +52,7 @@ void Downloader::download( MediaSetAccess &media,
Pathname sig = repoInfo().path() + "/content.asc";
- this->enqueue( OnMediaLocation( sig, 1 ) );
+ this->enqueue( OnMediaLocation( sig, 1 ).setOptional(true) );
this->start( dest_dir, media );
// only if there is a signature in the destination directory
if ( PathInfo(dest_dir / sig ).isExist() )
@@ -61,7 +61,7 @@ void Downloader::download( MediaSetAccess &media,
Pathname key = repoInfo().path() + "/content.key";
- this->enqueue( OnMediaLocation( key, 1 ) );
+ this->enqueue( OnMediaLocation( key, 1 ).setOptional(true) );
this->start( dest_dir, media );
// only if there is a key in the destination directory
if ( PathInfo(dest_dir / key).isExist() )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org