|
25 | 25 | */ |
26 | 26 |
|
27 | 27 | #include <sys/utsname.h> |
| 28 | +#include <errno.h> |
28 | 29 | #include <stdlib.h> |
29 | 30 | #include <string.h> |
30 | | -#include <errno.h> |
| 31 | +#include <strings.h> |
31 | 32 |
|
32 | 33 | #include "xbps_api_impl.h" |
33 | 34 |
|
|
43 | 44 | int |
44 | 45 | xbps_init(struct xbps_handle *xhp) |
45 | 46 | { |
46 | | - const char *native_arch = NULL; |
| 47 | + const char *native_arch = NULL, *p; |
47 | 48 | int rv = 0; |
48 | 49 |
|
49 | 50 | assert(xhp != NULL); |
@@ -154,16 +155,13 @@ xbps_init(struct xbps_handle *xhp) |
154 | 155 | if (xbps_path_clean(xhp->metadir) == -1) |
155 | 156 | return ENOTSUP; |
156 | 157 |
|
157 | | - xbps_dbg_printf("rootdir=%s\n", xhp->rootdir); |
158 | | - xbps_dbg_printf("metadir=%s\n", xhp->metadir); |
159 | | - xbps_dbg_printf("cachedir=%s\n", xhp->cachedir); |
160 | | - xbps_dbg_printf("confdir=%s\n", xhp->confdir); |
161 | | - xbps_dbg_printf("sysconfdir=%s\n", xhp->sysconfdir); |
162 | | - xbps_dbg_printf("syslog=%s\n", xhp->flags & XBPS_FLAG_DISABLE_SYSLOG ? "false" : "true"); |
163 | | - xbps_dbg_printf("bestmatching=%s\n", xhp->flags & XBPS_FLAG_BESTMATCH ? "true" : "false"); |
164 | | - xbps_dbg_printf("keepconf=%s\n", xhp->flags & XBPS_FLAG_KEEP_CONFIG ? "true" : "false"); |
165 | | - xbps_dbg_printf("Architecture: %s\n", xhp->native_arch); |
166 | | - xbps_dbg_printf("Target Architecture: %s\n", xhp->target_arch ? xhp->target_arch : "(null)"); |
| 158 | + p = getenv("XBPS_SYSLOG"); |
| 159 | + if (p) { |
| 160 | + if (strcasecmp(p, "true") == 0) |
| 161 | + xhp->flags &= ~XBPS_FLAG_DISABLE_SYSLOG; |
| 162 | + else if (strcasecmp(p, "false") == 0) |
| 163 | + xhp->flags |= XBPS_FLAG_DISABLE_SYSLOG; |
| 164 | + } |
167 | 165 |
|
168 | 166 | if (xhp->flags & XBPS_FLAG_DEBUG) { |
169 | 167 | const char *repodir; |
|
0 commit comments