Mailinglist Archive: zypp-commit (233 mails)

< Previous Next >
[zypp-commit] <libzypp> master : Repository: expose satsolvers priority values.
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Fri, 6 Nov 2009 21:51:47 +0100
  • Message-id: <E1N6WCU-0006Bf-3h@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit b55117367a2e49a16704d7df381fb4728da3b920
Author: Michael Andres <ma@xxxxxxx>
Date: Fri Nov 6 21:51:47 2009 +0100

Repository: expose satsolvers priority values.
---
zypp/Repository.cc | 14 ++++++++++++++
zypp/Repository.h | 11 +++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/zypp/Repository.cc b/zypp/Repository.cc
index d7c7f53..d67ff82 100644
--- a/zypp/Repository.cc
+++ b/zypp/Repository.cc
@@ -9,6 +9,7 @@
/** \file zypp/sat/Repository.cc
*
*/
+#include <climits>
#include <iostream>

#include "zypp/base/Logger.h"
@@ -63,6 +64,19 @@ namespace zypp
std::string Repository::name() const
{ return info().name(); }

+ int Repository::satInternalPriority() const
+ {
+ NO_REPOSITORY_RETURN( INT_MIN );
+ return _repo->priority;
+ }
+
+ int Repository::satInternalSubPriority() const
+ {
+ NO_REPOSITORY_RETURN( INT_MIN );
+ return _repo->subpriority;
+ }
+
+
zypp::Date Repository::generatedTimestamp() const
{
NO_REPOSITORY_RETURN( 0 );
diff --git a/zypp/Repository.h b/zypp/Repository.h
index 5976c8e..229bc49 100644
--- a/zypp/Repository.h
+++ b/zypp/Repository.h
@@ -262,6 +262,17 @@ namespace zypp
::_Repo * get() const;
/** Expert backdoor. */
IdType id() const { return _id; }
+ /** satsolver internal priorities.
+ * Unlike the \ref RepoInfo priority which tries to be YUM conform
+ * (H[1-99]L), this one is the solvers internal priority
representation.
+ * It is type \c int and as one might expect it, the higher the value
+ * the higher the priority. Subpriority is currently used to express
+ * media preferences (\see \ref MediaPriority).
+ */
+ //{@
+ int satInternalPriority() const;
+ int satInternalSubPriority() const;
+ //*}
private:
#ifndef SWIG // Swig treats it as syntax error
friend base::SafeBool<Repository>::operator bool_type() const;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages