- support 'patterns.pat' and 'patterns.pat.gz' to read all
authorKlaus Kaempf <kkaempf@suse.de>
Thu, 17 Jan 2008 11:04:22 +0000 (11:04 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Thu, 17 Jan 2008 11:04:22 +0000 (11:04 +0000)
  patterns in one go.

package/libzypp.changes
zypp/parser/susetags/RepoParser.cc
zypp/repo/susetags/Downloader.cc

index 17ca9c9..9b72fc5 100644 (file)
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Thu Jan 17 12:03:10 CET 2008 - kkaempf@suse.de
+
+- support 'patterns.pat' and 'patterns.pat.gz' to read all
+  patterns in one go.
+- rev 8309
+
+-------------------------------------------------------------------
 Tue Jan 15 14:56:21 CET 2008 - lslezak@suse.cz
 
 - added RpmDb::removePubkey(), call it from
index 4a3e593..3ffe2b3 100644 (file)
@@ -488,7 +488,16 @@ namespace zypp
        for ( RepoIndex::FileChecksumMap::const_iterator it = _repoIndex->metaFileChecksums.begin();
              it != _repoIndex->metaFileChecksums.end(); ++it )
         {
-          if ( isPatternFile( it->first ) )
+         Pathname inputfile;
+         inputfile = "";
+         
+         if ( it->first == "patterns.pat"
+              || it->first == "patterns.pat.gz" )
+         {
+           // read all patterns in one go
+           inputfile = getOptionalFile( _descrdir / it->first, false /*filename already contains .gz */ );
+         }
+         else if ( isPatternFile( it->first ) )
           {
             // *** see also zypp/repo/susetags/Downloader.cc ***
 
@@ -525,16 +534,16 @@ namespace zypp
                 // keep .pat file if it doesn't contain an recognizable arch
               }
             }
+           inputfile = getOptionalFile( _descrdir / it->first, false /*filename already contains .gz */ );
 
-           Pathname inputfile( getOptionalFile( _descrdir / it->first, false /*filename already contains .gz */ ) );
-           if ( ! inputfile.empty() )
-           {
-             PatternFileReader reader;
-             reader.setConsumer( bind( &Impl::consumePat, this, _1 ) );
-              CombinedProgressData progress( _ticks, PathInfo(inputfile).size()  );
-             reader.parse( inputfile, progress );
-           }
           }
+         if ( ! inputfile.empty() )
+         {
+           PatternFileReader reader;
+           reader.setConsumer( bind( &Impl::consumePat, this, _1 ) );
+            CombinedProgressData progress( _ticks, PathInfo(inputfile).size()  );
+           reader.parse( inputfile, progress );
+         }
         }
 
         // Done
index bfe63b9..e165e9d 100644 (file)
@@ -120,6 +120,11 @@ void Downloader::download( MediaSetAccess &media,
         }
       }
     }
+    else if ( it->first == "patterns.pat"
+              || it->first == "patterns.pat.gz" )
+    {
+      // take all patterns in one go
+    }
     else if ( str::endsWith( it->first, ".pat" ) 
               || str::endsWith( it->first, ".pat.gz" ) )
     {