{ return _pimpl->asString(); }
-
+ std::string Capability::name() const
+ { return "CapabilityName"; }//return _pimpl->name(); }
+
/******************************************************************
**
** FUNCTION NAME : operator<<
/** More or less human readable representation as string. */
std::string asString() const;
- /** */
+ /** More or less humal readable name of the dependency */
+ std::string name() const;
private:
#include <zypp/solver/detail/Channel.h>
#include <zypp/solver/detail/World.h>
+#include <zypp/base/Logger.h>
/////////////////////////////////////////////////////////////////////////
namespace zypp
_priority = -1;
_priority_unsubscribed = -1;
- // if (getenv ("RC_SPEW")) fprintf (stderr, "Channel() [%p] (%s)\n", this, asString().c_str());
+ _DBG("RC_SPEW") << "Channel() [" << this << "] (" << asString() << ")" << endl ;
}
free ((void *)priority_str);
free ((void *)priority_unsubscribed_str);
- // if (getenv ("RC_SPEW")) fprintf (stderr, "Channel(xml) [%p] (%s)\n", this, asString().c_str());
+ _DBG("RC_SPEW") << "Channel(xml) [" << this << "] (" << asString() << ")" << endl;
}
/* } */
CapFactory factory;
Capability dependency;
- bool check;
+ bool check = false;
dependency = factory.parse ( resItem->kind(),
resItem->name(),
Rel::EQ,
- resItem->edition(),
- resItem->arch());
- check = _dependency.matches (dependency);
+ resItem->edition());
+// check = _dependency.matches (dependency);
return check;
}
#include <zypp/solver/detail/PackageUpdate.h>
#include <zypp/solver/detail/World.h>
#include <zypp/solver/detail/XmlNode.h>
-
+#include <zypp/base/Logger.h>
#include <zypp/CapFactory.h>
#include <zypp/CapSet.h>
return factory.parse ( ResTraits<zypp::Package>::kind,
name,
relation,
- Edition (version, release, epoch),
- arch);
+ Edition (version, release, epoch));
}
static void
Capability selfdep = factory.parse ( ResTraits<zypp::Package>::kind,
name,
Rel::EQ,
- Edition( version, release, zypp::str::numstring(epoch)),
- arch);
+ Edition( version, release, zypp::str::numstring(epoch)));
CapSet::const_iterator piter;
}
}
if (piter == dep_table.provides.end()) { // no self provide found, construct one
- if (getenv ("RC_SPEW")) fprintf (stderr, "Adding self-provide [%s]\n", selfdep.asString().c_str());
+ _DBG("RC_SPEW") << "Adding self-provide [" << selfdep.asString() << "]" << endl;
dep_table.provides.insert (selfdep);
}
#include <zypp/solver/detail/QueueItemBranch.h>
#include <zypp/solver/detail/QueueItem.h>
#include <zypp/solver/detail/Resolver.h>
+#include <zypp/base/Logger.h>
/////////////////////////////////////////////////////////////////////////
namespace zypp
bool
QueueItemBranch::process (ResolverContextPtr context, QueueItemList & qil)
{
- if (getenv ("RC_SPEW")) fprintf (stderr, "QueueItemBranch::process(%s)\n", asString().c_str());
+ _DBG("RC_SPEW") << "QueueItemBranch::process(" << asString() << ")" << endl;
QueueItemList live_branches;
unsigned int branch_count;
#include <zypp/solver/detail/ResolverInfoObsoletes.h>
#include <zypp/CapFactory.h>
#include <zypp/CapSet.h>
-
+#include <zypp/base/Logger.h>
/////////////////////////////////////////////////////////////////////////
namespace zypp
ResolverInfoPtr log_info;
CapFactory factory;
- if (getenv ("RC_SPEW")) fprintf (stderr, "conflict_process_cb (resolvable[%s], cap[%s], info [%s]\n", resItem->asString().c_str(), cap.asString().c_str(), info->conflicting_resItem->asString().c_str());
- if (getenv ("RC_SPEW")) fprintf (stderr, "conflict_process_cb (info->dep [%s]\n", info->dep.asString().c_str());
+ _DBG("RC_SPEW") << "conflict_process_cb (resolvable[" << resItem->asString() <<"], cap[" << cap.asString() << "], info [" <<
+ info->conflicting_resItem->asString() << "]" << endl;
+ _DBG("RC_SPEW") << "conflict_process_cb (info->dep [" << info->dep.asString() << "]" << endl;
/* We conflict with ourself. For the purpose of installing ourself, we
* just ignore it, but it's Debian's way of saying that one and only one
Capability capTest = factory.parse ( resItem->kind(),
resItem->name(),
Rel::EQ,
- resItem->edition(),
- resItem->arch());
+ resItem->edition());
if (info->actually_an_obsolete
&& capTest != cap)
status = info->context->getStatus (resItem);
- if (getenv ("RC_SPEW")) fprintf (stderr, "conflict_process_cb (resolvable[%s]<%s>\n", resItem->asString().c_str(), ResolverContext::toString(status).c_str());
+ _DBG("RC_SPEW") << "conflict_process_cb (resolvable[" << resItem->asString() << "]<" << ResolverContext::toString(status) << ">" << endl;
switch (status) {
Capability maybe_upgrade_dep = factory.parse ( resItem->kind(),
resItem->name(),
Rel::ANY,
- Edition::noepoch,
- resItem->arch());
+ Edition::noepoch);
info->world->foreachProvidingResItem (maybe_upgrade_dep, upgrade_candidates_cb, (void *)&upgrade_info);
bool
QueueItemConflict::process (ResolverContextPtr context, QueueItemList & new_items)
{
- if (getenv ("RC_SPEW")) fprintf (stderr, "QueueItemConflict::process(%s)\n", this->asString().c_str());
+ _DBG("RC_SPEW") << "QueueItemConflict::process(" << this->asString() << ")" << endl;
ConflictProcessInfo info = { world(), _conflicting_resItem, _dep, context, new_items, "", "", _actually_an_obsolete };
#include <zypp/solver/detail/QueueItemGroup.h>
#include <zypp/solver/detail/QueueItem.h>
+#include <zypp/base/Logger.h>
/////////////////////////////////////////////////////////////////////////
namespace zypp
bool
QueueItemGroup::process (ResolverContextPtr context, QueueItemList & new_items)
{
- if (getenv ("RC_SPEW")) fprintf (stderr, "QueueItemGroup::process\n");
+ _DBG("RC_SPEW") << "QueueItemGroup::process" << endl;
bool did_something = false;
#include <zypp/solver/detail/World.h>
#include <zypp/solver/detail/ResItemAndDependency.h>
#include <zypp/CapSet.h>
+#include <zypp/base/Logger.h>
/////////////////////////////////////////////////////////////////////////
namespace zypp
, _explicitly_requested (false)
{
constResItemPtr upgrades = world->findInstalledResItem (resItem);
- if (getenv("RC_SPEW")) fprintf (stderr, "QueueItemInstall::QueueItemInstall(%s) upgrades %s\n", resItem->asString().c_str(), upgrades!=NULL?upgrades->asString().c_str():"nothing");
+ _DBG("RC_SPEW") << "QueueItemInstall::QueueItemInstall(" << resItem->asString() << ") upgrades ";
+ if (upgrades!=NULL)
+ {
+ _DBG("RC_SPEW") << upgrades->asString() << endl;
+ }
+ else
+ {
+ _DBG("RC_SPEW") << "nothing" << endl;
+ }
if (upgrades
&& ! (upgrades->equals (resItem))) {
setUpgrades(upgrades);
bool
QueueItemInstall::process (ResolverContextPtr context, QueueItemList & qil)
{
- if (getenv ("RC_SPEW")) fprintf (stderr, "QueueItemInstall::process(%s)\n", this->asString().c_str());
+ _DBG("RC_SPEW") << "QueueItemInstall::process(" << this->asString() << ")" << endl;
constResItemPtr resItem = _resItem;
string res_name = resItem->asString();
&& _resItem->equals (_upgrades)) {
ResolverInfoPtr info;
- if (getenv ("RC_SPEW")) fprintf (stderr, "upgrades equal resItem, skipping\n");
+ _DBG("RC_SPEW") << "upgrades equal resItem, skipping" << endl;
msg = string("Skipping ") + res_name + (": already installed");
info = new ResolverInfoMisc (_resItem, RESOLVER_INFO_PRIORITY_VERBOSE, msg);
if (!_needed_by.empty()) {
bool still_needed = false;
- if (getenv ("RC_SPEW")) fprintf (stderr, "still needed ");
+ _DBG("RC_SPEW") << "still needed " << endl;
for (CResItemList::const_iterator iter = _needed_by.begin(); iter != _needed_by.end() && !still_needed; iter++) {
ResItemStatus status = context->getStatus (*iter);
- if (getenv ("RC_SPEW")) fprintf (stderr, "by: [status: %s] %s\n", ResolverContext::toString(status).c_str(), (*iter)->asString().c_str());
+ _DBG("RC_SPEW") << "by: [status: " << ResolverContext::toString(status) << "] " << (*iter)->asString() << endl;
if (! resItem_status_is_to_be_uninstalled (status)) {
still_needed = true;
}
if (_upgrades == NULL) {
- if (getenv ("RC_SPEW")) fprintf (stderr, "simple install of %s\n", resItem->asString(true).c_str());
+ _DBG("RC_SPEW") << "simple install of " << resItem->asString(true) << endl;
context->installResItem (resItem, context->verifying(), /* is_soft */ _other_penalty);
QueueItemUninstallPtr uninstall_item;
- if (getenv ("RC_SPEW")) fprintf (stderr, "upgrade install of %s\n", resItem->asString().c_str());
+ _DBG("RC_SPEW") << "upgrade install of " << resItem->asString() << endl;
context->upgradeResItem (resItem, _upgrades, context->verifying(), /* is_soft */ _other_penalty);
for (CapSet::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
const Capability dep = *iter;
if (!context->requirementIsMet (dep, false)) {
- if (getenv("RC_SPEW")) fprintf (stderr, "this requires %s\n", dep.asString().c_str());
+ _DBG("RC_SPEW") << "this requires " << dep.asString() << endl;
QueueItemRequirePtr req_item = new QueueItemRequire (world(), dep);
req_item->addResItem (resItem);
qil.push_front (req_item);
deps = resItem->conflicts();
for (CapSet::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
const Capability dep = *iter;
- if (getenv("RC_SPEW")) fprintf (stderr, "this conflicts with '%s'\n", dep.asString().c_str());
+ _DBG("RC_SPEW") << "this conflicts with '" << dep.asString() << "'" << endl;
QueueItemConflictPtr conflict_item = new QueueItemConflict (world(), dep, resItem);
qil.push_front (conflict_item);
}
deps = resItem->obsoletes();
for (CapSet::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
const Capability dep = *iter;
- if (getenv("RC_SPEW")) fprintf (stderr, "this obsoletes %s\n", dep.asString().c_str());
+ _DBG("RC_SPEW") << "this obsoletes " << dep.asString() << endl;
QueueItemConflictPtr conflict_item = new QueueItemConflict (world(), dep, resItem);
conflict_item->setActuallyAnObsolete();
qil.push_front (conflict_item);
continue;
}
- if (getenv("RC_SPEW")) fprintf (stderr, "because: '%s'\n", conflicting_resItem->asString(true).c_str());
+ _DBG("RC_SPEW") << "because: '" << conflicting_resItem->asString(true) << "'" << endl;
uninstall_item = new QueueItemUninstall (world(), conflicting_resItem, "conflict");
uninstall_item->setDueToConflict ();
bool
ResItemAndDependency::verifyRelation (const Capability & dep) const
{
+#if 0
#if PHI
// don't check the channel, thereby honoring conflicts from installed resItems to to-be-installed resItems
return dep.matches (_dependency);
if (!dep.matches (_dependency)) {
return false;
}
+#endif
#if 0
if (getenv ("SPEW_DEP")) fprintf (stderr, "ResItemAndDependency::verifyRelation _resItem->channel() %s, dep->channel() %s\n", _resItem->channel()->asString().c_str(), dep->channel()->asString().c_str());
return _resItem->channel()->equals (dep->channel());
for (ResItemAndDependencyTable::const_iterator iter = _requires_by_name.lower_bound(dep.name()); iter != _requires_by_name.upper_bound(dep.name()); iter++) {
constResItemAndDependencyPtr r_and_d = iter->second;
- if (r_and_d && r_and_d->dependency().matches (dep)) {
+ if (r_and_d ) {//&& r_and_d->dependency().matches (dep)) {
/* Skip dups if one of them in installed. */
if (r_and_d->resItem()->isInstalled()
/* FIXME: should get Channel from XML */
/* FIXME: should get Kind from XML */
- if ( std::strlen(arch.c_str()) > 0)
- {
- return factory.parse ( ResTraits<zypp::Package>::kind,
- name,
- relation,
- Edition (version, release, epoch),
- Arch(arch));
- }
- else
- {
- return factory.parse ( ResTraits<zypp::Package>::kind,
- name,
- relation,
- Edition (version, release, epoch),
- Arch_noarch);
- }
+ return factory.parse ( ResTraits<zypp::Package>::kind,
+ name,
+ relation,
+ Edition (version, release, epoch));
}
Capability selfdep = factory.parse ( ResTraits<zypp::Package>::kind,
_current_package_name,
Rel::EQ,
- _current_package_edition,
- _current_package_arch);
+ _current_package_edition);
CapSet::const_iterator piter;
for (piter = _current_provides.begin(); piter != _current_provides.end(); piter++) {
if ((*piter) == selfdep)
#include <zypp/solver/detail/extract.h>
#include <zypp/solver/detail/XmlParser.h>
#include <zypp/solver/detail/utils.h>
-
+#include <zypp/base/Logger.h>
#include <zypp/solver/detail/debug.h>
/////////////////////////////////////////////////////////////////////////
PackagePtr package;
int count = 0;
- if (getenv ("RC_SPEW_XML")) fprintf (stderr, "extract_packages_from_xml_node ()\n");
+ _DBG("RC_SPEW_XML") << "extract_packages_from_xml_node ()" << endl;
// search the 'package' node
while (node && !node->equals("package")) {
if (node->equals("package")) {
package = new Package (node, channel);
if (package) {
- if (getenv ("RC_SPEW")) fprintf (stderr, "%s\n", package->asString(true).c_str());
+ _DBG("RC_SPEW") << package->asString(true) << endl;
bool ok = true;
if (callback)
ok = callback (package, data);
unsigned int count = 0;
PackageList packages;
- if (getenv ("RC_SPEW_XML")) fprintf (stderr, "extract_packages_from_helix_buffer(%.32s...,%ld,...)\n", buf, (long)len);
+ _DBG("RC_SPEW_XML") << "extract_packages_from_helix_buffer(" << buf << "...," << (long)len << ",...)" << endl;
if (buf == NULL || len == 0)
return 0;
count = packages.size();
- if (getenv ("RC_SPEW_XML")) fprintf (stderr, "extract_packages_from_helix_buffer: parsed %d packages\n", count);
+ _DBG("RC_SPEW_XML") << "extract_packages_from_helix_buffer: parsed " << count << "packages" << endl;
if (callback != NULL) {
for (PackageList::iterator iter = packages.begin(); iter != packages.end(); iter++) {