Author: dmacvicar
Date: Fri Jun 22 16:05:21 2007
New Revision: 5833
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5833&view=rev
Log:
- make RpmHeader return CapabilityImplPtr
- turn the PlainDir Source into a parser
this means plain dir rpms can be cached now
Added:
branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/
branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h
Removed:
branches/REFACTORING-10_3/libzypp/zypp/repo/plaindir/
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h
branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc
branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.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=5833&r1=5832&r2=5833&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Fri Jun 22 16:05:21 2007
@@ -463,6 +463,19 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/susetags
)
+SET( zypp_parser_plaindir_SRCS
+ parser/plaindir/RepoParser.cc
+)
+
+SET( zypp_parser_plaindir_HEADERS
+ parser/plaindir/RepoParser.h
+)
+
+INSTALL( FILES
+ ${zypp_parser_plaindir_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/plaindir
+)
+
SET( zypp_parser_xml_SRCS
parser/xml/Node.cc
parser/xml/ParseDef.cc
@@ -549,11 +562,6 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/yum
)
-INSTALL( FILES
- ${zypp_parser_yum2_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/parser/yum2
-)
-
SET( zypp_pool_SRCS
pool/GetResolvablesToInsDel.cc
pool/PoolImpl.cc
@@ -652,19 +660,6 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/solver/detail
)
-SET( zypp_repo_plaindir_SRCS
- repo/plaindir/PlaindirImpl.cc
-)
-
-SET( zypp_repo_plaindir_HEADERS
- repo/plaindir/PlaindirImpl.h
-)
-
-INSTALL( FILES
- ${zypp_repo_plaindir_HEADERS}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/repo/plaindir
-)
-
SET( zypp_target_SRCS
target/CommitLog.cc
target/CommitPackageCache.cc
@@ -1017,9 +1012,8 @@
${zypp_parser_xmlstore_SRCS}
${zypp_parser_xml_SRCS}
${zypp_parser_yum_SRCS}
+${zypp_parser_plaindir_SRCS}
${zypp_parser_SRCS}
-${zypp_repo_plaindir_SRCS}
-${zypp_source_SRCS}
${zypp_data_SRCS}
${zypp_media_proxyinfo_SRCS}
${zypp_media_SRCS}
@@ -1044,12 +1038,14 @@
)
SET( zypp_lib_HEADERS
-${zypp_repo_plaindir_HEADERS}
${zypp_target_store_xml_HEADERS}
+${zypp_target_rpm_HEADERS}
${zypp_parser_tagfile_HEADERS}
${zypp_parser_susetags_HEADERS}
-${zypp_target_rpm_HEADERS}
-${zypp_parser_yum2_HEADERS}
+${zypp_parser_yum_HEADERS}
+${zypp_parser_plaindir_HEADERS}
+${zypp_parser_xml_HEADERS}
+${zypp_parser_HEADERS}
${zypp_capability_HEADERS}
${zypp_cache_HEADERS}
${zypp_cache_sqlite3x_HEADERS}
@@ -1058,15 +1054,11 @@
${zypp_data_HEADERS}
${zypp_media_HEADERS}
${zypp_target_hal_HEADERS}
-${zypp_parser_xml_HEADERS}
${zypp_media_proxyinfo_HEADERS}
-${zypp_source_yum_HEADERS}
${zypp_base_HEADERS}
${zypp_solver_detail_HEADERS}
${zypp_target_store_HEADERS}
${zypp_url_HEADERS}
-${zypp_source_HEADERS}
-${zypp_parser_HEADERS}
${zypp_HEADERS}
${zypp_zypp_detail_HEADERS}
${zypp_thread_HEADERS}
@@ -1074,7 +1066,6 @@
${zypp_source_susetags_HEADERS}
${zypp_target_modalias_HEADERS}
${zypp_target_HEADERS}
-${zypp_parser_yum_HEADERS}
${zypp_detail_HEADERS}
${zypp_pool_HEADERS}
)
@@ -1094,7 +1085,6 @@
SET_LOGGROUP( "zypp" ${zypp_lib_SRCS} )
# override some defaults
-SET_LOGGROUP( "plaindir" ${zypp_repo_plaindir_SRCS} )
SET_LOGGROUP( "xmlstore" ${zypp_target_store_xml_SRCS} )
#SET_LOGGROUP( "group" ${zypp_target_rpm_SRCS} )
#SET_LOGGROUP( "group" ${zypp_parser_yum2_SRCS} )
Modified: branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h?rev=5833&r1=5832&r2=5833&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/capability/CapabilityImpl.h Fri Jun 22 16:05:21 2007
@@ -309,6 +309,8 @@
}
};
+ typedef std::setCapabilityImpl::Ptr CapabilityImplPtrSet;
+
/////////////////////////////////////////////////////////////////
} // namespace capability
///////////////////////////////////////////////////////////////////
Added: branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc?rev=5833&view=auto
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc (added)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.cc Fri Jun 22 16:05:21 2007
@@ -0,0 +1,294 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#include <iostream>
+#include "zypp/base/Logger.h"
+#include "zypp/base/Iterator.h"
+#include "zypp/base/String.h"
+
+#include
+#include
+
+#include "zypp/parser/plaindir/RepoParser.h"
+#include "zypp/parser/ParseException.h"
+#include "zypp/capability/CapabilityImpl.h"
+#include "zypp/PathInfo.h"
+#include "zypp/ResStore.h"
+#include "zypp/ZConfig.h"
+
+using namespace std;
+using namespace zypp::target::rpm;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace parser
+{ /////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace plaindir
+{ /////////////////////////////////////////////////////////////////
+
+data::Package_Ptr makePackageDataFromHeader( const RpmHeader::constPtr header,
+ set<string> * filerequires,
+ const Pathname & location, data::RecordId &repoid )
+{
+ if ( ! header )
+ return 0;
+
+ if ( header->isSrc() ) {
+ WAR << "Can't make Package from SourcePackage header" << endl;
+ return 0;
+ }
+
+ data::Package_Ptr pkg = new data::Package;
+
+// typedef std::setcapability::CapabilityImpl::Ptr DependencyList;
+// typedef std::map Dependencies;
+ pkg->name = header->tag_name();
+// impl->setRepository( repo );
+// if (!location.empty())
+// impl->setLocation( location );
+
+ try {
+ pkg->edition = Edition( header->tag_version(),
+ header->tag_release(),
+ header->tag_epoch());
+ }
+ catch (Exception & excpt_r) {
+ ZYPP_CAUGHT( excpt_r );
+ WAR << "Package " << pkg->name << " has bad edition '"
+ << (header->tag_epoch().empty()?"":(header->tag_epoch()+":"))
+ << header->tag_version()
+ << (header->tag_release().empty()?"":(string("-") + header->tag_release())) << "'";
+ return 0;
+ }
+
+ Arch arch;
+ try {
+ pkg->arch = Arch( header->tag_arch() );
+ }
+ catch (Exception & excpt_r) {
+ ZYPP_CAUGHT( excpt_r );
+ WAR << "Package " << pkg->name << " has bad architecture '" << header->tag_arch() << "'";
+ return 0;
+ }
+
+ pkg->deps[Dep::REQUIRES] = header->tag_requires( filerequires );
+ pkg->deps[Dep::PREREQUIRES] = header->tag_prerequires( filerequires );
+ pkg->deps[Dep::CONFLICTS] = header->tag_conflicts( filerequires );
+ pkg->deps[Dep::OBSOLETES] = header->tag_obsoletes( filerequires );
+ pkg->deps[Dep::ENHANCES] = header->tag_enhances( filerequires );
+ pkg->deps[Dep::SUPPLEMENTS] = header->tag_supplements( filerequires );
+
+// Dependencies deps;
+
+// RecordId shareDataWith;
+// std::string vendor;
+// ByteCount installedSize;
+// Date buildTime;
+// DefaultIntegral installOnly;
+// TranslatedText summary;
+// TranslatedText description;
+// TranslatedText licenseToConfirm;
+// TranslatedText insnotify;
+// TranslatedText delnotify;
+// RecordId repository;
+
+// Location repositoryLocation;
+// std::string group;
+// std::setstd::string keywords;
+// Changelog changelog;
+// std::liststd::string authors;
+// std::string buildhost;
+// std::string distribution;
+// std::string license;
+// std::string packager;
+// std::string url;
+// std::string operatingSystem;
+// std::string prein;
+// std::string postin;
+// std::string preun;
+// std::string postun;
+//
+
+ list<string> filenames = header->tag_filenames();
+ pkg->deps[Dep::PROVIDES] = header->tag_provides ( filerequires );
+ static str::smatch what;
+ static const str::regex filenameRegex( "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
+ str::regex::optimize|str::regex::nosubs );
+
+ for (list<string>::const_iterator filename = filenames.begin();
+ filename != filenames.end();
+ ++filename)
+ {
+ if ( str::regex_search( filename->begin(), filename->end(), what, filenameRegex ) )
+ {
+ try {
+ pkg->deps[Dep::PROVIDES].insert(capability::buildFile( ResTraits<Package>::kind, *filename ));
+ }
+ catch (Exception & excpt_r)
+ {
+ ZYPP_CAUGHT( excpt_r );
+ WAR << "Ignoring invalid capability: " << *filename << endl;
+ }
+ }
+ }
+
+ return pkg;
+}
+
+
+/** RepoParser implementation.
+ * \todo Clean data on exeption.
+ */
+class RepoParser::Impl
+{
+ public:
+ Impl( const data::RecordId & repositoryId_r,
+ data::ResolvableDataConsumer & consumer_r,
+ const ProgressData::ReceiverFnc & fnc_r )
+ : _repositoryId( repositoryId_r )
+ , _consumer( consumer_r )
+ {
+ _ticks.sendTo( fnc_r );
+ }
+ int extract_packages_from_directory( const Pathname & path,
+ bool recursive);
+ /** Main entry to parser. */
+ void parse( const Pathname & reporoot_r );
+ public:
+
+ private:
+ data::RecordId _repositoryId;
+ data::ResolvableDataConsumer & _consumer;
+ ProgressData _ticks;
+
+ private: // these (and _ticks) are actually scoped per parse() run.
+};
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : RepoParser::Impl::parse
+// METHOD TYPE : void
+//
+void RepoParser::Impl::parse( const Pathname & reporoot_r )
+{
+ extract_packages_from_directory( reporoot_r, true );
+/*if ( ! _ticks.incr() )
+ ZYPP_THROW( AbortRequestException() );*/
+ // Done
+ if ( ! _ticks.toMax() )
+ ZYPP_THROW( AbortRequestException() );
+}
+
+int RepoParser::Impl::extract_packages_from_directory( const Pathname & path,
+ bool recursive)
+{
+ using target::rpm::RpmHeader;
+ Pathname filename;
+ PathInfo magic;
+ bool distro_magic, pkginfo_magic;
+
+// DBG << "extract_packages_from_directory(.., " << path << ", " << repo.info().alias() << ", " << recursive << ")" << endl;
+
+ /*
+ Check for magic files that indicate how to treat the
+ directory. The files aren't read -- it is sufficient that
+ they exist.
+ */
+
+ magic = PathInfo( path + "/RC_SKIP" );
+ if (magic.isExist()) {
+ return 0;
+ }
+
+ magic = PathInfo( path + "/RC_RECURSIVE" );
+ if (magic.isExist())
+ recursive = true;
+
+ magic = PathInfo( path + "/RC_BY_DISTRO" );
+ distro_magic = magic.isExist();
+
+ pkginfo_magic = true;
+ magic = PathInfo( path + "/RC_IGNORE_PKGINFO" );
+ if (magic.isExist())
+ pkginfo_magic = false;
+
+
+ std::liststd::string dircontent;
+ if (filesystem::readdir( dircontent, path, false) != 0) { // dont look for dot files
+ ERR << "readdir " << path << " failed" << endl;
+ return -1;
+ }
+
+ for (std::liststd::string::const_iterator it = dircontent.begin(); it != dircontent.end(); ++it) {
+ Pathname file_path = path + *it;
+ PathInfo file_info( file_path );
+ if (recursive && file_info.isDir()) {
+
+ extract_packages_from_directory( file_path, recursive );
+
+ } else if (file_info.isFile() && file_path.extension() == ".rpm" ) {
+ RpmHeader::constPtr header = RpmHeader::readPackage( file_path, RpmHeader::NOSIGNATURE );
+#warning FIX creation of Package from src.rpm header
+ data::Package_Ptr package = makePackageDataFromHeader( header, NULL, *it, _repositoryId );
+ if (package != NULL) {
+ DBG << "Adding package " << *package << endl;
+ _consumer.consumePackage( _repositoryId, package );
+ }
+ }
+ }
+ return 0;
+}
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : RepoParser
+//
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : RepoParser::RepoParser
+// METHOD TYPE : Ctor
+//
+RepoParser::RepoParser( const data::RecordId & repositoryId_r,
+ data::ResolvableDataConsumer & consumer_r,
+ const ProgressData::ReceiverFnc & fnc_r )
+: _pimpl( new Impl( repositoryId_r, consumer_r, fnc_r ) )
+{}
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : RepoParser::~RepoParser
+// METHOD TYPE : Dtor
+//
+RepoParser::~RepoParser()
+{}
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : RepoParser::parse
+// METHOD TYPE : void
+//
+void RepoParser::parse( const Pathname & reporoot_r )
+{
+ _pimpl->parse( reporoot_r );
+}
+
+/////////////////////////////////////////////////////////////////
+} // namespace plaindir
+///////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+} // namespace parser
+///////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
Added: branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h?rev=5833&view=auto
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h (added)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/plaindir/RepoParser.h Fri Jun 22 16:05:21 2007
@@ -0,0 +1,73 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#ifndef ZYPP_PARSER_PLAINDIR_REPOPARSER_H
+#define ZYPP_PARSER_PLAINDIR_REPOPARSER_H
+
+#include <iosfwd>
+
+#include "zypp/base/PtrTypes.h"
+#include "zypp/base/NonCopyable.h"
+
+#include "zypp/data/RecordId.h"
+#include "zypp/data/ResolvableDataConsumer.h"
+
+#include "zypp/ProgressData.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace parser
+ { /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace plaindir
+ { /////////////////////////////////////////////////////////////////
+
+ /** Plaindir metadata parser. */
+
+ class RepoParser : private base::NonCopyable
+ {
+ public:
+ /** Ctor.
+ *
+ * \param repositoryId_r repository identifier
+ * \param consumer_r consumer of parsed data
+ * \param fnc_r progress reporting function
+ */
+ RepoParser( const data::RecordId & repositoryId_r,
+ data::ResolvableDataConsumer & consumer_r,
+ const ProgressData::ReceiverFnc & fnc_r = ProgressData::ReceiverFnc() );
+ /** Dtor */
+ ~RepoParser();
+
+ /** Parse a local repository located at \a reporoot_r.
+ *
+ * \param reporoot_r The local repositories root directory.
+ * \throw Exception on errors.
+ */
+ void parse( const Pathname & reporoot_r );
+
+ public:
+ class Impl;
+ private:
+ RW_pointer _pimpl;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace plaindir
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+ } // namespace parser
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP2_PARSER_SUSETAGS_REPOPARSER_H
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc?rev=5833&r1=5832&r2=5833&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.cc Fri Jun 22 16:05:21 2007
@@ -21,6 +21,7 @@
const RepoType RepoType::RPMMD(RepoType::RPMMD_e);
const RepoType RepoType::YAST2(RepoType::YAST2_e);
+ const RepoType RepoType::RPMPLAINDIR(RepoType::RPMPLAINDIR_e);
//const RepoType RepoType::NONE(RepoType::NONE_e);
RepoType::RepoType(const std::string & strval_r)
@@ -39,6 +40,7 @@
_table["susetags"] = RepoType::YAST2_e;
_table["yast"] = RepoType::YAST2_e;
_table["yast2"] = RepoType::YAST2_e;
+ _table["plaindir"] = RepoType::RPMPLAINDIR_e;
_table["NONE"] = _table["none"] = RepoType::NONE_e;
}
@@ -61,6 +63,7 @@
// initialize it
_table[RPMMD_e] = "rpm-md";
_table[YAST2_e] = "yast2";
+ _table[RPMPLAINDIR_e] = "plaindir";
_table[NONE_e] = "NONE";
}
return _table[_type];
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h?rev=5833&r1=5832&r2=5833&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/RepoType.h Fri Jun 22 16:05:21 2007
@@ -28,15 +28,19 @@
{
static const RepoType RPMMD;
static const RepoType YAST2;
+ static const RepoType RPMPLAINDIR;
//static const RepoType NONE;
enum Type
{
NONE_e,
RPMMD_e,
- YAST2_e
+ YAST2_e,
+ RPMPLAINDIR_e,
};
+ RepoType() : _type(NONE_e) {}
+
RepoType(Type type) : _type(type) {}
explicit RepoType(const std::string & strval_r);
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc?rev=5833&r1=5832&r2=5833&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc Fri Jun 22 16:05:21 2007
@@ -1104,6 +1104,15 @@
return empty_list;
}
+inline static void insertCaps( CapSet &capset, capability::CapabilityImplPtrSet ptrset, CapFactory &factory )
+{
+ for ( capability::CapabilityImplPtrSet::const_iterator it = ptrset.begin();
+ it != ptrset.end();
+ ++it )
+ {
+ capset.insert( factory.fromImpl(*it) );
+ }
+}
//
// make Package::Ptr from RpmHeader
@@ -1168,9 +1177,9 @@
arch );
list<string> filenames = impl->filenames();
- dataCollect[Dep::PROVIDES] = header->tag_provides ( filerequires );
CapFactory capfactory;
-
+ insertCaps( dataCollect[Dep::PROVIDES], header->tag_provides( filerequires ), capfactory );
+
static str::smatch what;
static const str::regex filenameRegex( "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
str::regex::optimize|str::regex::nosubs );
@@ -1183,7 +1192,7 @@
{
try
{
- dataCollect[Dep::PROVIDES].insert( capfactory.parse(ResTraits<Package>::kind, *filename) );
+ dataCollect[Dep::PROVIDES].insert(capfactory.fromImpl(capability::buildFile(ResTraits<Package>::kind, *filename) ));
}
catch (Exception & excpt_r)
{
@@ -1193,12 +1202,12 @@
}
}
- dataCollect[Dep::REQUIRES] = header->tag_requires( filerequires );
- dataCollect[Dep::PREREQUIRES] = header->tag_prerequires( filerequires );
- dataCollect[Dep::CONFLICTS] = header->tag_conflicts( filerequires );
- dataCollect[Dep::OBSOLETES] = header->tag_obsoletes( filerequires );
- dataCollect[Dep::ENHANCES] = header->tag_enhances( filerequires );
- dataCollect[Dep::SUPPLEMENTS] = header->tag_supplements( filerequires );
+ insertCaps( dataCollect[Dep::REQUIRES], header->tag_requires( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::PREREQUIRES], header->tag_prerequires( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::CONFLICTS], header->tag_conflicts( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::OBSOLETES], header->tag_obsoletes( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::ENHANCES], header->tag_enhances( filerequires ), capfactory );
+ insertCaps( dataCollect[Dep::SUPPLEMENTS], header->tag_supplements( filerequires ), capfactory );
try
{
@@ -1214,7 +1223,6 @@
return pptr;
}
-
const listPackage::Ptr & RpmDb::doGetPackages(callback::SendReport<ScanDBReport> & report)
{
if ( packagesValid() )
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc?rev=5833&r1=5832&r2=5833&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.cc Fri Jun 22 16:05:21 2007
@@ -26,6 +26,7 @@
#include "zypp/base/Exception.h"
using namespace std;
+using namespace zypp::capability;
namespace zypp
{
@@ -272,9 +273,9 @@
//
// DESCRIPTION :
//
-CapSet RpmHeader::PkgRelList_val( tag tag_r, bool pre, set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::PkgRelList_val( tag tag_r, bool pre, set<string> * freq_r ) const
{
- CapSet ret;
+ CapabilityImplPtrSet ret;
int_32 kindFlags = 0;
int_32 kindVersion = 0;
@@ -370,10 +371,9 @@
if ((pre && (f & RPMSENSE_PREREQ))
|| ((! pre) && !(f & RPMSENSE_PREREQ)))
{
- CapFactory _f;
try
{
- Capability cap = _f.parse(
+ CapabilityImpl::Ptr cap = capability::buildVersioned(
ResTraits<Package>::kind,
n,
op,
@@ -397,11 +397,11 @@
//
//
// METHOD NAME : RpmHeader::tag_provides
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_provides( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_provides( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_PROVIDENAME, false, freq_r );
}
@@ -410,11 +410,11 @@
//
//
// METHOD NAME : RpmHeader::tag_requires
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_requires( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_requires( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_REQUIRENAME, false, freq_r );
}
@@ -423,11 +423,11 @@
//
//
// METHOD NAME : RpmHeader::tag_requires
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_prerequires( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_prerequires( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_REQUIRENAME, true, freq_r );
}
@@ -436,11 +436,11 @@
//
//
// METHOD NAME : RpmHeader::tag_conflicts
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_conflicts( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_conflicts( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_CONFLICTNAME, false, freq_r );
}
@@ -449,11 +449,11 @@
//
//
// METHOD NAME : RpmHeader::tag_obsoletes
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_obsoletes( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_obsoletes( set<string> * freq_r ) const
{
return PkgRelList_val( RPMTAG_OBSOLETENAME, false, freq_r );
}
@@ -462,16 +462,16 @@
//
//
// METHOD NAME : RpmHeader::tag_enhances
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_enhances( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_enhances( set<string> * freq_r ) const
{
#ifdef HAVE_RPM_ENHANCES
return PkgRelList_val( RPMTAG_ENHANCESNAME, false, freq_r );
#else
- return CapSet();
+ return CapabilityImplPtrSet();
#endif
}
@@ -479,13 +479,13 @@
//
//
// METHOD NAME : RpmHeader::tag_supplements
-// METHOD TYPE : CapSet
+// METHOD TYPE : CapabilityImplPtrSet
//
// DESCRIPTION :
//
-CapSet RpmHeader::tag_supplements( set<string> * freq_r ) const
+CapabilityImplPtrSet RpmHeader::tag_supplements( set<string> * freq_r ) const
{
- return CapSet();
+ return CapabilityImplPtrSet();
#warning NEEDS RPMTAG_SUPPLEMENTSNAME
#if 0
return PkgRelList_val( RPMTAG_SUPPLEMENTSNAME, false, freq_r );
Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.h?rev=5833&r1=5832&r2=5833&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmHeader.h Fri Jun 22 16:05:21 2007
@@ -22,6 +22,8 @@
#include "zypp/CapSetFwd.h"
#include "zypp/Pathname.h"
#include "zypp/DiskUsage.h"
+#include "zypp/capability/CapabilityImpl.h"
+
namespace zypp
{
@@ -68,7 +70,7 @@
private:
- CapSet PkgRelList_val( tag tag_r, bool pre, std::setstd::string * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet PkgRelList_val( tag tag_r, bool pre, std::setstd::string * freq_r = 0 ) const;
public:
@@ -107,31 +109,31 @@
/**
* If <code>freq_r</code> is not NULL, file dependencies found are inserted.
**/
- CapSet tag_provides ( std::setstd::string * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_provides ( std::setstd::string * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_requires ( std::setstd::string * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_requires ( std::setstd::string * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_prerequires ( std::setstd::string * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_prerequires ( std::setstd::string * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_conflicts( std::setstd::string * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_conflicts( std::setstd::string * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_obsoletes( std::setstd::string * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_obsoletes( std::setstd::string * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_enhances( std::setstd::string * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_enhances( std::setstd::string * freq_r = 0 ) const;
/**
* @see #tag_provides
**/
- CapSet tag_supplements( std::setstd::string * freq_r = 0 ) const;
+ capability::CapabilityImplPtrSet tag_supplements( std::setstd::string * freq_r = 0 ) const;
ByteCount tag_size() const;
ByteCount tag_archivesize() const;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org