summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorcube <cube>2009-03-09 17:47:36 +0000
committercube <cube>2009-03-09 17:47:36 +0000
commitb16ea87ea2a9358235f8ad4b9f6a470f8dcc77c6 (patch)
tree4bf8369aa6ddd646272b174a9023ca77aebcff89 /sysutils
parent145b410654e951899ff27b7a0bf1254faf2b262e (diff)
downloadpkgsrc-b16ea87ea2a9358235f8ad4b9f6a470f8dcc77c6.tar.gz
Look for a file binary in /bin or /usr/bin, instead of relying on PATH.
After the barrier, the builtin.mk file is parsed with a PATH that includes LOCALBASE in front, which gives wrong results if file is installed in LOCALBASE.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/file/builtin.mk13
1 files changed, 10 insertions, 3 deletions
diff --git a/sysutils/file/builtin.mk b/sysutils/file/builtin.mk
index 9a6053eb743..abd6ac48bc4 100644
--- a/sysutils/file/builtin.mk
+++ b/sysutils/file/builtin.mk
@@ -1,10 +1,11 @@
-# $NetBSD: builtin.mk,v 1.5 2008/10/29 20:50:16 christos Exp $
+# $NetBSD: builtin.mk,v 1.6 2009/03/09 17:47:36 cube Exp $
BUILTIN_PKG:= file
-BUILTIN_FIND_FILES_VAR:= H_FILE
+BUILTIN_FIND_FILES_VAR:= H_FILE BIN_FILE
BUILTIN_FIND_FILES.H_FILE= /usr/include/magic.h
BUILTIN_FIND_GREP.H_FILE= magic_file
+BUILTIN_FIND_FILES.BIN_FILE= /bin/file /usr/bin/file
.include "../../mk/buildlink3/bsd.builtin.mk"
@@ -17,13 +18,19 @@ IS_BUILTIN.file= no
. if empty(H_FILE:M__nonexistent__) && empty(H_FILE:M${LOCALBASE}/*)
IS_BUILTIN.file= yes
. endif
+. if empty(BIN_FILE:M__nonexistent__) && empty(BIN_FILE:M{LOCALBASE}/*)
+BUILTIN_CMD.file= ${BIN_FILE}
+. else
+BUILTIN_CMD.file= file
+. endif
.endif
MAKEVARS+= IS_BUILTIN.file
.if !defined(BUILTIN_PKG.file) && !empty(IS_BUILTIN.file:M[yY][eE][sS])
-BUILTIN_VERSION.file!= file --version 2>&1 | ${GREP} 'file-' | ${SED} 's/file-//'
+BUILTIN_VERSION.file!= ${BUILTIN_CMD.file} --version 2>&1 | ${GREP} 'file-' | ${SED} 's/file-//'
BUILTIN_PKG.file= file-${BUILTIN_VERSION.file}
.endif
+MAKEVARS+= BUILTIN_PKG.file
###
### Determine whether we should use the built-in implementation if it