|
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);
|
@@ -151,16 +152,13 @@ xbps_init(struct xbps_handle *xhp)
|
151 | 152 | if (xbps_path_clean(xhp->metadir) == -1)
|
152 | 153 | return ENOTSUP;
|
153 | 154 |
|
154 |
| - xbps_dbg_printf("rootdir=%s\n", xhp->rootdir); |
155 |
| - xbps_dbg_printf("metadir=%s\n", xhp->metadir); |
156 |
| - xbps_dbg_printf("cachedir=%s\n", xhp->cachedir); |
157 |
| - xbps_dbg_printf("confdir=%s\n", xhp->confdir); |
158 |
| - xbps_dbg_printf("sysconfdir=%s\n", xhp->sysconfdir); |
159 |
| - xbps_dbg_printf("syslog=%s\n", xhp->flags & XBPS_FLAG_DISABLE_SYSLOG ? "false" : "true"); |
160 |
| - xbps_dbg_printf("bestmatching=%s\n", xhp->flags & XBPS_FLAG_BESTMATCH ? "true" : "false"); |
161 |
| - xbps_dbg_printf("keepconf=%s\n", xhp->flags & XBPS_FLAG_KEEP_CONFIG ? "true" : "false"); |
162 |
| - xbps_dbg_printf("Architecture: %s\n", xhp->native_arch); |
163 |
| - xbps_dbg_printf("Target Architecture: %s\n", xhp->target_arch ? xhp->target_arch : "(null)"); |
| 155 | + p = getenv("XBPS_SYSLOG"); |
| 156 | + if (p) { |
| 157 | + if (strcasecmp(p, "true") == 0) |
| 158 | + xhp->flags &= ~XBPS_FLAG_DISABLE_SYSLOG; |
| 159 | + else if (strcasecmp(p, "false") == 0) |
| 160 | + xhp->flags |= XBPS_FLAG_DISABLE_SYSLOG; |
| 161 | + } |
164 | 162 |
|
165 | 163 | if (xhp->flags & XBPS_FLAG_DEBUG) {
|
166 | 164 | const char *repodir;
|
|
0 commit comments