Author: mlandres
Date: Tue Jun 26 13:33:44 2007
New Revision: 5844
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5844&view=rev
Log:
fix cache Store and Repository to offer SourcePackages (its attributes are still missing)
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Tue Jun 26 13:33:44 2007
@@ -944,6 +944,7 @@
SET( zypp_repo_cached_SRCS
repo/cached/RepoImpl.cc
repo/cached/PackageImpl.cc
+ repo/cached/SrcPackageImpl.cc
repo/cached/PatchImpl.cc
repo/cached/PatternImpl.cc
repo/cached/ProductImpl.cc
@@ -955,6 +956,7 @@
SET( zypp_repo_cached_HEADERS
repo/cached/RepoImpl.h
repo/cached/PackageImpl.h
+ repo/cached/SrcPackageImpl.h
repo/cached/PatchImpl.h
repo/cached/PatternImpl.h
repo/cached/ProductImpl.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc Tue Jun 26 13:33:44 2007
@@ -250,7 +250,7 @@
RecordId id = appendResolvable( repository_id, ResTraits<SrcPackage>::kind,
NVRA( package->name, package->edition, package->arch ), package->deps );
appendResObjectAttributes( id, package );
- appendPackageBaseAttributes( id, package );
+ //appendPackageBaseAttributes( id, package );
#warning TBD WRONG IMPLEMENTATION
return id;
}
@@ -431,8 +431,7 @@
_pimpl->insert_resolvable_in_repository_cmd->bind(":resolvable_id", id);
_pimpl->insert_resolvable_in_repository_cmd->executenonquery();*/
- return static_cast<RecordId>(id);
- return 1;
+ return id;
}
void CacheStore::appendDependencies( const RecordId &resolvable_id, const data::Dependencies &deps )
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc Tue Jun 26 13:33:44 2007
@@ -62,32 +62,32 @@
//@{
void consumeIndex( const RepoIndex_Ptr & data_r )
{
- SEC << "[Index]" << data_r << endl;
+ //SEC << "[Index]" << data_r << endl;
_repoIndex = data_r;
}
void consumeProd( const data::Product_Ptr & data_r )
{
- SEC << "[Prod]" << data_r << endl;
+ MIL << "[Product] " << data_r << endl;
_prodData = data_r;
_consumer.consumeProduct( _repositoryId, data_r );
}
void consumePkg( const data::Package_Ptr & data_r )
{
- SEC << "[Package]" << data_r << endl;
+ //SEC << "[Package]" << data_r << endl;
_consumer.consumePackage( _repositoryId, data_r );
}
void consumeSrcPkg( const data::SrcPackage_Ptr & data_r )
{
- SEC << "[SrcPackage]" << data_r << endl;
+ //SEC << "[SrcPackage]" << data_r << endl;
_consumer.consumeSourcePackage( _repositoryId, data_r );
}
void consumePat( const data::Pattern_Ptr & data_r )
{
- SEC << "[Pattern]" << data_r << endl;
+ //SEC << "[Pattern]" << data_r << endl;
_consumer.consumePattern( _repositoryId, data_r );
}
//@}
@@ -141,6 +141,8 @@
// ...or parse
_parsedLocales.insert( toParse ); // don't try again.
+#warning DISABLED PACKAGES.LANG PARSING
+ return;
PackagesLangFileReader reader;
reader.setLocale( toParse );
reader.setPkgConsumer( bind( &Impl::consumePkg, this, _1 ) );
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.h Tue Jun 26 13:33:44 2007
@@ -47,7 +47,7 @@
virtual Repository repository() const;
- protected:
+ private:
repo::cached::RepoImpl::Ptr _repository;
data::RecordId _id;
};
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.h Tue Jun 26 13:33:44 2007
@@ -51,7 +51,7 @@
virtual Repository repository() const;
- protected:
+ private:
repo::cached::RepoImpl::Ptr _repository;
data::RecordId _id;
};
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h Tue Jun 26 13:33:44 2007
@@ -71,7 +71,7 @@
virtual Repository repository() const;
- protected:
+ private:
repo::cached::RepoImpl::Ptr _repository;
data::RecordId _id;
};
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.h Tue Jun 26 13:33:44 2007
@@ -56,7 +56,7 @@
virtual Repository repository() const;
- protected:
+ private:
repo::cached::RepoImpl::Ptr _repository;
data::RecordId _id;
};
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.h Tue Jun 26 13:33:44 2007
@@ -59,7 +59,7 @@
virtual Repository repository() const;
- protected:
+ private:
repo::cached::RepoImpl::Ptr _repository;
data::RecordId _id;
};
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.h Tue Jun 26 13:33:44 2007
@@ -57,7 +57,7 @@
virtual Edition distributionEdition() const;
virtual Repository repository() const;
- protected:
+ private:
repo::cached::RepoImpl::Ptr _repository;
data::RecordId _id;
};
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc Tue Jun 26 13:33:44 2007
@@ -18,6 +18,7 @@
#include "zypp/CapFactory.h"
#include "zypp/Package.h"
+#include "zypp/SrcPackage.h"
#include "zypp/Pattern.h"
#include "zypp/Patch.h"
#include "zypp/Message.h"
@@ -26,6 +27,7 @@
#include "zypp/repo/cached/RepoImpl.h"
#include "zypp/repo/cached/PackageImpl.h"
+#include "zypp/repo/cached/SrcPackageImpl.h"
#include "zypp/repo/cached/PatternImpl.h"
#include "zypp/repo/cached/PatchImpl.h"
#include "zypp/repo/cached/MessageImpl.h"
@@ -111,6 +113,12 @@
Package::Ptr package = detail::makeResolvableFromImpl( it->second.second, impl );
_store.insert (package);
}
+ else if ( it->second.first == ResTraits<SrcPackage>::kind )
+ {
+ ResImplTraitscached::SrcPackageImpl::Ptr impl = new cached::SrcPackageImpl(it->first, this);
+ SrcPackage::Ptr srcpackage = detail::makeResolvableFromImpl( it->second.second, impl );
+ _store.insert (srcpackage);
+ }
else if ( it->second.first == ResTraits<Pattern>::kind )
{
ResImplTraitscached::PatternImpl::Ptr impl = new cached::PatternImpl(it->first, this);
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.h?rev=5844&r1=5843&r2=5844&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.h Tue Jun 26 13:33:44 2007
@@ -56,7 +56,7 @@
cache::ResolvableQuery resolvableQuery();
void createResolvables();
void createPatchAndDeltas();
- protected:
+ private:
void read_capabilities( sqlite3x::sqlite3_connection &con, std::map