Mailinglist Archive: zypp-commit (171 mails)

< Previous Next >
[zypp-commit] <sat-solver> master : - change the interface of repo_add_susetags: take default vendor id,
  • From: Michael Schroeder <mls@xxxxxxx>
  • Date: Wed, 24 Jun 2009 12:41:06 +0200
  • Message-id: <E1MJPvd-0008RZ-70@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 19f89b3df269a0cd79b0fa8605580f64ff9c7fab
Author: Michael Schroeder <mls@xxxxxxx>
Date: Wed Jun 24 12:41:06 2009 +0200

- change the interface of repo_add_susetags: take default vendor id,
not product solvable id
---
ext/repo_susetags.c | 13 +++----------
ext/repo_susetags.h | 2 +-
tools/susetags2solv.c | 18 ++++++++++--------
3 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/ext/repo_susetags.c b/ext/repo_susetags.c
index 66880fc..10500e7 100644
--- a/ext/repo_susetags.c
+++ b/ext/repo_susetags.c
@@ -399,13 +399,13 @@ finish_solvable(struct parsedata *pd, Solvable *s, Id
handle, Offset freshens)
* parse susetags
*
* fp: file to read from
- * product: solvable representing the product (0 if none)
+ * defvendor: default vendor (0 if none)
* language: current language (0 if none)
* flags: flags
*/

void
-repo_add_susetags(Repo *repo, FILE *fp, Id product, const char *language, int
flags)
+repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language,
int flags)
{
Pool *pool = repo->pool;
char *line, *linep;
@@ -420,7 +420,6 @@ repo_add_susetags(Repo *repo, FILE *fp, Id product, const
char *language, int fl
struct parsedata pd;
Repodata *data = 0;
Id handle = 0;
- Id vendor = 0;

if ((flags & SUSETAGS_EXTEND) && repo->nrepodata)
indesc = 1;
@@ -430,12 +429,6 @@ repo_add_susetags(Repo *repo, FILE *fp, Id product, const
char *language, int fl
else
data = repo_last_repodata(repo);

- if (product)
- {
- if (!strncmp(id2str(pool, pool->solvables[product].name), "product:", 8))
- vendor = pool->solvables[product].vendor;
- }
-
memset(&pd, 0, sizeof(pd));
line = malloc(1024);
aline = 1024;
@@ -657,7 +650,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id product, const
char *language, int fl
s->arch = arch;
else
s->arch = str2id(pool, sp[3], 1);
- s->vendor = vendor; /* default to product vendor */
+ s->vendor = defvendor;
}
}

diff --git a/ext/repo_susetags.h b/ext/repo_susetags.h
index a617c65..57acaeb 100644
--- a/ext/repo_susetags.h
+++ b/ext/repo_susetags.h
@@ -12,4 +12,4 @@
#define SUSETAGS_KINDS_SEPARATELY (1 << 2)
#define SUSETAGS_EXTEND (1 << 3)

-extern void repo_add_susetags(Repo *repo, FILE *fp, Id product, const char
*language, int flags);
+extern void repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char
*language, int flags);
diff --git a/tools/susetags2solv.c b/tools/susetags2solv.c
index 8393ba6..753b86c 100644
--- a/tools/susetags2solv.c
+++ b/tools/susetags2solv.c
@@ -97,7 +97,7 @@ main(int argc, char **argv)
const char *descrdir = 0;
const char *basefile = 0;
const char *query = 0;
- Id product = 0;
+ Id defvendor = 0;
int flags = 0;
int c;

@@ -145,8 +145,10 @@ main(int argc, char **argv)
exit(1);
}
repo_add_content(repo, fp, REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
- product = repo->start;
- fclose (fp);
+ if (repo->start < repo->end)
+ if (!strncmp(id2str(pool, pool->solvables[repo->start].name),
"product:", 8))
+ defvendor = pool->solvables[repo->start].vendor;
+ fclose(fp);
}

if (attrname)
@@ -213,7 +215,7 @@ main(int argc, char **argv)
perror(fn);
exit(1);
}
- repo_add_susetags(repo, fp, product, 0, flags |
REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, fp, defvendor, 0, flags |
REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
}
else if (!strcmp(fn, "packages.DU") || !strcmp(fn, "packages.DU.gz"))
@@ -225,7 +227,7 @@ main(int argc, char **argv)
perror(fn);
exit(1);
}
- repo_add_susetags(repo, fp, product, 0, flags | SUSETAGS_EXTEND |
REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, fp, defvendor, 0, flags | SUSETAGS_EXTEND
| REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
}
else if (!strcmp(fn, "packages.FL") || !strcmp(fn, "packages.FL.gz"))
@@ -238,7 +240,7 @@ main(int argc, char **argv)
perror(fn);
exit(1);
}
- repo_add_susetags(repo, fp, product, 0, flags | SUSETAGS_EXTEND |
REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, fp, defvendor, 0, flags | SUSETAGS_EXTEND
| REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
#else
/* ignore for now. reactivate when filters work */
@@ -266,7 +268,7 @@ main(int argc, char **argv)
perror(fn);
exit(1);
}
- repo_add_susetags(repo, fp, product, lang, flags |
SUSETAGS_EXTEND | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, fp, defvendor, lang, flags |
SUSETAGS_EXTEND | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
}
}
@@ -278,7 +280,7 @@ main(int argc, char **argv)
}
else
/* read data from stdin */
- repo_add_susetags(repo, stdin, product, 0, REPO_REUSE_REPODATA |
REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, stdin, defvendor, 0, REPO_REUSE_REPODATA |
REPO_NO_INTERNALIZE);
repo_internalize(repo);

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

< Previous Next >
This Thread
  • No further messages