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;
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) {
++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;