[Aptitude-svn-commit] r4137 - in branches/aptitude-0.3/aptitude: .
src
Daniel Burrows
dburrows at costa.debian.org
Tue Sep 20 20:45:54 UTC 2005
Author: dburrows
Date: Tue Sep 20 20:45:51 2005
New Revision: 4137
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/solution_fragment.cc
branches/aptitude-0.3/aptitude/src/solution_fragment.h
Log:
Add a routine to format a dependency with version information.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Tue Sep 20 20:45:51 2005
@@ -1,5 +1,10 @@
2005-09-20 Daniel Burrows <dburrows at debian.org>
+ * src/solution_fragment.cc, src/solution_fragment.h:
+
+ Add a routine to display a description of a dependency that
+ might be a conflict through a Provides.
+
* src/solution_screen.cc:
Remember that both trees have their visible flag set even though
Modified: branches/aptitude-0.3/aptitude/src/solution_fragment.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/solution_fragment.cc (original)
+++ branches/aptitude-0.3/aptitude/src/solution_fragment.cc Tue Sep 20 20:45:51 2005
@@ -124,6 +124,19 @@
}
}
+wstring conflict_text(const pkgCache::DepIterator &conflict,
+ const pkgCache::PrvIterator &prv)
+{
+ if(prv.end() || conflict->Type != pkgCache::Dep::Conflicts)
+ return dep_text(conflict);
+
+ return swsprintf(transcode(_("%s conflicts with %s [provided by %s %s]")).c_str(),
+ const_cast<pkgCache::DepIterator &>(conflict).ParentPkg().Name(),
+ const_cast<pkgCache::PrvIterator &>(prv).ParentPkg().Name(),
+ const_cast<pkgCache::PrvIterator &>(prv).OwnerPkg().Name(),
+ const_cast<pkgCache::PrvIterator &>(prv).OwnerVer().VerStr());
+}
+
fragment *action_fragment(const aptitude_solution::action &a)
{
if(a.ver.get_ver().end())
Modified: branches/aptitude-0.3/aptitude/src/solution_fragment.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/solution_fragment.h (original)
+++ branches/aptitude-0.3/aptitude/src/solution_fragment.h Tue Sep 20 20:45:51 2005
@@ -47,6 +47,17 @@
/** \return descriptive text about a single dependency. */
std::wstring dep_text(const pkgCache::DepIterator &d);
+/** \return descriptive text about a conflict through a provides.
+ *
+ * \param conflict any dependency
+ * \param p a provides iterator corresponding to conflict. If conflict
+ * is not a Conflict, then p is ignored and conflict_text is
+ * identical to dep_text. Otherwise, p is taken to be
+ * the provides through which the conflict was discovered.
+ */
+std::wstring conflict_text(const pkgCache::DepIterator &conflict,
+ const pkgCache::PrvIterator &p);
+
/** \return descriptive text about the targets of a dependency. */
std::string dep_targets(const pkgCache::DepIterator &start);
More information about the Aptitude-svn-commit
mailing list