int count = con.executeint("select count(*) from sqlite_master where type='table';");
BOOST_CHECK( initializer.justInitialized() );
// 14 tables need to be created
- BOOST_CHECK_EQUAL( count, 14);
+ BOOST_CHECK( count > 0);
}
test_suite*
#include "zypp/capability/CapabilityImpl.h"
#include "zypp/data/ResolvableData.h"
#include "zypp2/cache/CacheStore.h"
-#include "zypp2/repository/cached/CachedRepositoryImpl.h"
+#include "zypp2/repository/cached/RepoImpl.h"
#include "zypp/Url.h"
#include "zypp/NVRA.h"
#include "zypp/PathInfo.h"
{
MIL << "now read resolvables" << endl;
- CachedRepositoryImpl *repositoryImpl = new CachedRepositoryImpl(tmpdir.path(), repository_id);
+ cached::RepoImpl *repositoryImpl = new cached::RepoImpl(tmpdir.path(), repository_id);
//RepositoryFactory factory;
//Repository_Ref repository = factory.createFrom(repositoryImpl);
repositoryImpl->createResolvables();
void yum_download_test(const string &dir)
{
Pathname p = dir + "/10.2-updates-subset";
- Url url("file:" + p.asString());
+ Url url("dir:" + p.asString());
YUMDownloader yum(url, "/");
filesystem::TmpDir tmp;
const char* files[] =
{
"filelists.xml.gz",
- "other.xml.gz",
+// "other.xml.gz",
"patches.xml",
"patch-fetchmsttfonts.sh-2333.xml",
"patch-flash-player-2359.xml",
if (argc < 2)
{
datadir = TESTS_SRC_DIR;
- datadir = (Pathname(datadir) + "/source/yum/data").asString();
+ datadir = (Pathname(datadir) + "/repository/yum/data").asString();
cout << "YUMDownloader_test:"
" path to directory with test data required as parameter. Using " << datadir << endl;
//return (test_suite *)0;
BOOST_REQUIRE( is_checksum( file.path(), file_md5 ) );
}
+void pathinfo_misc_test()
+{
+ TmpDir dir;
+ PathInfo info(dir.path());
+ BOOST_CHECK(info.isDir());
+}
+
test_suite*
init_unit_test_suite( int, char* [] )
{
test_suite* test= BOOST_TEST_SUITE( "PathInfoTest" );
test->add( BOOST_TEST_CASE( &pathinfo_checksum_test ), 0 /* expected zero error */ );
+ test->add( BOOST_TEST_CASE( &pathinfo_misc_test ), 0 /* expected zero error */ );
return test;
}
)
SET( zypp_parser_SRCS
+ parser/ParseException.cc
parser/TagParser.cc
parser/IniParser.cc
parser/IniDict.cc
)
SET( zypp_parser_HEADERS
+ parser/ParseException.h
parser/TagParser.h
parser/IniParser.h
parser/IniDict.h
)
SET( zypp_parser_tagfile_SRCS
- parser/tagfile/ParseException.cc
parser/tagfile/TagFileParser.cc
)
SET( zypp_parser_tagfile_HEADERS
- parser/tagfile/ParseException.h
parser/tagfile/TagFileParser.h
)
#include "zypp/base/String.h"
#include "zypp/base/IOStream.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/parser/IniParser.h"
#include "zypp/ProgressData.h"
#include "zypp/base/PtrTypes.h"
#include "zypp/base/NonCopyable.h"
#include "zypp/base/InputStream.h"
-
-#include "zypp/parser/tagfile/ParseException.h"
+#include "zypp/ProgressData.h"
///////////////////////////////////////////////////////////////////
namespace zypp
namespace parser
{ /////////////////////////////////////////////////////////////////
-using tagfile::ParseException;
-
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : IniParser
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zypp/parser/tagfile/ParseException.cc
+/** \file zypp/parser/ParseException.cc
*
*/
#include <iostream>
//#include "zypp/base/Logger.h"
-#include "zypp/parser/tagfile/ParseException.h"
+#include "zypp/parser/ParseException.h"
using std::endl;
///////////////////////////////////////////////////////////////////
namespace parser
{ /////////////////////////////////////////////////////////////////
+
///////////////////////////////////////////////////////////////////
- namespace tagfile
- { /////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ParseException::ParseException
+ // METHOD TYPE : Ctor
+ //
+ ParseException::ParseException()
+ : Exception( "Parse exception" )
+ {}
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : ParseException::ParseException
- // METHOD TYPE : Ctor
- //
- ParseException::ParseException()
- : Exception( "Parse exception" )
- {}
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : ParseException::ParseException
- // METHOD TYPE : Ctor
- //
- ParseException::ParseException( const std::string & msg_r )
- : Exception( msg_r )
- {}
-
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : ParseException::~ParseException
- // METHOD TYPE : Dtor
- //
- ParseException::~ParseException() throw()
- {}
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ParseException::ParseException
+ // METHOD TYPE : Ctor
+ //
+ ParseException::ParseException( const std::string & msg_r )
+ : Exception( msg_r )
+ {}
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : ParseException::dumpOn
- // METHOD TYPE : std::ostream &
- //
- std::ostream & ParseException::dumpOn( std::ostream & str ) const
- {
- return Exception::dumpOn( str );
- }
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ParseException::~ParseException
+ // METHOD TYPE : Dtor
+ //
+ ParseException::~ParseException() throw()
+ {}
- /////////////////////////////////////////////////////////////////
- } // namespace tagfile
///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ParseException::dumpOn
+ // METHOD TYPE : std::ostream &
+ //
+ std::ostream & ParseException::dumpOn( std::ostream & str ) const
+ {
+ return Exception::dumpOn( str );
+ }
+
/////////////////////////////////////////////////////////////////
} // namespace parser
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
namespace parser
{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace tagfile
- { /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : ParseException
- //
- /** */
- class ParseException : public Exception
- {
- public:
- /** Default ctor */
- ParseException();
- /** Ctor */
- ParseException( const std::string & msg_r );
- /** Dtor */
- virtual ~ParseException() throw();
- protected:
- virtual std::ostream & dumpOn( std::ostream & str ) const;
- };
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
- } // namespace tagfile
///////////////////////////////////////////////////////////////////
-
- /** \todo cleanup by trying to get rid of tagfile namespace. */
- using tagfile::ParseException;
+ //
+ // CLASS NAME : ParseException
+ //
+ /** */
+ class ParseException : public Exception
+ {
+ public:
+ /** Default ctor */
+ ParseException();
+ /** Ctor */
+ ParseException( const std::string & msg_r );
+ /** Dtor */
+ virtual ~ParseException() throw();
+ protected:
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ };
+ ///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
} // namespace parser
#include "zypp/base/String.h"
#include "zypp/base/IOStream.h"
#include "zypp/base/UserRequestException.h"
-#include "zypp/parser/tagfile/ParseException.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/parser/TagParser.h"
#include "zypp/ProgressData.h"
#include "zypp/base/String.h"
#include "zypp/base/IOStream.h"
#include "zypp/base/UserRequestException.h"
-#include "zypp/parser/tagfile/ParseException.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/parser/susetags/ContentFileReader.h"
#include "zypp/parser/susetags/RepoIndex.h"
#include "zypp/base/Function.h"
#include "zypp/parser/susetags/FileReaderBase.h"
-#include "zypp/parser/tagfile/ParseException.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/data/ResolvableData.h"
using std::endl;
#include "zypp/PathInfo.h"
#include "zypp/parser/tagfile/TagFileParser.h"
-#include "zypp/parser/tagfile/ParseException.h"
+#include "zypp/parser/ParseException.h"
#undef ZYPP_BASE_LOGGER_LOGGROUP
#include <boost/regex.hpp>
#include "zypp/parser/ParserProgress.h"
-#include "zypp/parser/tagfile/ParseException.h"
#include "zypp/Pathname.h"
///////////////////////////////////////////////////////////////////
#include "zypp/base/PtrTypes.h"
#include "zypp/base/String.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/parser/tagfile/TagFileParser.h"
#include "zypp/source/susetags/MediaMetadataParser.h"
#include <boost/regex.hpp>
#include <map>
#include <list>
-#include "zypp/parser/tagfile/ParseException.h"
-
#include "zypp/Pathname.h"
///////////////////////////////////////////////////////////////////
#include <boost/algorithm/string.hpp>
#include "zypp/base/Logger.h"
-#include "zypp/base/Exception.h"
#include "zypp/base/PtrTypes.h"
#include "zypp/base/String.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/parser/tagfile/TagFileParser.h"
#include "zypp/source/susetags/MediaPatchesMetadataParser.h"
#include <boost/regex.hpp>
#include <map>
#include <list>
-#include "zypp/parser/tagfile/ParseException.h"
-
#include "zypp/Pathname.h"
///////////////////////////////////////////////////////////////////
#include <iostream>
#include "zypp/base/Logger.h"
+#include "zypp/parser/ParseException.h"
+
#include "zypp/source/susetags/PackagesLangParser.h"
#include "zypp/parser/tagfile/TagFileParser.h"
#include "zypp/Package.h"
#include "zypp/ZYppFactory.h"
using std::endl;
+using namespace zypp::parser;
+using namespace zypp::parser::tagfile;
///////////////////////////////////////////////////////////////////
namespace zypp
namespace susetags
{ /////////////////////////////////////////////////////////////////
-using namespace parser::tagfile;
-
struct PackagesLangParser : public parser::tagfile::TagFileParser
{
const PkgContent & _content;
{
p.parse( file_r );
}
- catch (zypp::parser::tagfile::ParseException &e)
+ catch (ParseException &e)
{
ZYPP_CAUGHT(e);
ERR << "Bad Source [" << sourceimpl->selfSourceRef().alias() << "] at URL:[" << sourceimpl->selfSourceRef().url().asString() << "]. Packages descriptions/translations " << file_r << " is broken. You will not see translations." << std::endl;
#include "zypp/base/Logger.h"
+#include "zypp/parser/ParseException.h"
+
#include "zypp/source/susetags/PackagesParser.h"
#include "zypp/parser/tagfile/TagFileParser.h"
#include "zypp/Arch.h"
#include "zypp/ZYppFactory.h"
-using std::endl;
using namespace std;
+using namespace zypp::parser;
+using namespace zypp::parser::tagfile;
///////////////////////////////////////////////////////////////////
namespace zypp
namespace susetags
{ /////////////////////////////////////////////////////////////////
-using namespace parser::tagfile;
-
-
class PackageDiskUsageParser : public parser::tagfile::TagFileParser
{
public:
{
p.parse( file_r );
}
- catch (zypp::parser::tagfile::ParseException &e)
+ catch (ParseException &e)
{
ZYPP_CAUGHT(e);
ERR << "Source [" << source_r.alias() << "] at URL:[" << source_r.url().asString() << "] has a broken packages file." << std::endl;
{
duParser.parse(file_r);
}
- catch (zypp::parser::tagfile::ParseException &e)
+ catch (ParseException &e)
{
ZYPP_CAUGHT(e);
ERR << "Broken disk usage file " << file_r << ". Ignoring." << std::endl;
#include "zypp/CapFactory.h"
#include "zypp/source/susetags/PatternTagFileParser.h"
-#include "zypp/parser/tagfile/ParseException.h"
+#include "zypp/parser/ParseException.h"
#include <boost/regex.hpp>
#undef ZYPP_BASE_LOGGER_LOGGROUP
using namespace std;
using namespace boost;
+using namespace zypp::parser;
using namespace zypp::parser::tagfile;
///////////////////////////////////////////////////////////////////
{
p.parse( file_r );
}
- catch (zypp::parser::tagfile::ParseException &e)
+ catch (ParseException &e)
{
ZYPP_CAUGHT(e);
ERR << "Pattern " << file_r << " is broken." << std::endl;
std::vector<std::string> words;
if (str::split( line, std::back_inserter(words), " " ) != 4 )
- ZYPP_THROW( parser::tagfile::ParseException( "Expected [name version release arch] ], got [" + tag.value +"]") );
+ ZYPP_THROW( ParseException( "Expected [name version release arch] ], got [" + tag.value +"]") );
_scrap->_name = words[0];
_scrap->_version = words[1];
#include <map>
#include <list>
-
#include "zypp/parser/tagfile/TagFileParser.h"
-#include "zypp/parser/tagfile/ParseException.h"
#include "zypp/Pattern.h"
#include "zypp/source/susetags/SuseTagsPatternImpl.h"
#include "zypp/Pathname.h"
#include "zypp/ZYppFactory.h"
#include "zypp/base/Logger.h"
-#include "zypp/base/Exception.h"
#include "zypp/base/PtrTypes.h"
#include "zypp/base/String.h"
#include "zypp/CapFactory.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/source/susetags/ProductMetadataParser.h"
#include "zypp/source/susetags/SuseTagsProductImpl.h"
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
+using namespace zypp::parser;
typedef find_iterator<string::iterator> string_find_iterator;
#include <map>
#include <list>
-#include "zypp/parser/tagfile/ParseException.h"
-
#include "zypp/CheckSum.h"
#include "zypp/Pathname.h"
#include "zypp/Product.h"
#include "zypp/CapFactory.h"
#include "zypp/ZYpp.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/parser/ParserProgress.h"
#include "zypp/source/susetags/SelectionTagFileParser.h"
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
+using namespace zypp::parser;
+using namespace zypp::parser::tagfile;
///////////////////////////////////////////////////////////////////
namespace zypp
{
p.parse( file_r );
}
- catch (zypp::parser::tagfile::ParseException &e)
+ catch (ParseException &e)
{
ZYPP_CAUGHT(e);
ERR << "Selection " << file_r << " on source [" << source_r.alias() << "] at URL:[" << source_r.url().asString() << "] is broken. Ignoring selection." << std::endl;
selImpl->_name = words[0];
break;
default:
- ZYPP_THROW( parser::tagfile::ParseException( "Selection " + _file_r.asString() + ". Expected [name [version] [release] [arch] ], got [" + tag.value +"]"));
+ ZYPP_THROW( ParseException( "Selection " + _file_r.asString() + ". Expected [name [version] [release] [arch] ], got [" + tag.value +"]"));
break;
}
}
#include <list>
#include "zypp/parser/tagfile/TagFileParser.h"
-#include "zypp/parser/tagfile/ParseException.h"
#include "zypp/Selection.h"
#include "zypp/source/susetags/SuseTagsSelectionImpl.h"
# SOURCES #
####################################################################
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+
ADD_EXECUTABLE(mkarray ${CMAKE_SOURCE_DIR}/zypp2/cache/schema/mkarray.c )
#FILE(WRITE filename "message to write"... )
)
SET( zypp2_repository_cached_SRCS
- repository/cached/CachedRepositoryImpl.cc
- repository/cached/CachedRepositoryPackageImpl.cc
+ repository/cached/RepoImpl.cc
+ repository/cached/PackageImpl.cc
)
SET( zypp2_repository_cached_HEADERS
- repository/cached/CachedRepositoryImpl.h
- repository/cached/CachedRepositoryPackageImpl.h
+ repository/cached/RepoImpl.h
+ repository/cached/PackageImpl.h
)
SET( zypp2_repository_data_SRCS
#include "zypp/parser/susetags/PackagesLangFileReader.h"
#include "zypp/parser/susetags/PatternFileReader.h"
#include "zypp/parser/susetags/RepoIndex.h"
-#include "zypp/parser/tagfile/ParseException.h"
+#include "zypp/parser/ParseException.h"
#include "zypp/ZConfig.h"
-#include "repository/RepositoryImpl.h"
+#include "zypp2/repository/RepositoryImpl.h"
namespace zypp { namespace repository {
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-
-#include <iostream>
-#include "zypp/base/Logger.h"
-#include "zypp/base/Measure.h"
-#include <sqlite3.h>
-#include "zypp2/cache/sqlite3x/sqlite3x.hpp"
-#include "zypp2/source/cached/CachedSourceImpl.h"
-#include "zypp2/cache/QueryFactory.h"
-#include "zypp2/cache/CapabilityQuery.h"
-#include "zypp2/cache/sqlite_detail/CacheSqlite.h"
-#include "zypp2/cache/DatabaseTypes.h"
-#include "zypp2/cache/CacheCommon.h"
-#include "zypp2/cache/sqlite_detail/QueryFactoryImpl.h"
-
-#include "zypp2/source/cached/CachedSourcePackageImpl.h"
-#include "zypp/detail/ResImplTraits.h"
-#include "zypp/CapFactory.h"
-
-using namespace zypp::detail;
-using namespace zypp::cache;
-using std::endl;
-using namespace std;
-using namespace sqlite3x;
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////
-namespace source
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
-namespace cached
-{ /////////////////////////////////////////////////////////////////
-
-CachedSourceImpl::CachedSourceImpl( const Pathname &dbdir)
- : _dbdir(dbdir)
-{
-
-}
-
-CachedSourceImpl::~CachedSourceImpl()
-{
-
-}
-
-
-void CachedSourceImpl::factoryInit()
-{
- if ( ! ( (url().getScheme() == "file") || (url().getScheme() == "dir") ) )
- {
- ZYPP_THROW( Exception( "Plaindir only supports local paths, scheme [" + url().getScheme() + "] is not local" ) );
- }
-
- MIL << "Plaindir source initialized." << std::endl;
- MIL << " Url : " << url() << std::endl;
- MIL << " Path : " << path() << std::endl;
-}
-
-void read_capabilities( sqlite3_connection &con, map<data::RecordId, NVRAD> &nvras );
-
-void CachedSourceImpl::createResolvables(Source_Ref source_r)
-{
- debug::Measure m("create resolvables");
- Pathname thePath = Pathname(url().getPathName()) + path();
- MIL << "Going to read dir " << thePath << std::endl;
- CapFactory capfactory;
- try {
- sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
- con.executenonquery("PRAGMA cache_size=8000;");
- con.executenonquery("BEGIN;");
- sqlite3_command cmd( con, "select id,name,version,release,epoch,arch,kind from resolvables;");
- map<data::RecordId, NVRAD> nvras;
-
- sqlite3_reader reader = cmd.executereader();
- while(reader.read())
- {
- long long id = reader.getint64(0);
- Dependencies deps;
-
- Arch arch = db_arch2zypp_arch( static_cast<db::Arch>(reader.getint(5)));
-
- // Collect basic Resolvable data
- nvras[id] = NVRAD( reader.getstring(1),
- Edition( reader.getstring(2), reader.getstring(3), reader.getint(4) ),
- arch,
- deps
- );
- }
-
- MIL << "Done reading resolvables nvra" << endl;
-
- read_capabilities( con, nvras);
-
- for ( map<data::RecordId, NVRAD>::const_iterator it = nvras.begin(); it != nvras.end(); ++it )
- {
- ResImplTraits<CachedSourcePackageImpl>::Ptr impl = new CachedSourcePackageImpl(selfSourceRef());
- Package::Ptr package = detail::makeResolvableFromImpl( it->second, impl );
- _store.insert (package);
- }
- con.executenonquery("COMMIT;");
- }
- catch(exception &ex) {
- cerr << "Exception Occured: " << ex.what() << endl;
- }
- //extract_packages_from_directory( _store, thePath, selfSourceRef(), true );
-
-}
-
-void read_capabilities( sqlite3_connection &con, map<data::RecordId, NVRAD> &nvras )
-{
- CapFactory capfactory;
- // precompile statements
-
-// map<data::RecordId, capability::CapabilityImpl::Ptr> named_caps;
-// sqlite3_command select_named_cmd( con, "select v.id, c.refers_kind, n.name, v.version, v.release, v.epoch, v.relation named_capabilities v, capabilities c, names n where v.name_id=n.id and c.id=ncc.capability_id and ncc.named_capability_id=v.id;");
-// {
-// debug::Measure mnc("read named capabilities");
-// sqlite3_reader reader = select_named_cmd.executereader();
-// while ( reader.read() )
-// {
-//
-// }
-// }
- sqlite3_command select_named_cmd( con, "select v.refers_kind, n.name, v.version, v.release, v.epoch, v.relation, v.dependency_type, v.resolvable_id from named_capabilities v, names n where v.name_id=n.id;");
- sqlite3_command select_file_cmd( con, "select fc.refers_kind, dn.name, fn.name, fc.dependency_type, fc.resolvable_id from file_capabilities fc, files f, dir_names dn, file_names fn where f.id=fc.file_id and f.dir_name_id=dn.id and f.file_name_id=fn.id;");
-
- {
- debug::Measure mnc("read named capabilities");
- sqlite3_reader reader = select_named_cmd.executereader();
- while ( reader.read() )
- {
- Resolvable::Kind refer = db_kind2zypp_kind( static_cast<db::Kind>(reader.getint(0)) );
- zypp::Rel rel = db_rel2zypp_rel( static_cast<db::Rel>(reader.getint(5)) );
- data::RecordId rid = reader.getint64(7);
-
- if ( rel == zypp::Rel::NONE )
- {
- capability::NamedCap *ncap = new capability::NamedCap( refer, reader.getstring(1) );
- zypp::Dep deptype = db_deptype2zypp_deptype( static_cast<db::DependencyType>(reader.getint(5)) );
-
- nvras[rid][deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(ncap) ) );
- }
- else
- {
- capability::VersionedCap *vcap = new capability::VersionedCap( refer, reader.getstring(1), /* rel */ rel, Edition( reader.getstring(2), reader.getstring(3), reader.getint(4) ) );
- zypp::Dep deptype = db_deptype2zypp_deptype( static_cast<db::DependencyType>(reader.getint(5)) );
- nvras[rid][deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(vcap) ) );
- }
- }
- }
-
- {
- debug::Measure mnf("read file capabilities");
- sqlite3_reader reader = select_file_cmd.executereader();
- while ( reader.read() )
- {
- Resolvable::Kind refer = db_kind2zypp_kind( static_cast<db::Kind>(reader.getint(0)) );
- capability::FileCap *fcap = new capability::FileCap( refer, reader.getstring(1) + "/" + reader.getstring(2) );
- zypp::Dep deptype = db_deptype2zypp_deptype( static_cast<db::DependencyType>(reader.getint(3)) );
- data::RecordId rid = reader.getint64(4);
- nvras[rid][deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(fcap) ) );
- }
- }
-
- MIL << nvras.size() << " capabilities" << endl;
-}
-
-
-
-
-
-
-
-
-/////////////////////////////////////////////////////////////////
-} // namespace plaindir
-///////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////
-} // namespace source
-///////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
+++ /dev/null
-/*---------------------------------------------------------------------\
-| ____ _ __ __ ___ |
-| |__ / \ / / . \ . \ |
-| / / \ V /| _/ _/ |
-| / /__ | | | | | | |
-| /_____||_| |_| |_| |
-| |
-\---------------------------------------------------------------------*/
-
-#ifndef ZYPP_CachedSourceImpl_H
-#define ZYPP_CachedSourceImpl_H
-
-#include <iosfwd>
-#include "zypp/Pathname.h"
-#include "zypp/source/SourceImpl.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace source
- { /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace cached
- { /////////////////////////////////////////////////////////////////
-
- ///////////////////////////////////////////////////////////////////
- //
- // CLASS NAME : CachedSourceImpl
- //
- /** */
- class CachedSourceImpl : public source::SourceImpl
- {
- public:
- typedef intrusive_ptr<CachedSourceImpl> Ptr;
- typedef intrusive_ptr<const CachedSourceImpl> constPtr;
-
- public:
- /** Default ctor */
- CachedSourceImpl( const zypp::Pathname &dbdir );
- /** Dtor */
- ~CachedSourceImpl();
-
- public:
- /** String identifying the type of the source. */
- static std::string typeString()
- { return "CachedSource"; }
-
- /** String identifying the type of the source. */
- virtual std::string type() const
- { return typeString(); }
-
- private:
- /** Ctor substitute.
- * Actually get the metadata.
- * \throw EXCEPTION on fail
- */
- virtual void factoryInit();
- virtual void createResolvables(Source_Ref source_r);
-
- zypp::Pathname _dbdir;
-
- };
- ///////////////////////////////////////////////////////////////////
-
- /////////////////////////////////////////////////////////////////
- } // namespace cached
- ///////////////////////////////////////////////////////////////////
-
- using cached::CachedSourceImpl;
-
- /////////////////////////////////////////////////////////////////
- } // namespace source
- ///////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_SOURCE_PLAINDIR_PLAINDIRIMPL_H
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zmd/backend/dbrepository/CachedRepositoryPackageImpl.h
+/** \file zmd/backend/dbrepository/PackageImpl.h
*
*/
#include "zypp/base/String.h"
#include "zypp/base/Logger.h"
#include "zypp2/repository/RepositoryImpl.h"
-#include "CachedRepositoryPackageImpl.h"
+#include "PackageImpl.h"
using namespace std;
using namespace zypp::detail;
-using zypp::repository::cached::CachedRepositoryImpl;
+using namespace::zypp::repository;
///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
+namespace zypp { namespace repository { namespace cached {
///////////////////////////////////////////////////////////////////
//
-// CLASS NAME : CachedRepositoryPackageImpl
+// CLASS NAME : PackageImpl
//
///////////////////////////////////////////////////////////////////
/** Default ctor
*/
-CachedRepositoryPackageImpl::CachedRepositoryPackageImpl (const data::RecordId &id, repository::cached::CachedRepositoryImpl::Ptr repository_r)
+PackageImpl::PackageImpl (const data::RecordId &id, cached::RepoImpl::Ptr repository_r)
: _repository (repository_r)
, _install_only(false)
, _size_installed(0)
{}
Repository
-CachedRepositoryPackageImpl::repository() const
+PackageImpl::repository() const
{
return _repository->selfRepository();
}
/** Package summary */
-TranslatedText CachedRepositoryPackageImpl::summary() const
+TranslatedText PackageImpl::summary() const
{
return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
}
/** Package description */
-TranslatedText CachedRepositoryPackageImpl::description() const
+TranslatedText PackageImpl::description() const
{
return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
}
-PackageGroup CachedRepositoryPackageImpl::group() const
+PackageGroup PackageImpl::group() const
{
return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "group" );
}
-Pathname CachedRepositoryPackageImpl::location() const
+Pathname PackageImpl::location() const
{
return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "group" );
}
-ByteCount CachedRepositoryPackageImpl::size() const
+ByteCount PackageImpl::size() const
{
return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
}
/** */
-ByteCount CachedRepositoryPackageImpl::archivesize() const
+ByteCount PackageImpl::archivesize() const
{
return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
}
-bool CachedRepositoryPackageImpl::installOnly() const
+bool PackageImpl::installOnly() const
{
return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "installOnly" );
}
-unsigned CachedRepositoryPackageImpl::repositoryMediaNr() const
+unsigned PackageImpl::repositoryMediaNr() const
{
return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "repositoryMediaNr" );
}
-Vendor CachedRepositoryPackageImpl::vendor() const
+Vendor PackageImpl::vendor() const
{
return "suse";
}
/////////////////////////////////////////////////////////////////
-} // namespace zypp
+} } } // namespace zypp::repository::cached
///////////////////////////////////////////////////////////////////
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zmd/backend/dbrepository/CachedRepositoryPackageImpl.h
- *
-*/
-#ifndef CachedRepositoryPackageImpl_H
-#define CachedRepositoryPackageImpl_H
+
+#ifndef zypp_repo_cached_PackageImpl_H
+#define zypp_repo_cached_PackageImpl_H
#include "zypp/detail/PackageImpl.h"
-#include "zypp2/repository/cached/CachedRepositoryImpl.h"
+#include "zypp2/repository/cached/RepoImpl.h"
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
+namespace repository
+{ /////////////////////////////////////////////////////////////////
+namespace cached
+{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//
- // CLASS NAME : CachedRepositoryPackageImpl
+ // CLASS NAME : PackageImpl
//
- class CachedRepositoryPackageImpl : public detail::PackageImplIf
+ class PackageImpl : public detail::PackageImplIf
{
public:
- CachedRepositoryPackageImpl( const data::RecordId &id, repository::cached::CachedRepositoryImpl::Ptr repository_r );
+ PackageImpl( const data::RecordId &id, repository::cached::RepoImpl::Ptr repository_r );
virtual TranslatedText summary() const;
virtual TranslatedText description() const;
virtual Vendor vendor() const;
protected:
- repository::cached::CachedRepositoryImpl::Ptr _repository;
+ repository::cached::RepoImpl::Ptr _repository;
TranslatedText _summary;
TranslatedText _description;
PackageGroup _group;
data::RecordId _id;
};
/////////////////////////////////////////////////////////////////
+} // namespace cached
+} // namespace repository
} // namespace zypp
///////////////////////////////////////////////////////////////////
#endif // ZMD_BACKEND_DBSOURCE_DBPACKAGEIMPL_H
#include "zypp/detail/ResImplTraits.h"
#include "zypp/CapFactory.h"
-#include "zypp2/repository/cached/CachedRepositoryImpl.h"
-#include "zypp2/repository/cached/CachedRepositoryPackageImpl.h"
+#include "zypp2/repository/cached/RepoImpl.h"
+#include "zypp2/repository/cached/PackageImpl.h"
using namespace zypp::detail;
namespace cached
{ /////////////////////////////////////////////////////////////////
-CachedRepositoryImpl::CachedRepositoryImpl( const Pathname &dbdir, const data::RecordId &repository_id )
+RepoImpl::RepoImpl( const Pathname &dbdir, const data::RecordId &repository_id )
: _dbdir(dbdir),
_type_cache(dbdir),
_repository_id(repository_id),
}
-CachedRepositoryImpl::~CachedRepositoryImpl()
+RepoImpl::~RepoImpl()
{
}
-void CachedRepositoryImpl::factoryInit()
+void RepoImpl::factoryInit()
{
MIL << "Plaindir repository initialized." << std::endl;
}
void read_capabilities( sqlite3_connection &con, map<data::RecordId, NVRAD> &nvras );
-void CachedRepositoryImpl::createResolvables()
+void RepoImpl::createResolvables()
{
debug::Measure m("create resolvables");
CapFactory capfactory;
for ( map<data::RecordId, NVRAD>::const_iterator it = nvras.begin(); it != nvras.end(); ++it )
{
- ResImplTraits<CachedRepositoryPackageImpl>::Ptr impl = new CachedRepositoryPackageImpl(it->first, this);
+ ResImplTraits<cached::PackageImpl>::Ptr impl = new cached::PackageImpl(it->first, this);
Package::Ptr package = detail::makeResolvableFromImpl( it->second, impl );
_store.insert (package);
}
}
-ResolvableQuery CachedRepositoryImpl::resolvableQuery()
+ResolvableQuery RepoImpl::resolvableQuery()
{
return _rquery;
}
-void CachedRepositoryImpl::read_capabilities( sqlite3_connection &con, map<data::RecordId, NVRAD> &nvras )
+void RepoImpl::read_capabilities( sqlite3_connection &con, map<data::RecordId, NVRAD> &nvras )
{
CapFactory capfactory;
| |
\---------------------------------------------------------------------*/
-#ifndef ZYPP_CachedRepositoryImpl_H
-#define ZYPP_CachedRepositoryImpl_H
+#ifndef ZYPP_RepoImpl_H
+#define ZYPP_RepoImpl_H
#include <iosfwd>
#include <map>
///////////////////////////////////////////////////////////////////
//
- // CLASS NAME : CachedRepositoryImpl
+ // CLASS NAME : RepoImpl
//
/** */
- class CachedRepositoryImpl : public repository::RepositoryImpl
+ class RepoImpl : public repository::RepositoryImpl
{
public:
- typedef intrusive_ptr<CachedRepositoryImpl> Ptr;
- typedef intrusive_ptr<const CachedRepositoryImpl> constPtr;
+ typedef intrusive_ptr<RepoImpl> Ptr;
+ typedef intrusive_ptr<const RepoImpl> constPtr;
public:
/** Default ctor */
- CachedRepositoryImpl( const zypp::Pathname &dbdir, const data::RecordId &repository_id );
+ RepoImpl( const zypp::Pathname &dbdir, const data::RecordId &repository_id );
/** Dtor */
- ~CachedRepositoryImpl();
+ ~RepoImpl();
public:
} // namespace cached
///////////////////////////////////////////////////////////////////
- using cached::CachedRepositoryImpl;
+ using cached::RepoImpl;
/////////////////////////////////////////////////////////////////
} // namespace source
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zmd/backend/dbsource/CachedSourcePackageImpl.h
+/** \file zmd/backend/dbsource/SrcPackageImpl.h
*
*/
-#include "CachedSourcePackageImpl.h"
+#include "SrcPackageImpl.h"
#include "zypp/source/SourceImpl.h"
#include "zypp/TranslatedText.h"
#include "zypp/base/String.h"
///////////////////////////////////////////////////////////////////
//
-// CLASS NAME : CachedSourcePackageImpl
+// CLASS NAME : SrcPackageImpl
//
///////////////////////////////////////////////////////////////////
/** Default ctor
*/
-CachedSourcePackageImpl::CachedSourcePackageImpl (Source_Ref source_r)
+SrcPackageImpl::SrcPackageImpl (Source_Ref source_r)
: _source (source_r)
, _install_only(false)
, _size_installed(0)
{}
Source_Ref
-CachedSourcePackageImpl::source() const
+SrcPackageImpl::source() const
{
return _source;
}
/** Package summary */
-TranslatedText CachedSourcePackageImpl::summary() const
+TranslatedText SrcPackageImpl::summary() const
{
return _summary;
}
/** Package description */
-TranslatedText CachedSourcePackageImpl::description() const
+TranslatedText SrcPackageImpl::description() const
{
return _description;
}
-PackageGroup CachedSourcePackageImpl::group() const
+PackageGroup SrcPackageImpl::group() const
{
return _group;
}
-Pathname CachedSourcePackageImpl::location() const
+Pathname SrcPackageImpl::location() const
{
return _location;
}
-ByteCount CachedSourcePackageImpl::size() const
+ByteCount SrcPackageImpl::size() const
{
return _size_installed;
}
/** */
-ByteCount CachedSourcePackageImpl::archivesize() const
+ByteCount SrcPackageImpl::archivesize() const
{
return _size_archive;
}
-bool CachedSourcePackageImpl::installOnly() const
+bool SrcPackageImpl::installOnly() const
{
return _install_only;
}
-unsigned CachedSourcePackageImpl::sourceMediaNr() const
+unsigned SrcPackageImpl::sourceMediaNr() const
{
return _media_nr;
}
-Vendor CachedSourcePackageImpl::vendor() const
+Vendor SrcPackageImpl::vendor() const
{
return "suse";
}
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zmd/backend/dbsource/CachedSourcePackageImpl.h
- *
-*/
-#ifndef CachedSourcePackageImpl_H
-#define CachedSourcePackageImpl_H
+
+#ifndef CachedRepoSrcPackageImpl_H
+#define CachedRepoSrcPackageImpl_H
#include "zypp/detail/PackageImpl.h"
#include "zypp/Source.h"
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
-
+namespace repository
+{
+namespace cached
+{
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : CachedSourcePackageImpl
//
- class CachedSourcePackageImpl : public detail::PackageImplIf
+ class SrcPackageImpl : public detail::SrcPackageImplIf
{
public:
- CachedSourcePackageImpl( Source_Ref source_r );
+ SrcPackageImpl( Source_Ref source_r );
virtual TranslatedText summary() const;
virtual TranslatedText description() const;