pkg: pass-through ABIVersion to status file
[project/opkg-lede.git] / libopkg / pkg.h
index 1299d684d67f6c7427f0c3160d0be5bccaa788bf..c9bfa7e3356e699bfa12f72d83bb14cb2f68f3e2 100644 (file)
@@ -100,24 +100,46 @@ enum pkg_fields {
        PKG_DEPENDS,
        PKG_CONFLICTS,
        PKG_CONFFILES,
+       PKG_ALTERNATIVES,
+       PKG_ABIVERSION,
 };
 
 struct abstract_pkg {
        char *name;
-       int dependencies_checked;
        pkg_vec_t *pkgs;
-       pkg_state_status_t state_status;
-       pkg_state_flag_t state_flag;
 
        /* XXX: This should be abstract_pkg_vec_t for consistency. */
        struct abstract_pkg **depended_upon_by;
 
        abstract_pkg_vec_t *provided_by;
        abstract_pkg_vec_t *replaced_by;
+
+       char dependencies_checked;
+       char pre_dependencies_checked;
+       pkg_state_status_t state_status:4;
+       pkg_state_flag_t state_flag:11;
 };
 
 #include "pkg_depends.h"
 
+enum pkg_alternative_field {
+       PAF_PRIO,
+       PAF_PATH,
+       PAF_ALTPATH,
+       __PAF_MAX,
+};
+
+struct pkg_alternative {
+       int prio;
+       char *path;
+       char *altpath;
+};
+
+struct pkg_alternatives {
+       int nalts;
+       struct pkg_alternative **alts;
+};
+
 /* XXX: CLEANUP: I'd like to clean up pkg_t in several ways:
 
    The 3 version fields should go into a single version struct. (This
@@ -156,16 +178,16 @@ struct pkg {
           still being used within an outer loop. */
        int installed_files_ref_cnt;
 
-       int essential:1;
+       unsigned int essential:1;
 /* Adding this flag, to "force" opkg to choose a "provided_by_hand" package, if there are multiple choice */
-       int provided_by_hand:1;
+       unsigned int provided_by_hand:1;
 
        /* this flag specifies whether the package was installed to satisfy another
         * package's dependancies */
-       int auto_installed:1;
-       int is_upgrade:1;
+       unsigned int auto_installed:1;
+       unsigned int is_upgrade:1;
 
-       int arch_index:3;
+       unsigned int arch_index:3;
 
        struct blob_buf blob;
 };
@@ -235,8 +257,6 @@ int abstract_pkg_name_compare(const void *a, const void *b);
 void pkg_formatted_info(FILE * fp, pkg_t * pkg);
 void pkg_formatted_field(FILE * fp, pkg_t * pkg, const char *field);
 
-void set_flags_from_control(pkg_t * pkg);
-
 void pkg_print_status(pkg_t * pkg, FILE * file);
 str_list_t *pkg_get_installed_files(pkg_t * pkg);
 void pkg_free_installed_files(pkg_t * pkg);