- susetags keys and signatures added as optional resources
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Thu, 26 Feb 2009 18:07:18 +0000 (19:07 +0100)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Thu, 26 Feb 2009 18:07:18 +0000 (19:07 +0100)
- make sure Fetcher pass optional files as non-interactive
- Fixes file does not exist error when key/sig does not exist

zypp/Fetcher.cc
zypp/MediaSetAccess.cc
zypp/repo/susetags/Downloader.cc

index ed89a5d..90827e7 100644 (file)
@@ -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();
 
index 93b559d..0689cb7 100644 (file)
@@ -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
index 1b19733..e83514a 100644 (file)
@@ -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() )