fix Source API change
authorKlaus Kaempf <kkaempf@suse.de>
Sun, 19 Mar 2006 18:18:05 +0000 (18:18 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Sun, 19 Mar 2006 18:18:05 +0000 (18:18 +0000)
testsuite/source/tests/PatternTagParserTest.cc
testsuite/source/tests/SelectionTagParserTest.cc
testsuite/source/tests/suseparser.cc

index f532cad..db0b6a0 100644 (file)
@@ -13,13 +13,15 @@ int main()
   zypp::base::LogControl::instance().logfile( "-" );
 
   Pattern::Ptr pattern;
+  Source_Ref s;
+
   try {
-    pattern = zypp::source::susetags::parsePattern (Pathname("patfiles/default.pat"));
+    pattern = zypp::source::susetags::parsePattern( s, Pathname("patfiles/default.pat"));
     cout << *pattern << endl;
-    pattern = zypp::source::susetags::parsePattern (Pathname("patfiles/NOTTHERE.pat"));
+    pattern = zypp::source::susetags::parsePattern( s, Pathname("patfiles/NOTTHERE.pat"));
     cout << *pattern << endl;
     
-    pattern = zypp::source::susetags::parsePattern (Pathname("patfiles/base-10-33.i586.pat"));
+    pattern = zypp::source::susetags::parsePattern( s, Pathname("patfiles/base-10-33.i586.pat"));
     if (pattern->userVisible())
     {
       ERR << "Error parsing userVisible" << std::endl;
index a82de67..49900ef 100644 (file)
@@ -13,15 +13,16 @@ int main()
   Selection::Ptr selection;
 
   zypp::base::LogControl::instance().logfile( "-" );
+  Source_Ref s;
 
   try {
-  selection = zypp::source::susetags::parseSelection (Pathname("selfiles/default.sel"));
+  selection = zypp::source::susetags::parseSelection( s, Pathname("selfiles/default.sel") );
   cout << *selection << endl;
-  selection = zypp::source::susetags::parseSelection (Pathname("selfiles/Office.sel"));
+  selection = zypp::source::susetags::parseSelection( s, Pathname("selfiles/Office.sel") );
   cout << *selection << endl;
-  selection = zypp::source::susetags::parseSelection (Pathname("selfiles/X11.sel"));
+  selection = zypp::source::susetags::parseSelection( s, Pathname("selfiles/X11.sel") );
   cout << *selection << endl;
-  selection = zypp::source::susetags::parseSelection (Pathname("selfiles/NOTTHERE.sel"));
+  selection = zypp::source::susetags::parseSelection( s, Pathname("selfiles/NOTTHERE.sel") );
   cout << *selection << endl;
   }
   catch (Exception & excpt_r) {
index fdbb0bc..ff3076f 100644 (file)
@@ -56,12 +56,29 @@ int main( int argc, char * argv[] )
        ++argpos;
     }
     Pathname p;
-    Url url( argv[argpos++] );
+    Url url;
+    try {
+       url = ( argv[argpos++] );
+    }
+    catch( const Exception & excpt_r ) {
+      cerr << "Invalid url " << argv[--argpos] << endl;
+      ZYPP_CAUGHT( excpt_r );
+      return 1;
+    }
+    
     string alias("suseparse");
     Locale lang( "en" );
 
     Pathname cache_dir("");
-    Source_Ref src( SourceFactory().createFrom(url, p, alias, cache_dir) );
+    Source_Ref src;
+    try {
+      src = SourceFactory().createFrom(url, p, alias, cache_dir);
+    }
+    catch( const Exception & excpt_r ) {
+      cerr << "Can't access repository" << endl;
+      ZYPP_CAUGHT( excpt_r );
+      return 1;
+    }
 
     ResStore store = src.resolvables();
     INT << "Found " << store.size() << " resolvables" << endl;