Mailinglist Archive: zypp-commit (171 mails)

< Previous Next >
[zypp-commit] <sat-solver> master : - allow content file with no product definition
  • From: Michael Schroeder <mls@xxxxxxx>
  • Date: Thu, 25 Jun 2009 17:50:45 +0200
  • Message-id: <E1MJrEJ-00007g-T7@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 49bac67962ae4791cd6591f1829ecd761dfe9f1b
Author: Michael Schroeder <mls@xxxxxxx>
Date: Thu Jun 25 17:50:45 2009 +0200

- allow content file with no product definition
---
ext/repo_content.c | 71 ++++++++++++++++++++++++---------------------------
ext/tools_util.h | 1 +
2 files changed, 34 insertions(+), 38 deletions(-)

diff --git a/ext/repo_content.c b/ext/repo_content.c
index 0cbdf2c..6f7a877 100644
--- a/ext/repo_content.c
+++ b/ext/repo_content.c
@@ -107,6 +107,7 @@ join(struct parsedata *pd, const char *s1, const char *s2,
const char *s3)
strcpy(p, s3);
p += strlen(s3);
}
+ *p = 0;
return pd->tmp;
}

@@ -496,51 +497,45 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
if (defvendor)
free(defvendor);

- if (!s || !s->name)
+ if (s)
{
- pool_debug(pool, SAT_FATAL, "repo_content: 'content' incomplete, no
product solvable created!\n");
- exit(1);
- }
+ if (!s->name)
+ {
+ pool_debug(pool, SAT_FATAL, "repo_content: 'content' incomplete, no
product solvable created!\n");
+ exit(1);
+ }

- if (pd.tmpvers)
- {
if (pd.tmprel)
- s->evr = makeevr(pool, join2(pd.tmpvers, "-", pd.tmprel));
+ s->evr = makeevr(pool, join(&pd, pd.tmpvers, "-", pd.tmprel));
else
- s->evr = makeevr(pool, pd.tmpvers);
- }
- else if (pd.tmprel)
- {
- s->evr = makeevr(pool, join2("", "-", pd.tmprel));
- }
- pd.tmpvers = sat_free((void *)pd.tmpvers);
- pd.tmprel = sat_free((void *)pd.tmprel);
-
- if (!s->arch)
- s->arch = ARCH_NOARCH;
- if (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->evr = makeevr(pool, pd.tmpvers);
+ pd.tmpvers = sat_free((void *)pd.tmpvers);
+ pd.tmprel = sat_free((void *)pd.tmprel);
+
+ if (!s->arch)
+ s->arch = ARCH_NOARCH;
+ if (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);
- }

- /* now for every other arch, clone the product except the architecture */
- for (i = 0; i < numotherarchs; ++i)
- {
- Solvable *p = pool_id2solvable(pool, repo_add_solvable(repo));
- repodata_extend(data, p - pool->solvables);
- p->name = s->name;
- p->evr = s->evr;
- p->vendor = s->vendor;
- p->arch = otherarchs[i];
-
- /* self provides */
- if (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 */
- repodata_merge_attrs(data, p - pool->solvables, s - pool->solvables);
+ /* now for every other arch, clone the product except the architecture */
+ for (i = 0; i < numotherarchs; ++i)
+ {
+ Solvable *p = pool_id2solvable(pool, repo_add_solvable(repo));
+ repodata_extend(data, p - pool->solvables);
+ p->name = s->name;
+ p->evr = s->evr;
+ p->vendor = s->vendor;
+ p->arch = otherarchs[i];
+
+ /* self provides */
+ if (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 */
+ repodata_merge_attrs(data, p - pool->solvables, s - pool->solvables);
+ }
}

if (pd.tmp)
diff --git a/ext/tools_util.h b/ext/tools_util.h
index ed7022d..5599847 100644
--- a/ext/tools_util.h
+++ b/ext/tools_util.h
@@ -94,6 +94,7 @@ join2(const char *s1, const char *s2, const char *s3)
strcpy(p, s3);
p += strlen(s3);
}
+ *p = 0;
return _join_tmp;
}

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages