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: /
Date: Thu, 30 May 2019 08:55:29
Message-Id: 1559206508.6f159efc1ab01535a1857e93f9180b71d8016f75.grobian@gentoo
1 commit: 6f159efc1ab01535a1857e93f9180b71d8016f75
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 30 08:50:22 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Thu May 30 08:55:08 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6f159efc
7
8 qfile: fix regression introduced in 55ad84ae
9
10 inversion of assume_root_prefix lead to unusable qfile with ROOT
11
12 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
13
14 qfile.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17 diff --git a/qfile.c b/qfile.c
18 index d321a59..421c850 100644
19 --- a/qfile.c
20 +++ b/qfile.c
21 @@ -137,7 +137,7 @@ static int qfile_cb(tree_pkg_ctx *pkg_ctx, void *priv)
22 for (i = 0; i < args->length; i++) {
23 if (base_names[i] == NULL)
24 continue;
25 - if (non_orphans && non_orphans[i])
26 + if (non_orphans != NULL && non_orphans[i])
27 continue;
28
29 /* For optimization of qfile(), we also give it an array of
30 @@ -316,7 +316,7 @@ prepare_qfile_args(const int argc, const char **argv, struct qfile_opt_state *st
31 * "realpath(ROOT)" prefix) */
32 if (argv[i][0] == '/') {
33 snprintf(abspath, sizeof(abspath), "%s%s",
34 - state->assume_root_prefix ? real_root : "", argv[i]);
35 + state->assume_root_prefix ? "" : real_root, argv[i]);
36 } else if (pwd) {
37 if (state->assume_root_prefix)
38 snprintf(abspath, sizeof(abspath), "%s/%s", pwd, argv[i]);