// METHOD NAME : SuseTagsImpl::SuseTagsImpl
// METHOD TYPE : Ctor
//
- SuseTagsImpl::SuseTagsImpl( media::MediaAccess::Ptr & media_r, const Pathname & path_r )
- : SourceImpl(media_r, path_r)
+ SuseTagsImpl::SuseTagsImpl( const Pathname & localDir_r )
{
- Pathname p = provideFile(path_r + "suse/setup/descr/packages");
-/* PathInfo p( localDir_r );
+ PathInfo p( localDir_r );
if ( p.isDir() )
p( localDir_r + "packages" );
if ( ! p.isFile() )
ZYPP_THROW( Exception( p.asString()+" is not a file" ) );
if ( ! p.userMayR() )
ZYPP_THROW( Exception( p.asString()+" no permission to read" ) );
-*/
+
+ std::list<Package::Ptr> content( parsePackages( p.path() ) );
+ _store.insert( content.begin(), content.end() );
+ DBG << "SuseTagsImpl (fake) from " << p << ": "
+ << content.size() << " packages" << endl;
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : SuseTagsImpl::SuseTagsImpl
+ // METHOD TYPE : Ctor
+ //
+ SuseTagsImpl::SuseTagsImpl( media::MediaAccess::Ptr & media_r, const Pathname & path_r )
+ : SourceImpl(media_r, path_r)
+ {
+ Pathname p = provideFile(path_r + "suse/setup/descr/packages");
DBG << "Going to parse " << p << endl;
std::list<Package::Ptr> content( parsePackages( p ) );
_store.insert( content.begin(), content.end() );
class SuseTagsImpl : public SourceImpl
{
public:
- /** \deprecated Interim ctor
+ /** \deprecated Interim ctor for testing
* \throw EXCEPTION on parse error
*/
+ SuseTagsImpl( const Pathname & localDir_r );
+ /** Factory ctor */
SuseTagsImpl( media::MediaAccess::Ptr & media_r, const Pathname & path_r = "/" );
/** Dtor */
~SuseTagsImpl();