Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: /
Date: Tue, 23 Jun 2015 08:59:08
Message-Id: 1435049837.bb47adc4544369167b931113600d292d2b77c97a.vapier@gentoo
1 commit: bb47adc4544369167b931113600d292d2b77c97a
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 23 08:57:17 2015 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 23 08:57:17 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=bb47adc4
7
8 repos.conf: fix behavior on systems w/out d_type
9
10 URL: https://bugs.gentoo.org/551696
11 Reported-by: Fabian Groffen <grobian <AT> gentoo.org>
12
13 main.c | 19 ++++++++++++++++++-
14 1 file changed, 18 insertions(+), 1 deletion(-)
15
16 diff --git a/main.c b/main.c
17 index 66b3b30..609ed54 100644
18 --- a/main.c
19 +++ b/main.c
20 @@ -460,10 +460,27 @@ static void read_repos_conf(const char *configroot, const char *repos_conf)
21 for (i = 0; i < count; ++i) {
22 const char *name = confs[i]->d_name;
23
24 - if (name[0] == '.' || confs[i]->d_type != DT_REG)
25 + if (name[0] == '.')
26 continue;
27
28 +#ifdef DT_UNKNOWN
29 + if (confs[i]->d_type != DT_UNKNOWN &&
30 + confs[i]->d_type != DT_REG &&
31 + confs[i]->d_type != DT_LNK)
32 + continue;
33 +#endif
34 +
35 xasprintf(&sub_conf, "%s/%s", top_conf, name);
36 +
37 +#ifdef DT_UNKNOWN
38 + if (confs[i]->d_type != DT_REG)
39 +#endif
40 + {
41 + struct stat st;
42 + if (stat(sub_conf, &st) || S_ISREG(st.st_mode))
43 + continue;
44 + }
45 +
46 read_one_repos_conf(sub_conf);
47 free(sub_conf);
48 }