From 0d5e65186195325557d4b0a8331d066a85818e01 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 14 Aug 2020 09:45:41 +0000 Subject: [PATCH] crunchgen: use pwd -P without env The -P flag is required by POSIX so we don't have to care whether pwd is a shell builtin or not. This also allows removing pwd from the list of bootstrap tools since all shells we care about for building have a builtin pwd command. This effectively reverts r364190. Suggested By: rgrimes, jrtc27 --- tools/build/Makefile | 2 +- usr.sbin/crunch/crunchgen/crunchgen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/Makefile b/tools/build/Makefile index c78dbbdbbd4..23bd6cc1896 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -113,7 +113,7 @@ SYSINCS+= ${SRCTOP}/sys/sys/font.h # Linux/MacOS since we only use flags that are supported by all of them. _host_tools_to_symlink= basename bzip2 bunzip2 chmod chown cmp comm cp date dd \ dirname echo env false find fmt gzip gunzip head hostname id ln ls \ - mkdir mv nice patch pwd rm realpath sh sleep stat tee touch tr true \ + mkdir mv nice patch rm realpath sh sleep stat tee touch tr true \ uname uniq wc which # We also need a symlink to the absolute path to the make binary used for diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index 914795be7a2..5a3200ed7fa 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -653,7 +653,7 @@ fillin_program(prog_t *p) /* Determine the actual srcdir (maybe symlinked). */ if (p->srcdir) { - snprintf(line, MAXLINELEN, "cd %s && env pwd -P", p->srcdir); + snprintf(line, MAXLINELEN, "cd %s && pwd -P", p->srcdir); f = popen(line,"r"); if (!f) errx(1, "Can't execute: %s\n", line); -- 2.45.0