|
25 | 25 | #include <time.h>
|
26 | 26 | #include <unistd.h>
|
27 | 27 | #include <glob.h>
|
| 28 | +#include "../include/etc_groups.h" |
28 | 29 |
|
29 |
| -#define ETC_MAX 256 |
30 | 30 | static int etc_cnt = 0;
|
31 |
| -static char *etc_list[ETC_MAX + 1] = { // plus 1 for ending NULL pointer |
32 |
| - "alternatives", |
33 |
| - "fonts", |
34 |
| - "ld.so.cache", |
35 |
| - "ld.so.conf", |
36 |
| - "ld.so.conf.d", |
37 |
| - "ld.so.preload", |
38 |
| - "locale", |
39 |
| - "locale.alias", |
40 |
| - "locale.conf", |
41 |
| - "locale.gen", |
42 |
| - "localtime", |
43 |
| - "nsswitch.conf", |
44 |
| - "passwd", |
45 |
| - NULL |
46 |
| -}; |
47 |
| - |
48 |
| -static char*etc_group_network[] = { |
49 |
| - "hostname", |
50 |
| - "hosts", |
51 |
| - "resolv.conf", |
52 |
| - "protocols", |
53 |
| - NULL |
54 |
| -}; |
55 |
| - |
56 |
| -static char *etc_group_gnome[] = { |
57 |
| - "xdg", |
58 |
| - "drirc", |
59 |
| - "dconf", |
60 |
| - "gtk-2.0", |
61 |
| - "gtk-3.0", |
62 |
| - NULL |
63 |
| -}; |
64 |
| - |
65 |
| -static char *etc_group_kde[] = { |
66 |
| - "xdg", |
67 |
| - "drirc", |
68 |
| - "kde4rc", |
69 |
| - "kde5rc", |
70 |
| - NULL |
71 |
| -}; |
72 |
| - |
73 |
| -static char *etc_group_sound[] = { |
74 |
| - "alsa", |
75 |
| - "asound.conf", |
76 |
| - "machine-id", // required by PulseAudio |
77 |
| - "pulse", |
78 |
| - NULL |
79 |
| -}; |
80 |
| - |
81 |
| -static char *etc_group_tls_ca[] = { |
82 |
| - "ca-certificates", |
83 |
| - "ca-certificates.conf", |
84 |
| - "crypto-policies", |
85 |
| - "pki", |
86 |
| - "ssl", |
87 |
| - NULL |
88 |
| -}; |
89 | 31 |
|
90 | 32 | static void etc_copy_group(char **pptr) {
|
91 | 33 | assert(pptr);
|
@@ -137,10 +79,14 @@ char *fs_etc_build(char *str) {
|
137 | 79 | // look for standard groups
|
138 | 80 | if (strcmp(ptr, "TLS-CA") == 0)
|
139 | 81 | etc_copy_group(&etc_group_tls_ca[0]);
|
140 |
| - if (strcmp(ptr, "GNOME") == 0) |
141 |
| - etc_copy_group(&etc_group_gnome[0]); |
142 |
| - if (strcmp(ptr, "KDE") == 0) |
143 |
| - etc_copy_group(&etc_group_kde[0]); |
| 82 | + if (strcmp(ptr, "GUI") == 0) |
| 83 | + etc_copy_group(&etc_group_gui[0]); |
| 84 | + if (strcmp(ptr, "SOUND") == 0) |
| 85 | + etc_copy_group(&etc_group_sound[0]); |
| 86 | + if (strcmp(ptr, "NETWORK") == 0) |
| 87 | + etc_copy_group(&etc_group_network[0]); |
| 88 | + if (strcmp(ptr, "GAMES") == 0) |
| 89 | + etc_copy_group(&etc_group_games[0]); |
144 | 90 | else
|
145 | 91 | etc_add(ptr);
|
146 | 92 | ptr = strtok(NULL, ",");
|
|
0 commit comments