Imported Upstream version 0.6.29
[platform/upstream/libsolv.git] / doc / libsolv-pool.txt
index 8567cbf..cc7707a 100644 (file)
@@ -188,16 +188,16 @@ Pool configuration
 === Constants ===
 
 *DISTTYPE_RPM*::
-Used for systems with use rpm as low level package manager.
+Used for systems which use rpm as low level package manager.
 
 *DISTTYPE_DEB*::
-Used for systems with use dpkg as low level package manager.
+Used for systems which use dpkg as low level package manager.
 
 *DISTTYPE_ARCH*::
-Used for systems with use the arch linux package manager.
+Used for systems which use the arch linux package manager.
 
 *DISTTYPE_HAIKU*::
-Used for systems with use haiku packages.
+Used for systems which use haiku packages.
 
 *POOL_FLAG_PROMOTEEPOCH*::
 Promote the epoch of the providing dependency to the requesting
@@ -257,7 +257,7 @@ obsoleted packages still get removed.
 Make the addfileprovides method only add files from the standard
 locations (i.e. the ``bin'' and ``etc'' directories). This is
 useful if you have only few packages that use non-standard file
-dependencies, but you still wand the fast speed that addfileprovides()
+dependencies, but you still want the fast speed that addfileprovides()
 generates.
 
 
@@ -270,6 +270,9 @@ should match the package manager of your system, so you only need to
 use this function if you want to use the library to solve packaging
 problems for different systems. The Function returns the old
 disttype on success, and -1 if the new disttype is not supported.
+Note that any pool_setarch and pool_setarchpolicy calls need to
+come after the pool_setdisttype call, as they make use of the
+noarch/any/all architecture id.
 
        int pool_set_flag(Pool *pool, int flag, int value);
 
@@ -383,7 +386,7 @@ A boolean OR operation, the ``name'' and ``evr'' parts of the relation can
 be two sub-dependencies. Packages can match any part of the dependency.
 
 *REL_WITH*::
-Like REL_AND, but packages mast match both dependencies simultaneously. See
+Like REL_AND, but packages must match both dependencies simultaneously. See
 the section about boolean dependencies about more information.
 
 *REL_NAMESPACE*::
@@ -391,7 +394,7 @@ A special namespace relation. See the section about namespace dependencies
 for more information.
 
 *REL_ARCH*::
-A architecture filter dependency. The ``name'' part of the relation is a
+An architecture filter dependency. The ``name'' part of the relation is a
 sub-dependency, the ``evr'' part is the Id of an architecture that the
 matching packages must have (note that this is an exact match ignoring
 architecture policies).
@@ -405,11 +408,33 @@ A conditional dependency, the ``name'' sub-dependency is only considered if
 the ``evr'' sub-dependency is fulfilled. See the section about boolean
 dependencies about more information.
 
+*REL_UNLESS*::
+A conditional dependency, the ``name'' sub-dependency is only considered if
+the ``evr'' sub-dependency is not fulfilled. See the section about boolean
+dependencies about more information.
+
 *REL_COMPAT*::
 A compat dependency used in Haiku to represent version ranges.  The
 ``name'' part is the actual version, the ``evr'' part is the backwards
 compatibility version.
 
+*REL_KIND*::
+A pseudo dependency that limits the solvables to a specific kind.
+The kind is expected to be a prefix of the solvable name, e.g.
+``patch:foo'' would be of kind ``patch''. ``REL_KIND'' is only
+supported in the selection functions.
+
+*REL_MULTIARCH*::
+A debian multiarch annotation. The most common value for the ``evr''
+part is ``any''.
+
+*REL_ELSE*::
+The else part of a ``REL_COND'' or ``REL_UNLESS'' dependency. See the
+section about boolean dependencies.
+
+*REL_ERROR*::
+An illegal dependency. This is useful to encode dependency parse errors.
+
 === Functions ===
        Id pool_str2id(Pool *pool, const char *str, int create);
 
@@ -508,7 +533,7 @@ Only compare the epoch and the version parts, ignore the release part.
 === Functions ===
        int pool_evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode);
 
-Compare two version Ids, return -1 if the first version is less then the
+Compare two version Ids, return -1 if the first version is less than the
 second version, 0 if they are identical, and 1 if the first version is
 bigger than the second one.
 
@@ -538,7 +563,7 @@ Whatprovides Index
 ------------------
        void pool_createwhatprovides(Pool *pool);
 
-Create a index that maps dependency Ids to sets of packages that provide the
+Create an index that maps dependency Ids to sets of packages that provide the
 dependency.
 
        void pool_freewhatprovides(Pool *pool);
@@ -569,7 +594,7 @@ Some package managers like rpm allow dependencies on files contained in
 other packages. To allow libsolv to deal with those dependencies in an
 efficient way, you need to call the addfileprovides method after creating
 and reading all repositories. This method will scan all dependency for file
-names and than scan all packages for matching files. If a filename has been
+names and then scan all packages for matching files. If a filename has been
 matched, it will be added to the provides list of the corresponding
 package.
 
@@ -631,7 +656,7 @@ area. You can use NULL arguments if you just want to join less strings.
 Like pool_tmpjoin(), but if the first argument is the last allocated space
 in the pool's temporary space area, it will be replaced with the result of
 the join and no new temporary space slot will be used.  Thus you can join
-more then three strings by a combination of one pool_tmpjoin() and multiple
+more than three strings by a combination of one pool_tmpjoin() and multiple
 pool_tmpappend() calls. Note that the _str1_ pointer is no longer usable
 after the call.
 
@@ -812,10 +837,9 @@ SOLVER_FLAG_ALLOW_VENDORCHANGE flag.
 Boolean Dependencies
 --------------------
 Boolean Dependencies allow to build complex expressions from simple
-dependencies. While rpm does not support boolean expressions in
-dependencies and debian only allows an "OR" expression, libsolv
-allows arbitrary complex expressions. The following basic types
-are supported:
+dependencies. Note that depending on the package manager only a subset
+of those may be useful. For example, debian currently only allows
+an "OR" expression.
 
 *REL_OR*::
 The expression is true if either the first dependency or the second
@@ -826,21 +850,33 @@ installed.
 *REL_AND*::
 The expression is true if both dependencies are true. The packages
 fulfilling the dependencies may be different, i.e. 
-``Supplements: perl AND python'' is true if both a package providing
-perl and a package providing python are installed. The solver currently
-only supports REL_AND in Supplements/Enhances dependencies, in other
-types of dependencies it gets treated as REL_WITH.
+``Supplements: perl REL_AND python'' is true if both a package providing
+perl and a package providing python are installed.
 
 *REL_WITH*::
 The expression is true if both dependencies are true and are fulfilled by
-the same package. Thus ``Supplements: perl AND python'' would only be true
+the same package. Thus ``Supplements: perl REL_WITH python'' would only be true
 if a package is installed that provides both dependencies (some kind
 of multi-language interpreter).
 
 *REL_COND*::
 The expression is true if the first dependency is true or the second
-dependency is false. Libsolv currently does not support this type of
-dependency in the solver code.
+dependency is false. ``A REL_COND B'' is equivalent to
+``A REL_OR (NOT B)'' (except that libsolv does not expose ``NOT'').
+
+*REL_UNLESS*::
+The expression is true if the first dependency is true and the second
+dependency is false. ``A REL_UNLESS B'' is equivalent to
+``A REL_AND (NOT B)'' (except that libsolv does not expose ``NOT'').
+
+*REL_ELSE*::
+The ``else'' part of a ``REL_COND'' or ``REL_UNLESS''  dependency.
+It has to be directly in the evr part of the condition,
+e.g. ``foo REL_COND (bar REL_ELSE baz)''.
+For ``REL_COND'' this is equivalent to writing
+``(foo REL_COND bar) REL_AND (bar REL_OR baz)''.
+For ``REL_UNLESS'' this is equivalent to writing
+``(foo REL_UNLESS bar) REL_OR (bar REL_AND baz)''.
 
 Each sub-dependency of a boolean dependency can in turn be a boolean
 dependency, so you can chain them to create complex dependencies.
@@ -879,3 +915,6 @@ Author
 ------
 Michael Schroeder <mls@suse.de>
 
+////
+vim: syntax=asciidoc
+////