diff --git a/install3/misc.c b/install3/misc.c index e3d238e..66b1dfa 100644 --- a/install3/misc.c +++ b/install3/misc.c @@ -19,7 +19,8 @@ int i3_is_pkg_installed(struct poldek_ts *ts, struct pkg *pkg, int *cmprc) { tn_array *dbpkgs = NULL; - int n; + int n = 0, freshen = 0; + freshen = ts->getop(ts, POLDEK_OP_FRESHEN); n = pkgdb_search(ts->db, &dbpkgs, PMTAG_NAME, pkg->name, NULL, PKG_LDNEVR); n_assert(n >= 0); @@ -37,7 +38,9 @@ int i3_is_pkg_installed(struct poldek_ts *ts, struct pkg *pkg, int *cmprc) //pkgs_array_dump(dbpkgs, "before_multilib"); for (i=0; i < n_array_size(dbpkgs); i++) { struct pkg *dbpkg = n_array_nth(dbpkgs, i); - if (pkg_is_kind_of(dbpkg, pkg)) + // if freshen (upgrade) preffer same arch + // add package if pkg_is_kind_of (have same name and color) + if (pkg_is_kind_of(dbpkg, pkg) && !(freshen && 0 != pkg_cmp_arch(dbpkg, pkg))) n_array_push(arr, pkg_link(dbpkg)); } diff --git a/pkgcmp.c b/pkgcmp.c index f123e03..5452aa9 100644 --- a/pkgcmp.c +++ b/pkgcmp.c @@ -38,7 +38,7 @@ extern int poldek_conf_MULTILIB; -/* same name && arch? */ +/* same name && arch (but just compare color) */ int pkg_is_kind_of(const struct pkg *candidate, const struct pkg *pkg) { register int rc = strcmp(pkg->name, candidate->name); diff --git a/pkgcmp.h b/pkgcmp.h index 6b1b75a..3c59a66 100644 --- a/pkgcmp.h +++ b/pkgcmp.h @@ -14,7 +14,7 @@ struct capreq; /* candidate in pkg's rainbow */ int pkg_is_colored_like(const struct pkg *candidate, const struct pkg *pkg); -/* same name && arch */ +/* same name && arch (but just compare color) */ int pkg_is_kind_of(const struct pkg *candidate, const struct pkg *pkg); /* strncmp(p1->name, p2->name, strlen(p2->name)) */