## ZifPackageLocal ZifPackageLocal — Local package |

## Synopsis

    #define             ZIF_PACKAGE_LOCAL_FLAG_LOOKUP
    struct              ZifPackageLocal;
    struct              ZifPackageLocalClass;
    enum                ZifPackageLocalFlags;
    gpointer            zif_package_local_get_header        (ZifPackageLocal *pkg);
    const gchar *       zif_package_local_get_key_id        (ZifPackageLocal *pkg);
    ZifPackage *        zif_package_local_new               (void);
    gboolean            zif_package_local_set_from_filename (ZifPackageLocal *pkg,
                                                             const gchar *filename,
                                                             GError **error);
    gboolean            zif_package_local_set_from_header   (ZifPackageLocal *pkg,
                                                             gpointer header,
                                                             ZifPackageLocalFlags flags,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----ZifPackage
             +----ZifPackageLocal

## Description

This object is a subclass of ZifPackage

## Details

### ZIF_PACKAGE_LOCAL_FLAG_LOOKUP

    #define ZIF_PACKAGE_LOCAL_FLAG_LOOKUP ZIF_PACKAGE_LOCAL_FLAG_USE_YUMDB

### struct ZifPackageLocal

    struct ZifPackageLocal;

### struct ZifPackageLocalClass

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

### enum ZifPackageLocalFlags

    typedef enum {
    	ZIF_PACKAGE_LOCAL_FLAG_NOTHING = 0, /* fastest */
    	ZIF_PACKAGE_LOCAL_FLAG_USE_YUMDB = 1, /* use yumdb for package_id data */
    	ZIF_PACKAGE_LOCAL_FLAG_REPAIR = 2, /* repair package header in the rpmdb */
    	ZIF_PACKAGE_LOCAL_FLAG_USE_HISTORY = 4, /* use history for package_id data */
    	ZIF_PACKAGE_LOCAL_FLAG_LAST
    } ZifPackageLocalFlags;

`ZIF_PACKAGE_LOCAL_FLAG_NOTHING` |
`ZIF_PACKAGE_LOCAL_FLAG_USE_YUMDB` |
`ZIF_PACKAGE_LOCAL_FLAG_REPAIR` |
`ZIF_PACKAGE_LOCAL_FLAG_USE_HISTORY` |
`ZIF_PACKAGE_LOCAL_FLAG_LAST` |

### zif_package_local_get_header ()

    gpointer            zif_package_local_get_header        (ZifPackageLocal *pkg);

Gets the RPM header object for the package.

`pkg` : | A ZifPackageLocal
Returns : | The rpm Header structure, or `NULL` if unset. [transfer none]

Since 0.1.0

### zif_package_local_get_key_id ()

    const gchar *       zif_package_local_get_key_id        (ZifPackageLocal *pkg);

Gets a signature key identifier for the package, e.g. "RSA/SHA256, Thu Sep 23 17:25:34 2010, Key ID 421caddb97a1071f"

`pkg` : | A ZifPackageLocal
Returns : | an ID for success, `NULL` for failure

Since 0.1.3

### zif_package_local_new ()

    ZifPackage *        zif_package_local_new               (void);

Returns : | A new ZifPackageLocal instance.

Since 0.1.0

### zif_package_local_set_from_filename ()

    gboolean            zif_package_local_set_from_filename (ZifPackageLocal *pkg,
                                                             const gchar *filename,
                                                             GError **error);

Sets a local package object from a local file.

`pkg` : | A ZifPackageLocal
`filename` : | A filename
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.0

### zif_package_local_set_from_header ()

    gboolean            zif_package_local_set_from_header   (ZifPackageLocal *pkg,
                                                             gpointer header,
                                                             ZifPackageLocalFlags flags,
                                                             GError **error);

Sets the local package from an RPM header object.

`pkg` : | A ZifPackageLocal
`header` : | A rpm Header structure
`flags` : | a bitfield indicating if we should lookup and fix the package-id data
`error` : | A GError, or `NULL`
Returns : | `TRUE` for success, `FALSE` otherwise

Since 0.1.3