Author: mlandres Date: Fri May 4 00:31:57 2007 New Revision: 5476 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5476&view=rev Log: backup Modified: trunk/libzypp/devel/devel.ma/CMakeLists.txt trunk/libzypp/devel/devel.ma/Parse.cc trunk/libzypp/zypp/base/Exception.h trunk/libzypp/zypp2/cache/CacheInitializer.cpp trunk/libzypp/zypp2/cache/CacheStore.h Modified: trunk/libzypp/devel/devel.ma/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/CMakeLists.txt?rev=5476&r1=5475&r2=5476&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/CMakeLists.txt (original) +++ trunk/libzypp/devel/devel.ma/CMakeLists.txt Fri May 4 00:31:57 2007 @@ -29,7 +29,7 @@ ## ############################################################ -FOREACH( loop_var ScanSource Iorder Parse Xml Main) +FOREACH( loop_var ScanSource Iorder Xml Main) ADD_EXECUTABLE( ${loop_var} ${loop_var}.cc ) @@ -39,13 +39,12 @@ ENDFOREACH( loop_var ) -FOREACH( loop_var AOUT ) +FOREACH( loop_var AOUT Parse) ADD_EXECUTABLE( ${loop_var} ${loop_var}.cc ) TARGET_LINK_LIBRARIES( ${loop_var} - boost_filesystem boost_regex - zypp + zypp zypp2 ) ENDFOREACH( loop_var ) Modified: trunk/libzypp/devel/devel.ma/Parse.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Parse.cc?rev=5476&r1=5475&r2=5476&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/Parse.cc (original) +++ trunk/libzypp/devel/devel.ma/Parse.cc Fri May 4 00:31:57 2007 @@ -152,6 +152,8 @@ using namespace zypp::parser::susetags; +#include "zypp2/cache/CacheStore.h" + /****************************************************************** ** ** FUNCTION NAME : main @@ -162,6 +164,45 @@ //zypp::base::LogControl::instance().logfile( "log.restrict" ); INT << "===[START]==========================================" << endl; + //try + { + //cache::CacheStore( "./store" ); + cache::CacheStore( "/home/ma/zypp-trunk/BUILD/libzypp/devel/devel.ma/store" ); + } + +#if 0 + try + { + ZYpp::Ptr z = getZYpp(); + + Pathname dbfile( "data.db" ); + cache::CacheStore store(getenv("PWD")); + + data::RecordId catalog_id = store.lookupOrAppendCatalog( Url("http://www.google.com"), "/"); + + PackagesParser parser( catalog_id, store); + Measure m; + parser.start(argv[1], &progress_function); + m.elapsed(); + } + catch ( const Exception &e ) + { + cout << "ups! " << e.msg() << std::endl; + } +#endif + + INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); + return 0; + + + + + + + + + //Pathname p( "lmd/suse/setup/descr/packages" ); Pathname p( "packages" ); Modified: trunk/libzypp/zypp/base/Exception.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/Exception.h?rev=5476&r1=5475&r2=5476&view=diff ============================================================================== --- trunk/libzypp/zypp/base/Exception.h (original) +++ trunk/libzypp/zypp/base/Exception.h Fri May 4 00:31:57 2007 @@ -53,7 +53,8 @@ /////////////////////////////////////////////////////////////////// /** Create CodeLocation object storing the current location. */ - #define ZYPP_EX_CODELOCATION ::zypp::exception_detail::CodeLocation(__FILE__,__FUNCTION__,__LINE__) + //#define ZYPP_EX_CODELOCATION ::zypp::exception_detail::CodeLocation(__FILE__,__FUNCTION__,__LINE__) +#define ZYPP_EX_CODELOCATION ::zypp::exception_detail::CodeLocation(( *__FILE__ == '/' ? strrchr( __FILE__, '/' ) + 1 : __FILE__ ),__FUNCTION__,__LINE__) /** \relates CodeLocation Stream output */ std::ostream & operator<<( std::ostream & str, const CodeLocation & obj ); Modified: trunk/libzypp/zypp2/cache/CacheInitializer.cpp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/cache/CacheInitializer.cpp?rev=5476&r1=5475&r2=5476&view=diff ============================================================================== --- trunk/libzypp/zypp2/cache/CacheInitializer.cpp (original) +++ trunk/libzypp/zypp2/cache/CacheInitializer.cpp Fri May 4 00:31:57 2007 @@ -32,7 +32,7 @@ /////////////////////////////////////////////////////////////////// namespace cache { ///////////////////////////////////////////////////////////////// - + struct CacheInitializer::Impl { Impl( const Pathname &root_r ) @@ -44,7 +44,7 @@ Pathname root; bool just_initialized; }; - + CacheInitializer::CacheInitializer( const Pathname &root_r, const Pathname &db_file ) : _pimpl( new Impl( root_r ) ) { @@ -56,7 +56,7 @@ { ZYPP_RETHROW(Exception(ex.what())); //ERR << "Exception Occured: " << ex.what() << endl; - } + } try { @@ -77,7 +77,7 @@ ZYPP_RETHROW(Exception(ex.what())); //ERR << "Exception Occured: " << ex.what() << endl; } - + } bool CacheInitializer::justInitialized() const @@ -87,7 +87,7 @@ CacheInitializer::~CacheInitializer() { - + } bool CacheInitializer::tablesCreated() const @@ -119,9 +119,9 @@ } else { - ZYPP_THROW(Exception("Can't open db schema")); + ZYPP_THROW(Exception(str::form("Can't open db schema %s", filename))); } - + //ERR << "Executing " << statements[i] << endl; MIL << "Schema size: " << sql.size() << endl; _pimpl->con->execute(sql.c_str()); Modified: trunk/libzypp/zypp2/cache/CacheStore.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/cache/CacheStore.h?rev=5476&r1=5475&r2=5476&view=diff ============================================================================== --- trunk/libzypp/zypp2/cache/CacheStore.h (original) +++ trunk/libzypp/zypp2/cache/CacheStore.h Fri May 4 00:31:57 2007 @@ -32,35 +32,35 @@ /////////////////////////////////////////////////////////////////// namespace cache { ///////////////////////////////////////////////////////////////// - + /** * The cache store caches resolvable data into some backend. */ class CacheStore { public: - + CacheStore(); ~CacheStore(); - + /** * Constructor for the CacheStore * * \note a transaction will be started from the moment the * CacheStore is instanciated. - * + * * The data will be saved in the directory specified in * \a dbdir */ CacheStore( const Pathname &dbdir ); - + /** * Implements the ResolvableConsumer consumePackage interface * Consumer a package and inserts it into the database. * Don't use this method yet */ virtual void consumePackage( const data::Package &package); - + /** * Appends a resolvable to the store. * @@ -68,11 +68,11 @@ * and its \c NVRA (name version release and architecture ). * Optionaly you can pass a list of \c CapabilityImpl::Ptr * as dependencies for the resolvable. - * + * * You have to specify the RecordId for the catalog owning * this resolvable. Yuu can obtain it with * \ref lookupOrAppendCatalog - * + * * You can create those \a deps using \ref capability::parse * functions, or the build methods to create specific types * of capabilities: @@ -89,7 +89,7 @@ const Resolvable::Kind &kind, const NVRA &nvra, const data::Dependencies &deps ); - + /** * Adds dependencies to the store * @@ -103,30 +103,30 @@ */ void appendDependencies( const data::RecordId &resolvable_id, const data::Dependencies &dependencies ); - + /** * Adds dependencies to the store * * A lists of dependencies \a dlist to be specified. Among * which type of dependencies \ref zypp::Dep it is as * the \a deptype argument. - * + * * \a resolvable_id is the resolvable Id in the CacheStore * that will own those capabilities. * * FIXME should it \throw if the resolvable does not exist? */ - void appendDependencyList( const data::RecordId &resolvable_id, + void appendDependencyList( const data::RecordId &resolvable_id, zypp::Dep deptype, const data::DependencyList &dlist ); - + /** * Adds a dependency to the store. * - * A \ref CapabilityImpl::Ptr argument \a cap has to be specified. + * A \ref CapabilityImpl::Ptr argument \a cap has to be specified. * Among which type of dependency \ref zypp::Dep it is as * the \a deptype argument. - * + * * \a resolvable_id is the resolvable Id in the CacheStore * that will own the capability * @@ -135,14 +135,14 @@ void appendDependency( const data::RecordId &resolvable_id, zypp::Dep deptype, capability::CapabilityImpl::Ptr cap ); - + /** * Adds a Named dependency to the store. * * A \ref NamedCap::Ptr \a dlist to be specified. Among * which type of dependency \ref zypp::Dep it is as * the \a deptype argument. - * + * * \a resolvable_id is the resolvable Id in the CacheStore * that will own the capability * @@ -153,14 +153,14 @@ */ void appendNamedDependency( const data::RecordId &, zypp::Dep, capability::NamedCap::Ptr); - + /** * Adds a file dependency to the store. * * A \ref FileCap::Ptr \a dlist to be specified. Among * which type of dependency \ref zypp::Dep it is as * the \a deptype argument. - * + * * \a resolvable_id is the resolvable Id in the CacheStore * that will own the capability * @@ -169,16 +169,16 @@ * * FIXME should it \throw if the resolvable does not exist? */ - void appendFileDependency( const data::RecordId &, zypp::Dep, + void appendFileDependency( const data::RecordId &, zypp::Dep, capability::FileCap::Ptr); - + /** * Adds a Modalias dependency to the store. * * A \ref ModaliasCap::Ptr \a cap to be specified. Among * which type of dependency \ref zypp::Dep it is as * the \a deptype argument. - * + * * \a resolvable_id is the resolvable Id in the CacheStore * that will own the capability * @@ -190,14 +190,14 @@ void appendModaliasDependency( const data::RecordId &resolvable_id, zypp::Dep deptype, capability::ModaliasCap::Ptr cap); - + /** * Adds a Hal dependency to the store. * * A \ref HalCap::Ptr \a cap to be specified. Among * which type of dependency \ref zypp::Dep it is as * the \a deptype argument. - * + * * \a resolvable_id is the resolvable Id in the CacheStore * that will own the capability * @@ -209,14 +209,14 @@ void appendHalDependency( const data::RecordId &resolvable_id, zypp::Dep deptype, capability::HalCap::Ptr cap ); - + /** * Adds a unknown dependency to the store. * * A \ref Capability::Ptr \a cap to be specified. Among * which type of dependency \ref zypp::Dep it is as * the \a deptype argument. - * + * * \a resolvable_id is the resolvable Id in the CacheStore * that will own the capability * @@ -228,7 +228,7 @@ void appendUnknownDependency( const data::RecordId &resolvable_id, zypp::Dep deptype, capability::CapabilityImpl::Ptr cap ); - + /** * Returns the record id of a catalog (Source) \a path * @@ -236,9 +236,9 @@ * be created and the new inserted entry's id will * be returned. */ - data::RecordId lookupOrAppendCatalog( const Url &url, + data::RecordId lookupOrAppendCatalog( const Url &url, const Pathname &path ); - + /** * Update a known catalog checksum and timestamp * @@ -249,10 +249,10 @@ * a valid record id. You can get one * Using \ref lookupOrAppendCatalog */ - void updateCatalog( const data::RecordId &id, - const std::string &checksum, + void updateCatalog( const data::RecordId &id, + const std::string &checksum, const Date ×tamp = Date::now() ); - + /** * Returns the record id of a file entry \a path * @@ -261,7 +261,7 @@ * be returned. */ data::RecordId lookupOrAppendFile( const Pathname &path ); - + /** * Returns the record id of a name entry \a name * @@ -270,7 +270,7 @@ * be returned. */ data::RecordId lookupOrAppendName( const std::string &name ); - + /** * Returns the record id of a directory name entry \a name * @@ -279,7 +279,7 @@ * be returned. */ data::RecordId lookupOrAppendDirName( const std::string &name ); - + /** * Returns the record id of a file name entry \a name * @@ -288,16 +288,16 @@ * be returned. */ data::RecordId lookupOrAppendFileName( const std::string &name ); - + protected: /** * Internally used function that appends a entry in * the capabilities table for a specific capability * entry. */ -// data::RecordId appendDependencyEntry( const data::RecordId &, +// data::RecordId appendDependencyEntry( const data::RecordId &, // zypp::Dep, const Resolvable::Kind & ); - + private: /** Implementation. */ class Impl; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org