ZifPackage

ZifPackage — An installed or remote package

Synopsis

#define             ZIF_PACKAGE_ERROR
struct              ZifPackage;
                    ZifPackagePrivate;
struct              ZifPackageClass;
enum                ZifPackageEnsureType;
enum                ZifPackageTrustKind;
enum                ZifPackageError;
GQuark              zif_package_error_quark             (void);
ZifPackage *        zif_package_new                     (void);
const gchar *       zif_package_get_id                  (ZifPackage *package);
const gchar *       zif_package_get_printable           (ZifPackage *package);
const gchar *       zif_package_get_name                (ZifPackage *package);
const gchar *       zif_package_get_version             (ZifPackage *package);
const gchar *       zif_package_get_arch                (ZifPackage *package);
const gchar *       zif_package_get_data                (ZifPackage *package);
ZifPackageTrustKind  zif_package_get_trust_kind         (ZifPackage *package);
const gchar *       zif_package_get_summary             (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
const gchar *       zif_package_get_description         (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
const gchar *       zif_package_get_license             (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
const gchar *       zif_package_get_url                 (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
const gchar *       zif_package_get_filename            (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
const gchar *       zif_package_get_category            (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
const gchar *       zif_package_get_group               (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
const gchar *       zif_package_get_pkgid               (ZifPackage *package);
const gchar *       zif_package_get_cache_filename      (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
GFile *             zif_package_get_cache_file          (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
guint64             zif_package_get_size                (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_package_get_files               (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_package_get_requires            (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_package_get_provides            (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_package_get_obsoletes           (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
GPtrArray *         zif_package_get_conflicts           (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);
guint64             zif_package_get_time_file           (ZifPackage *package);
gboolean            zif_package_provides                (ZifPackage *package,
                                                         ZifDepend *depend,
                                                         ZifDepend **satisfies,
                                                         ZifState *state,
                                                         GError **error);
gboolean            zif_package_conflicts               (ZifPackage *package,
                                                         ZifDepend *depend,
                                                         ZifDepend **satisfies,
                                                         ZifState *state,
                                                         GError **error);
gboolean            zif_package_requires                (ZifPackage *package,
                                                         ZifDepend *depend,
                                                         ZifDepend **satisfies,
                                                         ZifState *state,
                                                         GError **error);
gboolean            zif_package_obsoletes               (ZifPackage *package,
                                                         ZifDepend *depend,
                                                         ZifDepend **satisfies,
                                                         ZifState *state,
                                                         GError **error);
gboolean            zif_package_set_id                  (ZifPackage *package,
                                                         const gchar *package_id,
                                                         GError **error);
void                zif_package_set_installed           (ZifPackage *package,
                                                         gboolean installed);
void                zif_package_set_trust_kind          (ZifPackage *package,
                                                         ZifPackageTrustKind trust_kind);
void                zif_package_set_summary             (ZifPackage *package,
                                                         ZifString *summary);
void                zif_package_set_description         (ZifPackage *package,
                                                         ZifString *description);
void                zif_package_set_license             (ZifPackage *package,
                                                         ZifString *license);
void                zif_package_set_url                 (ZifPackage *package,
                                                         ZifString *url);
void                zif_package_set_location_href       (ZifPackage *package,
                                                         ZifString *location_href);
void                zif_package_set_category            (ZifPackage *package,
                                                         ZifString *category);
void                zif_package_set_group               (ZifPackage *package,
                                                         ZifString *group);
void                zif_package_set_pkgid               (ZifPackage *package,
                                                         ZifString *pkgid);
void                zif_package_set_cache_filename      (ZifPackage *package,
                                                         const gchar *cache_filename);
void                zif_package_set_size                (ZifPackage *package,
                                                         guint64 size);
void                zif_package_set_files               (ZifPackage *package,
                                                         GPtrArray *files);
void                zif_package_set_requires            (ZifPackage *package,
                                                         GPtrArray *requires);
void                zif_package_set_provides            (ZifPackage *package,
                                                         GPtrArray *provides);
void                zif_package_set_obsoletes           (ZifPackage *package,
                                                         GPtrArray *obsoletes);
void                zif_package_set_conflicts           (ZifPackage *package,
                                                         GPtrArray *conflicts);
void                zif_package_set_time_file           (ZifPackage *package,
                                                         guint64 time_file);
const gchar *       zif_package_get_package_id          (ZifPackage *package);
void                zif_package_print                   (ZifPackage *package);
gboolean            zif_package_is_devel                (ZifPackage *package);
gboolean            zif_package_is_gui                  (ZifPackage *package);
gboolean            zif_package_is_installed            (ZifPackage *package);
gboolean            zif_package_is_free                 (ZifPackage *package);
gboolean            zif_package_is_native               (ZifPackage *package);
gint                zif_package_compare                 (ZifPackage *a,
                                                         ZifPackage *b);
gboolean            zif_package_is_compatible_arch      (ZifPackage *a,
                                                         ZifPackage *b);
const gchar *       zif_package_ensure_type_to_string   (ZifPackageEnsureType type);
const gchar *       zif_package_trust_kind_to_string    (ZifPackageTrustKind trust_kind);

Object Hierarchy

  GObject
   +----ZifPackage
         +----ZifPackageLocal
         +----ZifPackageMeta
         +----ZifPackageRemote

Description

This object is subclassed by ZifPackageLocal and ZifPackageRemote.

Details

ZIF_PACKAGE_ERROR

#define ZIF_PACKAGE_ERROR		(zif_package_error_quark ())


struct ZifPackage

struct ZifPackage;


ZifPackagePrivate

typedef struct _ZifPackagePrivate ZifPackagePrivate;


struct ZifPackageClass

struct ZifPackageClass {
	GObjectClass parent_class;

	/* vtable */
	gboolean	 (*ensure_data)			(ZifPackage *package,
							 ZifPackageEnsureType type,
							 ZifState *state,
							 GError		**error);
};


enum ZifPackageEnsureType

typedef enum {
	ZIF_PACKAGE_ENSURE_TYPE_FILES,
	ZIF_PACKAGE_ENSURE_TYPE_SUMMARY,
	ZIF_PACKAGE_ENSURE_TYPE_LICENCE,
	ZIF_PACKAGE_ENSURE_TYPE_DESCRIPTION,
	ZIF_PACKAGE_ENSURE_TYPE_URL,
	ZIF_PACKAGE_ENSURE_TYPE_SIZE,
	ZIF_PACKAGE_ENSURE_TYPE_GROUP,
	ZIF_PACKAGE_ENSURE_TYPE_CATEGORY,
	ZIF_PACKAGE_ENSURE_TYPE_REQUIRES,
	ZIF_PACKAGE_ENSURE_TYPE_PROVIDES,
	ZIF_PACKAGE_ENSURE_TYPE_CONFLICTS,
	ZIF_PACKAGE_ENSURE_TYPE_OBSOLETES,
	ZIF_PACKAGE_ENSURE_TYPE_CACHE_FILENAME,
	ZIF_PACKAGE_ENSURE_TYPE_LAST
} ZifPackageEnsureType;


enum ZifPackageTrustKind

typedef enum {
	ZIF_PACKAGE_TRUST_KIND_UNKNOWN, /* must be first */
	ZIF_PACKAGE_TRUST_KIND_NONE,
	ZIF_PACKAGE_TRUST_KIND_PUBKEY,
	ZIF_PACKAGE_TRUST_KIND_LAST
} ZifPackageTrustKind;


enum ZifPackageError

typedef enum {
	ZIF_PACKAGE_ERROR_FAILED,
	ZIF_PACKAGE_ERROR_NO_SUPPORT,
	ZIF_PACKAGE_ERROR_LAST
} ZifPackageError;


zif_package_error_quark ()

GQuark              zif_package_error_quark             (void);

Returns :

An error quark.

Since 0.1.0


zif_package_new ()

ZifPackage *        zif_package_new                     (void);

Returns :

A new ZifPackage instance.

Since 0.1.0


zif_package_get_id ()

const gchar *       zif_package_get_id                  (ZifPackage *package);

Gets the id uniquely identifying the package in all repos.

package :

A ZifPackage

Returns :

A PackageId representing the package.

Since 0.1.0


zif_package_get_printable ()

const gchar *       zif_package_get_printable           (ZifPackage *package);

Gets a string that identifies the package, and is printable

package :

A ZifPackage

Returns :

A nice string, e.g. "hal-0.5.4-2.fc13.i386 (fedora)"

Since 0.1.3


zif_package_get_name ()

const gchar *       zif_package_get_name                (ZifPackage *package);

Gets the package name.

package :

A ZifPackage

Returns :

The package name.

Since 0.1.0


zif_package_get_version ()

const gchar *       zif_package_get_version             (ZifPackage *package);

Gets the package version.

package :

A ZifPackage

Returns :

The package version, e.g. "0.1.2".

Since 0.1.1


zif_package_get_arch ()

const gchar *       zif_package_get_arch                (ZifPackage *package);

Gets the package architecture, e.g. "i386".

package :

A ZifPackage

Returns :

The package architecture.

Since 0.1.1


zif_package_get_data ()

const gchar *       zif_package_get_data                (ZifPackage *package);

Gets the package source data, e.g. "fedora".

package :

A ZifPackage

Returns :

The package data.

Since 0.1.1


zif_package_get_trust_kind ()

ZifPackageTrustKind  zif_package_get_trust_kind         (ZifPackage *package);

Gets the package trusted status. Packages that are trusted are usually signed by a trusted private key.

package :

A ZifPackage

Returns :

The ZifPackageTrustKind enumerated type.

Since 0.1.3


zif_package_get_summary ()

const gchar *       zif_package_get_summary             (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the package summary.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A string or NULL

Since 0.1.0


zif_package_get_description ()

const gchar *       zif_package_get_description         (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the package description.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A string or NULL

Since 0.1.0


zif_package_get_license ()

const gchar *       zif_package_get_license             (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the package licence.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A string or NULL

Since 0.1.0


zif_package_get_url ()

const gchar *       zif_package_get_url                 (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the homepage URL for the package.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A string or NULL

Since 0.1.0


zif_package_get_filename ()

const gchar *       zif_package_get_filename            (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the remote filename for the package, e.g. Packages/net-snmp-5.4.2-3.fc10.i386.rpm

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A string or NULL

Since 0.1.0


zif_package_get_category ()

const gchar *       zif_package_get_category            (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the category the packag is in.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A string or NULL

Since 0.1.0


zif_package_get_group ()

const gchar *       zif_package_get_group               (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the package group.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A group name string

Since 0.1.0


zif_package_get_pkgid ()

const gchar *       zif_package_get_pkgid               (ZifPackage *package);

Gets the package pkgid, which is normally the SHA1 hash of the header. Every package has a pkgid, either virtual, local or remote. This function cannot fail.

package :

A ZifPackage

Returns :

A SHA1 string

Since 0.1.3


zif_package_get_cache_filename ()

const gchar *       zif_package_get_cache_filename      (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the filename used to create this package when using zif_package_local_set_from_filename() for a local package or the filename of the cached file for a remote package.

For example, the full local path of a remote package would be: /var/cache/yum/i386/fedora/hal-0.5.7-1.fc13.rpm

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

The package filename, or NULL

Since 0.1.3


zif_package_get_cache_file ()

GFile *             zif_package_get_cache_file          (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the GFile used to create this package when using zif_package_local_set_from_filename() for a local package or the filename of the cached file for a remote package.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

The package GFile, or NULL. Do not unref this object.

Since 0.1.3


zif_package_get_size ()

guint64             zif_package_get_size                (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the size of the package. This is the installed size for installed packages, and the download size for remote packages.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

The package size, or 0 for failure

Since 0.1.0


zif_package_get_files ()

GPtrArray *         zif_package_get_files               (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets the file list for the package.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

An array of strings. The returned array should be freed with g_ptr_array_unref() when no longer needed.

Since 0.1.0


zif_package_get_requires ()

GPtrArray *         zif_package_get_requires            (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Gets all the package requires.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

an array of ZifDepend's. The returned array should be freed with g_ptr_array_unref() when no longer needed.

Since 0.1.0


zif_package_get_provides ()

GPtrArray *         zif_package_get_provides            (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Get all the package provides.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

an array of ZifDepend's. The returned array should be freed with g_ptr_array_unref() when no longer needed.

Since 0.1.0


zif_package_get_obsoletes ()

GPtrArray *         zif_package_get_obsoletes           (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Get all the package obsoletes.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

an array of ZifDepend's. The returned array should be freed with g_ptr_array_unref() when no longer needed.

Since 0.1.3


zif_package_get_conflicts ()

GPtrArray *         zif_package_get_conflicts           (ZifPackage *package,
                                                         ZifState *state,
                                                         GError **error);

Get all the package conflicts.

package :

A ZifPackage

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

A reference counted GPtrArray. The returned array should be freed with g_ptr_array_unref() when no longer needed.

Since 0.1.3


zif_package_get_time_file ()

guint64             zif_package_get_time_file           (ZifPackage *package);

Get the time the file was created.

package :

A ZifPackage

Returns :

The UNIX time, or 0 for unknown.

Since 0.1.2


zif_package_provides ()

gboolean            zif_package_provides                (ZifPackage *package,
                                                         ZifDepend *depend,
                                                         ZifDepend **satisfies,
                                                         ZifState *state,
                                                         GError **error);

Gets the package dependency that satisfies the supplied dependency.

package :

A ZifPackage

depend :

The dependency to try and satisfy

satisfies :

A matched dependency, free with g_object_unref() if not NULL

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

TRUE if the package was searched. Use satisfies == NULL to detect a missing dependency.

Since 0.1.3


zif_package_conflicts ()

gboolean            zif_package_conflicts               (ZifPackage *package,
                                                         ZifDepend *depend,
                                                         ZifDepend **satisfies,
                                                         ZifState *state,
                                                         GError **error);

Gets the package dependency that satisfies the supplied dependency.

package :

A ZifPackage

depend :

The dependency to try and satisfy

satisfies :

A matched dependency, free with g_object_unref() if not NULL

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

TRUE if the package was searched. Use satisfies == NULL to detect a missing dependency.

Since 0.1.3


zif_package_requires ()

gboolean            zif_package_requires                (ZifPackage *package,
                                                         ZifDepend *depend,
                                                         ZifDepend **satisfies,
                                                         ZifState *state,
                                                         GError **error);

Gets the package dependency that satisfies the supplied dependency.

package :

A ZifPackage

depend :

The dependency to try and satisfy

satisfies :

The matched dependency, free with g_object_unref() if not NULL

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

TRUE if the package was searched. Use satisfies == NULL to detect a missing dependency.

Since 0.1.3


zif_package_obsoletes ()

gboolean            zif_package_obsoletes               (ZifPackage *package,
                                                         ZifDepend *depend,
                                                         ZifDepend **satisfies,
                                                         ZifState *state,
                                                         GError **error);

Gets the package dependency that satisfies the supplied dependency.

package :

A ZifPackage

depend :

The dependency to try and satisfy

satisfies :

A matched dependency, free with g_object_unref() if not NULL

state :

A ZifState to use for progress reporting

error :

A GError, or NULL

Returns :

TRUE if the package was searched. Use satisfies == NULL to detect a missing dependency.

Since 0.1.3


zif_package_set_id ()

gboolean            zif_package_set_id                  (ZifPackage *package,
                                                         const gchar *package_id,
                                                         GError **error);

Sets the unique id for the package.

package :

A ZifPackage

package_id :

A PackageId defining the

Returns :

TRUE for success, FALSE otherwise

Since 0.1.0


zif_package_set_installed ()

void                zif_package_set_installed           (ZifPackage *package,
                                                         gboolean installed);

Sets the package installed status.

package :

A ZifPackage

installed :

If the package is installed

Since 0.1.0


zif_package_set_trust_kind ()

void                zif_package_set_trust_kind          (ZifPackage *package,
                                                         ZifPackageTrustKind trust_kind);

Sets the package trust status. Packages that are trusted are usually signed by a trusted private key.

package :

A ZifPackage

trust_kind :

A ZifPackageTrustKind, e.g. ZIF_PACKAGE_TRUST_KIND_PUBKEY

Since 0.1.3


zif_package_set_summary ()

void                zif_package_set_summary             (ZifPackage *package,
                                                         ZifString *summary);

Sets the package summary.

package :

A ZifPackage

summary :

The package summary

Since 0.1.0


zif_package_set_description ()

void                zif_package_set_description         (ZifPackage *package,
                                                         ZifString *description);

Sets the package description.

package :

A ZifPackage

description :

The package description

Since 0.1.0


zif_package_set_license ()

void                zif_package_set_license             (ZifPackage *package,
                                                         ZifString *license);

Sets the package license.

package :

A ZifPackage

license :

The package license

Since 0.1.0


zif_package_set_url ()

void                zif_package_set_url                 (ZifPackage *package,
                                                         ZifString *url);

Sets the project homepage URL.

package :

A ZifPackage

url :

The package homepage URL

Since 0.1.0


zif_package_set_location_href ()

void                zif_package_set_location_href       (ZifPackage *package,
                                                         ZifString *location_href);

Sets the remote download location.

package :

A ZifPackage

location_href :

The remote download filename

Since 0.1.0


zif_package_set_category ()

void                zif_package_set_category            (ZifPackage *package,
                                                         ZifString *category);

Sets the package category.

package :

A ZifPackage

category :

category

Since 0.1.0


zif_package_set_group ()

void                zif_package_set_group               (ZifPackage *package,
                                                         ZifString *group);

Sets the package group.

package :

A ZifPackage

group :

The package group

Since 0.1.0


zif_package_set_pkgid ()

void                zif_package_set_pkgid               (ZifPackage *package,
                                                         ZifString *pkgid);

Sets the package pkgid, which is usually the SHA1 hash of the header.

package :

A ZifPackage

pkgid :

The package pkgid

Since 0.1.3


zif_package_set_cache_filename ()

void                zif_package_set_cache_filename      (ZifPackage *package,
                                                         const gchar *cache_filename);

Sets the cache filename, which is the full location of the local package file on the filesystem.

Note: this doesn't actually have to exist, but it must point to the default location.

package :

A ZifPackage

cache_filename :

The cache filename

Since 0.1.3


zif_package_set_size ()

void                zif_package_set_size                (ZifPackage *package,
                                                         guint64 size);

Sets the package size in bytes.

package :

A ZifPackage

size :

The package size in bytes

Since 0.1.0


zif_package_set_files ()

void                zif_package_set_files               (ZifPackage *package,
                                                         GPtrArray *files);

Sets the package file list.

package :

A ZifPackage

files :

an array of strings.

Since 0.1.0


zif_package_set_requires ()

void                zif_package_set_requires            (ZifPackage *package,
                                                         GPtrArray *requires);

Sets the package requires.

package :

A ZifPackage

requires :

The package requires

Since 0.1.0


zif_package_set_provides ()

void                zif_package_set_provides            (ZifPackage *package,
                                                         GPtrArray *provides);

Sets the package provides

package :

A ZifPackage

provides :

The package provides

Since 0.1.0


zif_package_set_obsoletes ()

void                zif_package_set_obsoletes           (ZifPackage *package,
                                                         GPtrArray *obsoletes);

Sets the package obsoletes.

package :

A ZifPackage

obsoletes :

The package obsoletes

Since 0.1.3


zif_package_set_conflicts ()

void                zif_package_set_conflicts           (ZifPackage *package,
                                                         GPtrArray *conflicts);

Sets the package conflicts.

package :

A ZifPackage

conflicts :

The package conflicts

Since 0.1.3


zif_package_set_time_file ()

void                zif_package_set_time_file           (ZifPackage *package,
                                                         guint64 time_file);

Sets the UNIX time the file was created.

package :

A ZifPackage

time_file :

The unix time the file was created

Since 0.1.2


zif_package_get_package_id ()

const gchar *       zif_package_get_package_id          (ZifPackage *package);

Gets the id (as text) uniquely identifying the package in all repos.

package :

A ZifPackage

Returns :

A package-id representing the package.

Since 0.1.0


zif_package_print ()

void                zif_package_print                   (ZifPackage *package);

Prints details about a package to STDOUT.

package :

A ZifPackage

Since 0.1.0


zif_package_is_devel ()

gboolean            zif_package_is_devel                (ZifPackage *package);

Finds out if a package is a development package.

package :

A ZifPackage

Returns :

TRUE or FALSE

Since 0.1.0


zif_package_is_gui ()

gboolean            zif_package_is_gui                  (ZifPackage *package);

Finds out if a package is a GUI package.

package :

A ZifPackage

Returns :

TRUE or FALSE

Since 0.1.0


zif_package_is_installed ()

gboolean            zif_package_is_installed            (ZifPackage *package);

Finds out if a package is installed.

package :

A ZifPackage

Returns :

TRUE or FALSE

Since 0.1.0


zif_package_is_free ()

gboolean            zif_package_is_free                 (ZifPackage *package);

Check the string license_text for free licenses, indicated by their short names as documented at http://fedoraproject.org/wiki/Licensing

Licenses can be grouped by " or " to indicate that the package can be redistributed under any of the licenses in the group. For instance: GPLv2+ or Artistic or FooLicense.

Also, if a license ends with "+", the "+" is removed before comparing it to the list of valid licenses. So if license "FooLicense" is free, then "FooLicense+" is considered free.

Groups of licenses can be grouped with " and " to indicate that parts of the package are distributed under one group of licenses, while other parts of the package are distributed under another group. Groups may be wrapped in parenthesis. For instance: (GPLv2+ or Artistic) and (GPL+ or Artistic) and FooLicense.

At least one license in each group must be free for the package to be considered Free Software. If the license_text is empty, the package is considered non-free.

package :

A ZifPackage

Returns :

TRUE or FALSE

Since 0.1.0


zif_package_is_native ()

gboolean            zif_package_is_native               (ZifPackage *package);

Finds out if a package is the native architecture for the system.

package :

A ZifPackage

Returns :

TRUE or FALSE

Since 0.1.0


zif_package_compare ()

gint                zif_package_compare                 (ZifPackage *a,
                                                         ZifPackage *b);

Compares one package versions against each other.

a :

The first package to compare

b :

The second package to compare

Returns :

1 for a>b, 0 for a==b, -1 for b>a, or G_MAXINT for error

Since 0.1.0


zif_package_is_compatible_arch ()

gboolean            zif_package_is_compatible_arch      (ZifPackage *a,
                                                         ZifPackage *b);

Finds if the package architectures are compatible. In this sense, i386 is compatible with i586, but not x86_64

a :

The first package to compare

b :

The second package to compare

Returns :

TRUE is compatible

Since 0.1.3


zif_package_ensure_type_to_string ()

const gchar *       zif_package_ensure_type_to_string   (ZifPackageEnsureType type);

Gets the string representation of a ZifPackageEnsureType

type :

A ZifPackageEnsureType enumerated value

Returns :

A string

Since 0.1.3


zif_package_trust_kind_to_string ()

const gchar *       zif_package_trust_kind_to_string    (ZifPackageTrustKind trust_kind);

Gets the string representation of a ZifPackageTrustKind

trust_kind :

A ZifPackageTrustKind enumerated value

Returns :

A string

Since 0.1.3