LiPackageGraph

LiPackageGraph — Represents a package dependency graph

Functions

Signals

void progress Run Last
void stage-changed Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── LiPackageGraph

Description

This class represents a graph of packages (nodes are LiPkgInfo instances, edges represent a dependency), as well as a hash-table of packages which need installation. It is mainly used by LiInstaller at time.

Functions

LI_TYPE_PACKAGE_GRAPH

#define LI_TYPE_PACKAGE_GRAPH (li_package_graph_get_type ())


li_package_graph_new ()

LiPackageGraph *
li_package_graph_new (void);

Creates a new LiPackageGraph.

Returns

a LiPackageGraph.

[transfer full]


li_package_graph_new_from_pkiarray ()

LiPackageGraph *
li_package_graph_new_from_pkiarray (GPtrArray *pkiarray,
                                    GError **error);

Create a new package graph and populate it with data from an array of LiPkgInfo objects.


li_package_graph_initialize ()

void
li_package_graph_initialize (LiPackageGraph *pg,
                             GError **error);

Load additional data to aid the resolving process.


li_package_graph_reset ()

void
li_package_graph_reset (LiPackageGraph *pg);

Remove all nodes from the graph, except for the root node.


li_package_graph_branch_to_array ()

GPtrArray *
li_package_graph_branch_to_array (LiPackageGraph *pg,
                                  LiPkgInfo *root,
                                  gboolean include_root);

Get an array of LiPkgInfo objects this node depends on.


li_package_graph_node_get_any_parent_manual ()

gboolean
li_package_graph_node_get_any_parent_manual
                               (LiPackageGraph *pg,
                                LiPkgInfo *root);

Check if a node has children containing packages which were installed manually.


li_package_graph_add_package ()

GPtrArray *
li_package_graph_add_package (LiPackageGraph *pg,
                              LiPkgInfo *parent,
                              LiPkgInfo *pki,
                              LiPkgInfo *satisfied_dep);

Parameters

pki

The information about an installed package

 

satisfied_dep

The dependency this package satisfies, or NULL

 

Returns

A reference to the new row of the


li_package_graph_add_package_install_todo ()

GPtrArray *
li_package_graph_add_package_install_todo
                               (LiPackageGraph *pg,
                                LiPkgInfo *parent,
                                LiPackage *pkg,
                                LiPkgInfo *satisfied_dep);

Parameters

pkg

The package required to be installed

 

satisfied_dep

The dependency this package satisfies, or NULL

 

Returns

A reference to the new node


li_package_graph_get_install_candidate ()

LiPackage *
li_package_graph_get_install_candidate
                               (LiPackageGraph *pg,
                                LiPkgInfo *pki);

li_package_graph_mark_installed ()

gboolean
li_package_graph_mark_installed (LiPackageGraph *pg,
                                 LiPkgInfo *pki);

li_package_graph_get_install_todo_count ()

guint
li_package_graph_get_install_todo_count
                               (LiPackageGraph *pg);

Get the number of packages which need to be installed.


li_package_graph_test_foundation_dependency ()

gboolean
li_package_graph_test_foundation_dependency
                               (LiPackageGraph *pg,
                                LiPkgInfo *dep_pki,
                                GError **error);

Check if we have a foundation dependency.

Returns

TRUE if dependency is satisfied, and FALSE if it is not. In case we have failed to find the dependency, error is set.


li_package_graph_set_ignore_foundations ()

void
li_package_graph_set_ignore_foundations
                               (LiPackageGraph *pg,
                                gboolean ignore);

Parameters

pg

An instance of LiPackageGraph

 

ignore

TRUE if foundation dependencies should be ignored.

 

li_package_graph_node_is_origin ()

gboolean
li_package_graph_node_is_origin (LiPackageGraph *pg,
                                 LiPkgInfo *root);

Check if this node is an origin (it is no child of any other node).

Parameters

pg

An instance of LiPackageGraph.

 

li_find_satisfying_pkg ()

LiPkgInfo *
li_find_satisfying_pkg (GPtrArray *pkglist,
                        LiPkgInfo *dep);

Return a package from the given package-list which matches the criteria defined in dep.

TODO: Return the highest version of a package matching the constraints.

Types and Values

struct LiPackageGraphClass

struct LiPackageGraphClass {
	GObjectClass		parent_class;
};


LiPackageGraph

typedef struct _LiPackageGraph LiPackageGraph;

Signal Details

The “progress” signal

void
user_function (LiPackageGraph *lipackagegraph,
               guint           arg1,
               gpointer        arg2,
               gpointer        user_data)

Parameters

lipackagegraph

the object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “stage-changed” signal

void
user_function (LiPackageGraph *lipackagegraph,
               guint           arg1,
               gpointer        arg2,
               gpointer        user_data)

Parameters

lipackagegraph

the object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last