ZifRepos

ZifRepos — Manage software sources

Synopsis

#define             ZIF_REPOS_ERROR
struct              ZifRepos;
struct              ZifReposClass;
enum                ZifReposError;
GQuark              zif_repos_error_quark               (void);
ZifRepos *          zif_repos_new                       (void);
gboolean            zif_repos_set_repos_dir             (ZifRepos *repos,
                                                         const gchar *repos_dir,
                                                         GError **error);
gboolean            zif_repos_load                      (ZifRepos *repos,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_repos_get_stores                (ZifRepos *repos,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_repos_get_stores_enabled        (ZifRepos *repos,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_repos_get_stores_debuginfo      (ZifRepos *repos,
                                                         ZifState *state,
                                                         GError **error);
ZifStoreRemote *    zif_repos_get_store                 (ZifRepos *repos,
                                                         const gchar *id,
                                                         ZifState *state,
                                                         GError **error);

Object Hierarchy

  GObject
   +----ZifRepos

Description

A ZifRepos is an object that allows easy interfacing with remote repositories.

Details

ZIF_REPOS_ERROR

#define ZIF_REPOS_ERROR		(zif_repos_error_quark ())


struct ZifRepos

struct ZifRepos;


struct ZifReposClass

struct ZifReposClass {
	GObjectClass		 parent_class;
	/* Padding for future expansion */
	void (*_zif_reserved1) (void);
	void (*_zif_reserved2) (void);
	void (*_zif_reserved3) (void);
	void (*_zif_reserved4) (void);
};


enum ZifReposError

typedef enum {
	ZIF_REPOS_ERROR_FAILED,
	ZIF_REPOS_ERROR_NO_DATA,
	ZIF_REPOS_ERROR_LAST
} ZifReposError;

ZIF_REPOS_ERROR_FAILED

ZIF_REPOS_ERROR_NO_DATA

ZIF_REPOS_ERROR_LAST


zif_repos_error_quark ()

GQuark              zif_repos_error_quark               (void);

Returns :

An error quark.

Since 0.1.0


zif_repos_new ()

ZifRepos *          zif_repos_new                       (void);

Returns :

A new ZifRepos instance.

Since 0.1.0


zif_repos_set_repos_dir ()

gboolean            zif_repos_set_repos_dir             (ZifRepos *repos,
                                                         const gchar *repos_dir,
                                                         GError **error);

Set the repository directory.

Using repos_dir set to NULL to use the value from the config file has been supported since 0.1.3. Earlier versions will assert.

repos :

A ZifRepos

repos_dir :

A directory, e.g. "/etc/yum.repos.d", or NULL to use the default

error :

A GError, or NULL

Returns :

TRUE for success, FALSE otherwise

Since 0.1.0


zif_repos_load ()

gboolean            zif_repos_load                      (ZifRepos *repos,
                                                         ZifState *state,
                                                         GError **error);

Load the repository, and parse it's config file.

repos :

A ZifRepos

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

TRUE for success, FALSE otherwise

Since 0.1.0


zif_repos_get_stores ()

GPtrArray *         zif_repos_get_stores                (ZifRepos *repos,
                                                         ZifState *state,
                                                         GError **error);

Gets the enabled and disabled remote stores.

repos :

A ZifRepos

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A list of ZifStore's. [element-type ZifStore][transfer container]

Since 0.1.0


zif_repos_get_stores_enabled ()

GPtrArray *         zif_repos_get_stores_enabled        (ZifRepos *repos,
                                                         ZifState *state,
                                                         GError **error);

Gets the enabled remote stores.

repos :

A ZifRepos

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A list of ZifStore's. [element-type ZifStore][transfer container]

Since 0.1.0


zif_repos_get_stores_debuginfo ()

GPtrArray *         zif_repos_get_stores_debuginfo      (ZifRepos *repos,
                                                         ZifState *state,
                                                         GError **error);

Gets the remote stores for debug packages.

repos :

A ZifRepos

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A list of ZifStore's. [element-type ZifStore][transfer container]

Since 0.3.3


zif_repos_get_store ()

ZifStoreRemote *    zif_repos_get_store                 (ZifRepos *repos,
                                                         const gchar *id,
                                                         ZifState *state,
                                                         GError **error);

Gets the store matching the ID.

repos :

A ZifRepos

id :

A repository id, e.g. "fedora"

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A ZifStoreRemote object, or NULL. [transfer full]

Since 0.1.0