PkPackage

PkPackage — Package object

Functions

Properties

gchar * description Read / Write
PkGroupEnum group Read / Write
PkInfoEnum info Read / Write
gchar * license Read / Write
gchar * package-id Read
guint64 size Read / Write
gchar * summary Read / Write
GStrv update-bugzilla-urls Read / Write
gchar * update-changelog Read / Write
GStrv update-cve-urls Read / Write
gchar * update-issued Read / Write
gchar * update-obsoletes Read / Write
PkRestartEnum update-restart Read / Write
PkUpdateStateEnum update-state Read / Write
gchar * update-text Read / Write
gchar * update-updated Read / Write
gchar * update-updates Read / Write
GStrv update-vendor-urls Read / Write
gchar * url Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── PkSource
        ╰── PkPackage

Description

This GObject represents a package from a transaction. These objects represent single items of data from the transaction, and are often present in lists (PkResults) or just refcounted in client programs.

Functions

pk_package_new ()

PkPackage *
pk_package_new (void);

Returns

a new PkPackage object.

Since: 0.5.4


pk_package_test ()

void
pk_package_test (gpointer user_data);

pk_package_set_id ()

gboolean
pk_package_set_id (PkPackage *package,
                   const gchar *package_id,
                   GError **error);

Sets the package object to have the given ID

Parameters

package

a valid PkPackage instance

 

package_id

the valid package_id

 

error

a GError to put the error code and message in, or NULL

 

Returns

TRUE if the package_id was set

Since: 0.5.4


pk_package_parse ()

gboolean
pk_package_parse (PkPackage *package,
                  const gchar *data,
                  GError **error);

Parses the data to populate the PkPackage.

Parameters

package

a valid PkPackage instance

 

data

the data describing the package

 

error

a GError to put the error code and message in, or NULL

 

Returns

TRUE if the data was parsed correcty

Since: 0.8.11


pk_package_print ()

void
pk_package_print (PkPackage *package);

Prints details about the package to standard out.

Parameters

package

a valid PkPackage instance

 

Since: 0.5.4


pk_package_equal ()

gboolean
pk_package_equal (PkPackage *package1,
                  PkPackage *package2);

Do the PkPackage's have the same ID.

Parameters

package1

a valid PkPackage instance

 

package2

a valid PkPackage instance

 

Returns

TRUE if the packages have the same package_id, info and summary.

Since: 0.5.4


pk_package_equal_id ()

gboolean
pk_package_equal_id (PkPackage *package1,
                     PkPackage *package2);

Do the PkPackage's have the same ID.

Parameters

package1

a valid PkPackage instance

 

package2

a valid PkPackage instance

 

Returns

TRUE if the packages have the same package_id.

Since: 0.5.4


pk_package_get_id ()

const gchar *
pk_package_get_id (PkPackage *package);

Gets the package object ID

Parameters

package

a valid PkPackage instance

 

Returns

the ID, or NULL if unset

Since: 0.5.4


pk_package_get_info ()

PkInfoEnum
pk_package_get_info (PkPackage *package);

Gets the package object ID

Parameters

package

a valid PkPackage instance

 

Returns

the PkInfoEnum

Since: 0.5.4


pk_package_set_info ()

void
pk_package_set_info (PkPackage *package,
                     PkInfoEnum info);

Sets the package info enum.

Parameters

package

a valid PkPackage instance

 

info

the PkInfoEnum

 

Since: 0.8.14


pk_package_get_summary ()

const gchar *
pk_package_get_summary (PkPackage *package);

Gets the package object ID

Parameters

package

a valid PkPackage instance

 

Returns

the summary, or NULL if unset

Since: 0.5.4


pk_package_set_summary ()

void
pk_package_set_summary (PkPackage *package,
                        const gchar *summary);

Sets the package summary.

Parameters

package

a valid PkPackage instance

 

summary

the package summary

 

Since: 0.8.14


pk_package_get_name ()

const gchar *
pk_package_get_name (PkPackage *package);

Gets the package name.

Parameters

package

a valid PkPackage instance

 

Returns

the name, or NULL if unset

Since: 0.6.4


pk_package_get_version ()

const gchar *
pk_package_get_version (PkPackage *package);

Gets the package version.

Parameters

package

a valid PkPackage instance

 

Returns

the version, or NULL if unset

Since: 0.6.4


pk_package_get_arch ()

const gchar *
pk_package_get_arch (PkPackage *package);

Gets the package arch.

Parameters

package

a valid PkPackage instance

 

Returns

the arch, or NULL if unset

Since: 0.6.4


pk_package_get_data ()

const gchar *
pk_package_get_data (PkPackage *package);

Gets the package data, which is usually the repository ID that contains the package. Special ID's include "installed" for installed packages, and "local" for local packages that exist on disk but not in a repository.

Parameters

package

a valid PkPackage instance

 

Returns

the data, or NULL if unset

Since: 0.6.4

Types and Values

PK_PACKAGE_TYPE_ERROR

#define PK_PACKAGE_TYPE_ERROR (pk_package_error_get_type ())

Property Details

The “description” property

  “description”              gchar *

The package description.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “group” property

  “group”                    PkGroupEnum

The package group.

Flags: Read / Write

Default value: PK_GROUP_ENUM_UNKNOWN

Since: 0.5.4


The “info” property

  “info”                     PkInfoEnum

The PkInfoEnum package type, e.g. PK_INFO_ENUM_NORMAL.

Flags: Read / Write

Default value: PK_INFO_ENUM_UNKNOWN

Since: 0.5.4


The “license” property

  “license”                  gchar *

The package license.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “package-id” property

  “package-id”               gchar *

The full package_id, e.g. 'gnome-power-manager;0.1.2;i386;fedora'.

Flags: Read

Default value: NULL

Since: 0.5.4


The “size” property

  “size”                     guint64

The package size.

Flags: Read / Write

Default value: 0

Since: 0.5.4


The “summary” property

  “summary”                  gchar *

The package summary.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “update-bugzilla-urls” property

  “update-bugzilla-urls”     GStrv

The update bugzilla URLs.

Flags: Read / Write

Since: 0.8.1


The “update-changelog” property

  “update-changelog”         gchar *

The update ChangeLog.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “update-cve-urls” property

  “update-cve-urls”          GStrv

The update CVE URLs.

Flags: Read / Write

Since: 0.8.1


The “update-issued” property

  “update-issued”            gchar *

When the update was issued.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “update-obsoletes” property

  “update-obsoletes”         gchar *

The update packages that are obsoleted.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “update-restart” property

  “update-restart”           PkRestartEnum

The update restart type.

Flags: Read / Write

Default value: PK_RESTART_ENUM_UNKNOWN

Since: 0.5.4


The “update-state” property

  “update-state”             PkUpdateStateEnum

The update state.

Flags: Read / Write

Default value: PK_UPDATE_STATE_ENUM_UNKNOWN

Since: 0.5.4


The “update-text” property

  “update-text”              gchar *

The update description.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “update-updated” property

  “update-updated”           gchar *

When the update was last updated.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “update-updates” property

  “update-updates”           gchar *

The update packages.

Flags: Read / Write

Default value: NULL

Since: 0.5.4


The “update-vendor-urls” property

  “update-vendor-urls”       GStrv

The update vendor URLs.

Flags: Read / Write

Since: 0.8.1


The “url” property

  “url”                      gchar *

The package homepage URL.

Flags: Read / Write

Default value: NULL

Since: 0.5.4

Signal Details

The “changed” signal

void
user_function (PkPackage *package,
               gpointer   user_data)

The ::changed signal is emitted when the package data may have changed.

Parameters

package

the PkPackage instance that emitted the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last