diff options
author | Michael Schroeder <mls@suse.de> | 2009-07-01 10:32:28 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2009-07-01 10:32:28 +0200 |
commit | b739fb5bbdf2378b3e8d571df396c665af61a02d (patch) | |
tree | 09b3996ffc69643d7d6b3a17fe80ad948351237f | |
parent | 1ef91b64f728cd29a57023c057e92354a74097c3 (diff) | |
download | libsolv-b739fb5bbdf2378b3e8d571df396c665af61a02d.tar.gz libsolv-b739fb5bbdf2378b3e8d571df396c665af61a02d.tar.bz2 libsolv-b739fb5bbdf2378b3e8d571df396c665af61a02d.zip |
- only add selfprovides if name is set
- add ARCH_ALL
-rw-r--r-- | ext/repo_content.c | 10 | ||||
-rw-r--r-- | ext/repo_deb.c | 6 | ||||
-rw-r--r-- | ext/repo_helix.c | 2 | ||||
-rw-r--r-- | ext/repo_products.c | 4 | ||||
-rw-r--r-- | ext/repo_releasefile_products.c | 8 | ||||
-rw-r--r-- | ext/repo_rpmmd.c | 2 | ||||
-rw-r--r-- | ext/repo_susetags.c | 2 | ||||
-rw-r--r-- | ext/repo_zyppdb.c | 5 | ||||
-rw-r--r-- | src/knownid.h | 1 | ||||
-rw-r--r-- | src/policy.c | 5 | ||||
-rw-r--r-- | src/poolarch.c | 4 |
11 files changed, 35 insertions, 14 deletions
diff --git a/ext/repo_content.c b/ext/repo_content.c index 6f7a877..5d88ca4 100644 --- a/ext/repo_content.c +++ b/ext/repo_content.c @@ -376,7 +376,9 @@ repo_add_content(Repo *repo, FILE *fp, int flags) /* finish old solvable */ if (!s->arch) s->arch = ARCH_NOARCH; - if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) + if (!s->evr) + s->evr = ID_EMPTY; + if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); if (code10) s->supplements = repo_fix_supplements(repo, s->provides, s->supplements, 0); @@ -514,7 +516,9 @@ repo_add_content(Repo *repo, FILE *fp, int flags) if (!s->arch) s->arch = ARCH_NOARCH; - if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) + if (!s->evr) + s->evr = ID_EMPTY; + if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); if (code10) s->supplements = repo_fix_supplements(repo, s->provides, s->supplements, 0); @@ -530,7 +534,7 @@ repo_add_content(Repo *repo, FILE *fp, int flags) p->arch = otherarchs[i]; /* self provides */ - if (p->arch != ARCH_SRC && p->arch != ARCH_NOSRC) + if (s->name && p->arch != ARCH_SRC && p->arch != ARCH_NOSRC) p->provides = repo_addid_dep(repo, p->provides, rel2id(pool, p->name, p->evr, REL_EQ, 1), 0); /* now merge the attributes */ diff --git a/ext/repo_deb.c b/ext/repo_deb.c index 2bd3f4c..e75924e 100644 --- a/ext/repo_deb.c +++ b/ext/repo_deb.c @@ -266,6 +266,12 @@ control2solvable(Solvable *s, Repodata *data, char *control) break; } } + if (!s->arch) + s->arch = ARCH_ALL; + if (!s->evr) + s->evr = ID_EMPTY; + if (s->name) + s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); } void diff --git a/ext/repo_helix.c b/ext/repo_helix.c index fcff7c9..e62b810 100644 --- a/ext/repo_helix.c +++ b/ext/repo_helix.c @@ -619,7 +619,7 @@ endElement(void *userData, const char *name) pd->version ? pd->evrspace + pd->version : 0, pd->release ? pd->evrspace + pd->release : 0); /* ensure self-provides */ - if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) + if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); s->supplements = repo_fix_supplements(pd->repo, s->provides, s->supplements, pd->freshens); s->conflicts = repo_fix_conflicts(pd->repo, s->conflicts); diff --git a/ext/repo_products.c b/ext/repo_products.c index 7325cd7..e751d84 100644 --- a/ext/repo_products.c +++ b/ext/repo_products.c @@ -293,7 +293,9 @@ endElement(void *userData, const char *name) pd->tmprel = sat_free((void *)pd->tmprel); if (!s->arch) s->arch = ARCH_NOARCH; - if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) + if (!s->evr) + s->evr = ID_EMPTY; + if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pd->pool, s->name, s->evr, REL_EQ, 1), 0); pd->solvable = 0; break; diff --git a/ext/repo_releasefile_products.c b/ext/repo_releasefile_products.c index 9277395..2703c92 100644 --- a/ext/repo_releasefile_products.c +++ b/ext/repo_releasefile_products.c @@ -102,11 +102,9 @@ add_releasefile_product(Repo *repo, FILE *fp) { Solvable *s = pool_id2solvable(pool, repo_add_solvable(repo)); s->name = name; - if (version) - s->evr = version; - if (arch) - s->arch = arch; - if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) + s->evr = version ? version : ID_EMPTY; + s->arch = arch ? arch : ARCH_NOARCH; + if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); } } diff --git a/ext/repo_rpmmd.c b/ext/repo_rpmmd.c index 51ea595..12d63bc 100644 --- a/ext/repo_rpmmd.c +++ b/ext/repo_rpmmd.c @@ -902,7 +902,7 @@ endElement(void *userData, const char *name) s->arch = ARCH_NOARCH; if (!s->evr) s->evr = ID_EMPTY; /* some patterns have this */ - if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) + if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); s->supplements = repo_fix_supplements(repo, s->provides, s->supplements, pd->freshens); s->conflicts = repo_fix_conflicts(repo, s->conflicts); diff --git a/ext/repo_susetags.c b/ext/repo_susetags.c index 10500e7..b6f7b33 100644 --- a/ext/repo_susetags.c +++ b/ext/repo_susetags.c @@ -383,7 +383,7 @@ finish_solvable(struct parsedata *pd, Solvable *s, Id handle, Offset freshens) #endif /* A self provide, except for source packages. This is harmless to do twice (in case we see the same package twice). */ - if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) + if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); /* XXX This uses repo_addid_dep internally, so should also be diff --git a/ext/repo_zyppdb.c b/ext/repo_zyppdb.c index 13086d9..cb0b1c9 100644 --- a/ext/repo_zyppdb.c +++ b/ext/repo_zyppdb.c @@ -231,10 +231,11 @@ endElement(void *userData, const char *name) switch (pd->state) { case STATE_PRODUCT: - if (!s->arch) s->arch = ARCH_NOARCH; - if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) + if (!s->evr) + s->evr = ID_EMPTY; + if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pd->pool, s->name, s->evr, REL_EQ, 1), 0); pd->solvable = 0; break; diff --git a/src/knownid.h b/src/knownid.h index 38e37ff..021474f 100644 --- a/src/knownid.h +++ b/src/knownid.h @@ -57,6 +57,7 @@ KNOWNID(SYSTEM_SYSTEM, "system:system"), KNOWNID(ARCH_SRC, "src"), KNOWNID(ARCH_NOSRC, "nosrc"), KNOWNID(ARCH_NOARCH, "noarch"), +KNOWNID(ARCH_ALL, "all"), KNOWNID(REPOSITORY_SOLVABLES, "repository:solvables"), KNOWNID(REPOSITORY_DELTAINFO, "repository:deltainfo"), diff --git a/src/policy.c b/src/policy.c index 650da2b..8c442a0 100644 --- a/src/policy.c +++ b/src/policy.c @@ -397,8 +397,13 @@ policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2) } /* we allow changes to/from noarch */ +#ifndef DEBIAN_SEMANTICS if (a1 == a2 || a1 == ARCH_NOARCH || a2 == ARCH_NOARCH) return 0; +#else + if (a1 == a2 || a1 == ARCH_ALL || a2 == ARCH_ALL) + return 0; +#endif if (!pool->id2arch) return 0; a1 = a1 <= pool->lastarch ? pool->id2arch[a1] : 0; diff --git a/src/poolarch.c b/src/poolarch.c index 0ccdaa9..c25f876 100644 --- a/src/poolarch.c +++ b/src/poolarch.c @@ -62,7 +62,11 @@ pool_setarch(Pool *pool, const char *arch) pool->lastarch = 0; return; } +#ifndef DEBIAN_SEMANTICS id = ARCH_NOARCH; +#else + id = ARCH_ALL; +#endif lastarch = id + 255; id2arch = sat_calloc(lastarch + 1, sizeof(Id)); id2arch[id] = 1; |