ref: refs/heads/master
commit 5959b3c75cbbe2013ca85726b176f732d9a8bc1c
Author: Klaus Kämpf
Date: Mon Mar 9 15:22:38 2009 +0100
improved comments
---
bindings/covenant.i | 46 +++++++++++++++++++++++++++++++++++++++-------
bindings/pool.i | 2 --
bindings/relation.i | 24 ++++++++++++++++++++++--
bindings/satsolver.i | 12 ++++--------
4 files changed, 65 insertions(+), 19 deletions(-)
diff --git a/bindings/covenant.i b/bindings/covenant.i
index 6fa99ea..a163bfc 100644
--- a/bindings/covenant.i
+++ b/bindings/covenant.i
@@ -6,31 +6,63 @@
%rename(Covenant) _Covenant;
typedef struct _Covenant {} Covenant;
-
+/*
+ * Covenants ensure specific dependencies in the (installed) system.
+ * They are usually used to implement locks.
+ *
+ * There is no constructor for Covenants defined, Covenants are created through the Solver,
+ * see 'Solver.include' and 'Solver.exclude'
+ *
+ * Convenants can affect specific Solvables, Solvables per-name or
+ * Solvables per-provides. In the latter case, when including
+ * Solvables per-name or per-provides, the solver is free to
+ * choose a matching solvable.
+ *
+ * See also: Solver.include, Solver.exclude
+ *
+ */
%extend Covenant {
+ /* ensure this solvable is installed */
%constant int INCLUDE_SOLVABLE = SOLVER_INSTALL_SOLVABLE;
+ /* ensure this solvable is NOT installed */
%constant int EXCLUDE_SOLVABLE = SOLVER_ERASE_SOLVABLE;
+ /* ensure a solvable (any solvable) of this name is installed */
%constant int INCLUDE_SOLVABLE_NAME = SOLVER_INSTALL_SOLVABLE_NAME;
+ /* ensure NO solvable of this name is installed */
%constant int EXCLUDE_SOLVABLE_NAME = SOLVER_ERASE_SOLVABLE_NAME;
+ /* ensure a solvable (any solvable) providing this relation is installed */
%constant int INCLUDE_SOLVABLE_PROVIDES = SOLVER_INSTALL_SOLVABLE_PROVIDES;
+ /* ensure NO solvable providing this relation is installed */
%constant int EXCLUDE_SOLVABLE_PROVIDES = SOLVER_ERASE_SOLVABLE_PROVIDES;
- /* no constructor defined, Covenants are created through the Solver,
- see 'Solver.include' and 'Solver.excluding' */
~Covenant()
{ covenant_free( $self ); }
-
- int cmd()
+
+ /* operation of this covenant
+ * i.e. Satsolver::INCLUDE_SOLVABLE_PROVIDES
+ *
+ */
+ int op()
{ return $self->cmd; }
+ /* solvable this covenant affects
+ * non-nil only for operations INCLUDE_SOLVABLE and EXCLUDE_SOLVABLE
+ *
+ */
XSolvable *solvable()
{ return covenant_xsolvable( $self ); }
+ /* name this covenant affects
+ * non-nil only for operations INCLUDE_SOLVABLE_NAME and EXCLUDE_SOLVABLE_NAME
+ *
+ */
const char *name()
{ return covenant_name( $self ); }
+ /* relation this covenant affects
+ * non-nil only for operations INCLUDE_SOLVABLE_PROVIDES and EXCLUDE_SOLVABLE_PROVIDES
+ *
+ */
Relation *relation()
{ return covenant_relation( $self ); }
}
-
-
diff --git a/bindings/pool.i b/bindings/pool.i
index a3004da..9e6bf3b 100644
--- a/bindings/pool.i
+++ b/bindings/pool.i
@@ -1,7 +1,6 @@
/*-------------------------------------------------------------*/
/* Pool
-=begin rdoc
Document-class: Pool
The pool contains information about solvables
stored optimized for memory consumption and fast retrieval.
@@ -10,7 +9,6 @@ Solvables represent (RPM) packages and are grouped in repositories.
Solving of dependencies works on the pool, usually with a
distinguished repository of installed solvables.
-=end
*/
diff --git a/bindings/relation.i b/bindings/relation.i
index e0a4a5b..22b9eb4 100644
--- a/bindings/relation.i
+++ b/bindings/relation.i
@@ -8,20 +8,40 @@ typedef struct _Relation {} Relation;
%extend Relation {
-/* operation */
+ /* operation constants */
+
+ /* the no-op relation */
%constant int REL_NONE = 0;
+ /* greater-than */
%constant int REL_GT = REL_GT;
+ /* equality */
%constant int REL_EQ = REL_EQ;
+ /* greater-equal */
%constant int REL_GE = (REL_GT|REL_EQ);
+ /* less-than */
%constant int REL_LT = REL_LT;
+ /* not-equal */
%constant int REL_NE = (REL_LT|REL_GT);
+ /* less-equal */
%constant int REL_LE = (REL_LT|REL_EQ);
+ /* and, relation between relations */
%constant int REL_AND = REL_AND;
+ /* or, relation between relations */
%constant int REL_OR = REL_OR;
+ /* with, relation between relations, affecting the same solvable */
%constant int REL_WITH = REL_WITH;
+ /* namespace */
%constant int REL_NAMESPACE = REL_NAMESPACE;
- %feature("autodoc", "1");
+ /*
+ * Document-method: new
+ * create a new relation
+ * see also: create_relation
+ * call-seq
+ * Relation.new pool, "kernel" -> Relation
+ * Relation.new pool, "kernel", REL_GT, "2.6.26" -> Relation
+ *
+ */
Relation( Pool *pool, const char *name, int op = 0, const char *evr = NULL )
{ return relation_create( pool, name, op, evr ); }
~Relation()
diff --git a/bindings/satsolver.i b/bindings/satsolver.i
index a22c67c..57ef33e 100644
--- a/bindings/satsolver.i
+++ b/bindings/satsolver.i
@@ -1,20 +1,16 @@
%{
/*
-=begin rdoc
+Document-module: Satsolver
- SatSolver is the module namespace for sat-solver bindings.
+ Satsolver is the module namespace for sat-solver bindings.
sat-solver is a dependency solver for rpm-style dependencies
based on a Satisfyability engine.
-
- It might make a lot of sense to make Pool* a singular within
- the module and use this pointer globally instead of carrying
- it around in every data structure.
-=end
-
+ See http://en.opensuse.org/Package_Management/Sat_Solver for more
*/
+
%}
%module satsolver
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org