From f9722b4b4842b7597ce0392accaeb34c7bec12fe Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Wed, 25 Apr 2001 19:11:09 +0000 Subject: [PATCH] Add /usr/X11R6/bin to the exported PATH. If /usr/local/bin is there, /usr/X11R6/bin should be there. This helps all the ports that need to run `mkfontdir' and error out as many port maintainers do not realize `mkfontdir' isn't in the path. Prompted by: pkg_add pcemu --- usr.sbin/pkg_install/add/main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c index bd6db6f8d159..a542e18cb148 100644 --- a/usr.sbin/pkg_install/add/main.c +++ b/usr.sbin/pkg_install/add/main.c @@ -163,7 +163,8 @@ main(int argc, char **argv) usage(); } /* Make sure the sub-execs we invoke get found */ - setenv("PATH", "/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin", 1); + setenv("PATH", "/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin" + 1); /* Set a reasonable umask */ umask(022); @@ -189,12 +190,17 @@ getpackagesite(void) return sitepath; } - if (getenv("PACKAGEROOT")) - strcpy(sitepath, getenv("PACKAGEROOT")); + if (getenv("PACKAGEMIRROR")) + strcpy(sitepath, getenv("PACKAGEMIRROR")); else strcpy(sitepath, "ftp://ftp.FreeBSD.org"); - strcat(sitepath, "/pub/FreeBSD/ports/"); + if (getenv("PACKAGEROOT")) + strcpy(sitepath, getenv("PACKAGEMIRRORROOT")); + else + strcat(sitepath, "/pub"); + + strcat(sitepath, "/FreeBSD/ports/"); uname(&u); strcat(sitepath, u.machine);