aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pkg
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2020-10-27 11:29:11 +0000
committerStefan Eßer <se@FreeBSD.org>2020-10-27 11:29:11 +0000
commit1f474190fc280d4a4ef0c214e4d7fff0d1237e22 (patch)
tree123ca2f0a46ad9a1203a6b3c7a7a38c2a50854e6 /usr.sbin/pkg
parent7b39bef2cf93f6f0e79cc55a8ee2d339e42a6816 (diff)
Notes
Diffstat (limited to 'usr.sbin/pkg')
-rw-r--r--usr.sbin/pkg/config.c3
-rw-r--r--usr.sbin/pkg/config.h3
-rw-r--r--usr.sbin/pkg/pkg.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c
index fc7df8d31dae..a1dba3f2670a 100644
--- a/usr.sbin/pkg/config.c
+++ b/usr.sbin/pkg/config.c
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <ucl.h>
#include <err.h>
#include <errno.h>
+#include <paths.h>
#include <stdbool.h>
#include <unistd.h>
@@ -454,7 +455,7 @@ config_init(void)
}
/* Read LOCALBASE/etc/pkg.conf first. */
- localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE;
+ localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE;
snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf",
localbase);
diff --git a/usr.sbin/pkg/config.h b/usr.sbin/pkg/config.h
index a63997a7a60d..f1a2aa227f16 100644
--- a/usr.sbin/pkg/config.h
+++ b/usr.sbin/pkg/config.h
@@ -31,7 +31,8 @@
#ifndef _PKG_CONFIG_H
#define _PKG_CONFIG_H
-#define _LOCALBASE "/usr/local"
+#include <paths.h>
+
#define URL_SCHEME_PREFIX "pkg+"
typedef enum {
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index 50b196fd9b30..3de789328c37 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -1046,7 +1046,7 @@ main(int argc, char *argv[])
yes = false;
snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg",
- getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE);
+ getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE);
if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) {
bootstrap_only = true;