Author: mlandres
Date: Tue May 8 20:47:48 2007
New Revision: 5519
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5519&view=rev
Log:
start to review and clean up ResolvableData
Modified:
trunk/libzypp/zypp/data/ResolvableData.cc
trunk/libzypp/zypp/data/ResolvableData.h
trunk/libzypp/zypp/parser/yum/PrimaryFileReader.cc
Modified: trunk/libzypp/zypp/data/ResolvableData.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/data/ResolvableData.cc?rev=5519&r1=5518&r2=5519&view=diff
==============================================================================
--- trunk/libzypp/zypp/data/ResolvableData.cc (original)
+++ trunk/libzypp/zypp/data/ResolvableData.cc Tue May 8 20:47:48 2007
@@ -27,12 +27,12 @@
IMPL_PTR_TYPE(Product);
IMPL_PTR_TYPE(Packagebase);
IMPL_PTR_TYPE(Package);
-IMPL_PTR_TYPE(Sourcepackage);
+IMPL_PTR_TYPE(SrcPackage);
std::ostream & ResObject::dumpOn( std::ostream & str ) const
{
- str << "[ " << name << " " << edition << " ]";
+ str << "[ " << name << " " << edition << " " << arch << " ]";
return str;
// << " provides: " << provides << endl
// << " conflicts: " << conflicts << endl
Modified: trunk/libzypp/zypp/data/ResolvableData.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/data/ResolvableData.h?rev=5519&r1=5518&r2=5519&view=diff
==============================================================================
--- trunk/libzypp/zypp/data/ResolvableData.h (original)
+++ trunk/libzypp/zypp/data/ResolvableData.h Tue May 8 20:47:48 2007
@@ -20,6 +20,7 @@
#include "zypp/capability/CapabilityImpl.h"
#include "zypp/Pathname.h"
+#include "zypp/NVR.h"
#include "zypp/Edition.h"
#include "zypp/ByteCount.h"
#include "zypp/Arch.h"
@@ -33,7 +34,7 @@
namespace data
{
- typedef std::listcapability::CapabilityImpl::Ptr DependencyList;
+ typedef std::setcapability::CapabilityImpl::Ptr DependencyList;
typedef std::map Dependencies;
///////////////////////////////////////////////////////////////////
@@ -43,14 +44,14 @@
class Resolvable : public base::ReferenceCounted, private base::NonCopyable
{
public:
- Resolvable()
- {};
+ Resolvable()
+ {};
- std::string name;
- Edition edition;
- Arch arch;
+ std::string name;
+ Edition edition;
+ Arch arch;
- Dependencies deps;
+ Dependencies deps;
};
///////////////////////////////////////////////////////////////////
@@ -64,14 +65,13 @@
: source_media_nr(1), install_only(false)
{}
-
TranslatedText summary;
TranslatedText description;
- std::string insnotify;
- std::string delnotify;
+ TranslatedText insnotify;
+ TranslatedText delnotify;
- std::string license_to_confirm;
+ TranslatedText license_to_confirm;
std::string vendor;
/** Installed size. \see zypp::ResObject::size() */
@@ -193,14 +193,18 @@
public:
Pattern()
- : user_visible(true)
+ : is_default(false), user_visible(true)
{};
- std::string default_;
+ bool is_default;
bool user_visible;
TranslatedText category;
std::string icon;
+ std::string order;
std::string script;
+
+ DependencyList includes;
+ DependencyList extends;
};
///////////////////////////////////////////////////////////////////
@@ -215,7 +219,6 @@
{
public:
Product() {};
- ~Product() {};
std::string type;
std::string vendor;
@@ -240,9 +243,9 @@
class Packagebase : public ResObject
{
public:
- Packagebase() {};
- ~Packagebase() {};
-
+ enum PackageType { BIN, SRC };
+ virtual PackageType packageType() const = 0;
+ public:
std::string type;
CheckSum checksum;
// changlelog?
@@ -276,14 +279,21 @@
* Data Object for Package resolvable
*/
struct Package : public Packagebase
- {};
+ {
+ virtual PackageType packageType() const { return BIN; }
+
+ /** NVR of the corresponding SrcPackage. */
+ shared_ptr<NVR> srcPackageIdent;
+ };
- DEFINE_PTR_TYPE(Sourcepackage);
+ DEFINE_PTR_TYPE(SrcPackage);
/**
- * Data Object for Sourcepackage resolvable
+ * Data Object for SrcPackage resolvable
*/
- struct Sourcepackage : public Packagebase
- {};
+ struct SrcPackage : public Packagebase
+ {
+ virtual PackageType packageType() const { return SRC; }
+ };
///////////////////////////////////////////////////////////////////
template<class _Res> class SpecificData;
Modified: trunk/libzypp/zypp/parser/yum/PrimaryFileReader.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/PrimaryFileReader.cc?rev=5519&r1=5518&r2=5519&view=diff
==============================================================================
--- trunk/libzypp/zypp/parser/yum/PrimaryFileReader.cc (original)
+++ trunk/libzypp/zypp/parser/yum/PrimaryFileReader.cc Tue May 8 20:47:48 2007
@@ -110,7 +110,7 @@
if (reader_r->name() == "packager")
{
_package->packager = reader_r.nodeText().asString();
-// DBG << "packager: " << _package->packager << endl;
+// DBG << "packager: " << _package->packager << endl;
return true;
}
@@ -207,7 +207,7 @@
<< reader_r->getAttribute("name").asString()
<< " " << edition << endl;
*/
- _package->deps[_dtype].push_back(
+ _package->deps[_dtype].insert(
zypp::capability::parse(
ResTraits<Package>::kind,
reader_r->getAttribute("name").asString(),
@@ -308,7 +308,7 @@
_expect_rpm_entry = true;
return true;
}
-
+
if (reader_r->name() == "file")
{
// TODO figure out how to read files
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org