report start/finish source data parsing
authorStanislav Visnovsky <visnov@suse.cz>
Mon, 13 Feb 2006 10:29:59 +0000 (10:29 +0000)
committerStanislav Visnovsky <visnov@suse.cz>
Mon, 13 Feb 2006 10:29:59 +0000 (10:29 +0000)
zypp/source/SourceImpl.cc
zypp/source/susetags/SuseTagsImpl.cc
zypp/source/yum/YUMSourceImpl.cc

index c796944..6e0c9fa 100644 (file)
@@ -127,6 +127,8 @@ namespace zypp
                excp.msg()
            );
 
+         DBG << "ProvideFile exception caught, callback answer: " << user << endl;
+         
          if( user == media::MediaChangeReport::ABORT )
          {
            ZYPP_RETHROW ( excp );
index c7c3fd8..e96d97e 100644 (file)
@@ -23,6 +23,7 @@
 #include "zypp/source/susetags/PatternTagFileParser.h"
 
 #include "zypp/SourceFactory.h"
+#include "zypp/ZYppCallbacks.h"
 
 using std::endl;
 
@@ -105,6 +106,10 @@ namespace zypp
 
       void SuseTagsImpl::createResolvables(Source_Ref source_r)
       {
+        callback::SendReport<CreateSourceReport> report;
+       
+       report->startData( url() );
+       
 #warning We use suse instead of <DATADIR> for now
         Pathname p = provideFile(_path + "suse/setup/descr/packages");
         DBG << "Going to parse " << p << endl;
@@ -134,7 +139,7 @@ namespace zypp
        // parse selections
        try {
          p = provideFile(_path + "suse/setup/descr/selections");
-       } catch (...)
+       } catch (Exception & excpt_r)
        {
            MIL << "'selections' file not found" << endl;
 
@@ -174,7 +179,7 @@ namespace zypp
 
        try {
            p = provideFile(_path + "suse/setup/descr/patterns");
-       } catch (...)
+       } catch (Exception & excpt_r)
        {
            MIL << "'patterns' file not found" << endl;
            file_found = false;
@@ -207,6 +212,8 @@ namespace zypp
                DBG << "Parsing of " << file << " done" << endl;
            }
         }
+
+       report->finishData( url(), CreateSourceReport::NO_ERROR, "" );
       }
       ///////////////////////////////////////////////////////////////////
       //
index 3535d83..2287ae3 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "zypp/parser/yum/YUMParser.h"
 #include "zypp/SourceFactory.h"
+#include "zypp/ZYppCallbacks.h"
 
 #include <fstream>
 
@@ -124,6 +125,10 @@ INT << "Storing data to cache" << endl;
        std::list<YUMRepomdData_Ptr> repo_product;
        std::list<YUMRepomdData_Ptr> repo_patches;
 
+       callback::SendReport<CreateSourceReport> report;
+       
+       report->startData( url() );
+
        try {
        // first read list of all files in the reposotory
         Pathname filename = _cache_dir.empty()
@@ -427,6 +432,8 @@ INT << "Storing data to cache" << endl;
        {
        ERR << "Cannot read patch metadata" << endl;
        }
+
+       report->finishData( url(), CreateSourceReport::NO_ERROR, "" );
       }
 
        Package::Ptr YUMSourceImpl::createPackage(