summaryrefslogtreecommitdiffstats
path: root/libopkg/pkg.c
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-12-20 22:49:21 (EST)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-12-20 22:49:21 (EST)
commitcdeb4ec7a68b9a9f240d19b525849c77118c0ff0 (patch)
treede473039908c2da11b2d632818464861451be556 /libopkg/pkg.c
parentec5a26e8047307658a0b78ffaa65f9d2daedd7b0 (diff)
Set the arch_priority when parsing the Architecture.
git-svn-id: http://opkg.googlecode.com/svn/trunk@507 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/pkg.c')
-rw-r--r--libopkg/pkg.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/libopkg/pkg.c b/libopkg/pkg.c
index bd7e9f8..c5a3336 100644
--- a/libopkg/pkg.c
+++ b/libopkg/pkg.c
@@ -1315,54 +1315,12 @@ pkg_arch_supported(pkg_t *pkg)
return 0;
}
-static int
-pkg_get_arch_priority(const char *archname)
-{
- nv_pair_list_elt_t *l;
-
- list_for_each_entry(l , &conf->arch_list.head, node) {
- nv_pair_t *nv = (nv_pair_t *)l->data;
- if (strcmp(nv->name, archname) == 0) {
- int priority = strtol(nv->value, NULL, 0);
- return priority;
- }
- }
- return 0;
-}
-
void
pkg_info_preinstall_check(void)
{
int i;
- pkg_vec_t *available_pkgs = pkg_vec_alloc();
pkg_vec_t *installed_pkgs = pkg_vec_alloc();
- opkg_msg(INFO, "Updating arch priority for each package.\n");
- pkg_hash_fetch_available(available_pkgs);
- /* update arch_priority for each package */
- for (i = 0; i < available_pkgs->len; i++) {
- pkg_t *pkg = available_pkgs->pkgs[i];
- int arch_priority = 1;
- if (!pkg)
- continue;
- arch_priority = pkg_get_arch_priority(pkg->architecture);
- pkg->arch_priority = arch_priority;
- }
-
- for (i = 0; i < available_pkgs->len; i++) {
- pkg_t *pkg = available_pkgs->pkgs[i];
- if (!pkg->arch_priority && (pkg->state_flag || (pkg->state_want != SW_UNKNOWN))) {
- /* clear flags and want for any uninstallable package */
- opkg_msg(DEBUG, "Clearing state_want and state_flag for pkg=%s "
- "(arch_priority=%d flag=%d want=%d)\n",
- pkg->name, pkg->arch_priority,
- pkg->state_flag, pkg->state_want);
- pkg->state_want = SW_UNKNOWN;
- pkg->state_flag = 0;
- }
- }
- pkg_vec_free(available_pkgs);
-
/* update the file owner data structure */
opkg_msg(INFO, "Updating file owner list.\n");
pkg_hash_fetch_all_installed(installed_pkgs);