Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/
Date: Sun, 28 Apr 2019 16:21:27
Message-Id: 1556468461.e5251bd75fe11b3a350d122c29a994f54f069974.grobian@gentoo
1 commit: e5251bd75fe11b3a350d122c29a994f54f069974
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 28 16:21:01 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 28 16:21:01 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e5251bd7
7
8 libq/cache: support BDEPEND and fix error messages
9
10 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
11
12 libq/cache.c | 16 ++++++++++------
13 libq/cache.h | 1 +
14 2 files changed, 11 insertions(+), 6 deletions(-)
15
16 diff --git a/libq/cache.c b/libq/cache.c
17 index a00dd6b..efc47bc 100644
18 --- a/libq/cache.c
19 +++ b/libq/cache.c
20 @@ -255,7 +255,6 @@ cache_read_file_md5(cache_pkg_ctx *pkg_ctx)
21 FILE *f;
22 cache_pkg_meta *ret = NULL;
23 size_t len;
24 - char buf[_Q_PATH_MAX];
25
26 if ((f = fdopen(pkg_ctx->fd, "r")) == NULL)
27 goto err;
28 @@ -288,8 +287,9 @@ cache_read_file_md5(cache_pkg_ctx *pkg_ctx)
29 ptr = ret->_data;
30 endptr = strchr(ptr, '\0');
31 if (endptr == NULL) {
32 - warn("Invalid cache file for '%s': "
33 - "could not find end of cache data", buf);
34 + warn("Invalid cache file for '%s/%s': "
35 + "could not find end of cache data",
36 + pkg_ctx->cat_ctx->name, pkg_ctx->name);
37 goto err;
38 }
39
40 @@ -299,14 +299,16 @@ cache_read_file_md5(cache_pkg_ctx *pkg_ctx)
41 keyptr = ptr;
42 valptr = strchr(ptr, '=');
43 if (valptr == NULL) {
44 - warn("Invalid cache file for '%s': missing val", buf);
45 + warn("Invalid cache file for '%s/%s': missing val",
46 + pkg_ctx->cat_ctx->name, pkg_ctx->name);
47 goto err;
48 }
49 *valptr = '\0';
50 valptr++;
51 ptr = strchr(valptr, '\n');
52 if (ptr == NULL) {
53 - warn("Invalid cache file for '%s': missing key", buf);
54 + warn("Invalid cache file for '%s/%s': missing key",
55 + pkg_ctx->cat_ctx->name, pkg_ctx->name);
56 goto err;
57 }
58 *ptr = '\0';
59 @@ -330,9 +332,11 @@ cache_read_file_md5(cache_pkg_ctx *pkg_ctx)
60 assign_var(SRC_URI);
61 assign_var(DEFINED_PHASES);
62 assign_var(REQUIRED_USE);
63 + assign_var(BDEPEND);
64 assign_var(_eclasses_);
65 assign_var(_md5_);
66 - warn("Cache file for '%s' has unknown key %s", buf, keyptr);
67 + warn("Cache file for '%s/%s' has unknown key %s",
68 + pkg_ctx->cat_ctx->name, pkg_ctx->name, keyptr);
69 }
70 #undef assign_var
71 #undef assign_var_cmp
72
73 diff --git a/libq/cache.h b/libq/cache.h
74 index f9b1d43..74f45b8 100644
75 --- a/libq/cache.h
76 +++ b/libq/cache.h
77 @@ -38,6 +38,7 @@ typedef struct {
78 /* These are MD5-Cache only */
79 char *DEFINED_PHASES;
80 char *REQUIRED_USE;
81 + char *BDEPEND;
82 char *_eclasses_;
83 char *_md5_;
84 } cache_pkg_meta;