summaryrefslogtreecommitdiff
path: root/devel/bmake/files/var.c
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2010-09-07 14:11:07 +0000
committerjoerg <joerg@pkgsrc.org>2010-09-07 14:11:07 +0000
commit92219014db9b676e01e78bbe73c3877f94f2a471 (patch)
treeab9a7f9be7c8a296d14b01c32db3ad74c367c34b /devel/bmake/files/var.c
parent4f45bdd33e7709b15d484a629483e12d8643a6e1 (diff)
downloadpkgsrc-92219014db9b676e01e78bbe73c3877f94f2a471.tar.gz
Import bmake-20100808:
- boot-strap (TOOL_DIFF): set this to ensure tests use the same version of diff that configure tested - in jobs mode, when we discover we cannot make something, call PrintOnError before exit. - formatting fixes for ignored errors - ensure jobs are cleaned up regardless of where wait() was called. - os.sh (MACHINE_ARCH): watch out for drivel from uname -p - call PrintOnError from JobFinish when we detect an error we are not ignoring. - use bmake_signal() which is a wrapper around sigaction() in place of signal() - add .export-env to allow exporting variables to environment without tracking (so no re-export when the internal value is changed). - fix for .info et al being greedy. - back to using realpath on argv[0] but only if contains '/' and does not start with '/'.
Diffstat (limited to 'devel/bmake/files/var.c')
-rw-r--r--devel/bmake/files/var.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/devel/bmake/files/var.c b/devel/bmake/files/var.c
index edc0058b9e3..17de1040051 100644
--- a/devel/bmake/files/var.c
+++ b/devel/bmake/files/var.c
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.1.1.7 2010/04/24 20:34:02 joerg Exp $ */
+/* $NetBSD: var.c,v 1.1.1.8 2010/09/07 14:12:15 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.1.1.7 2010/04/24 20:34:02 joerg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.1.1.8 2010/09/07 14:12:15 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.1.1.7 2010/04/24 20:34:02 joerg Exp $");
+__RCSID("$NetBSD: var.c,v 1.1.1.8 2010/09/07 14:12:15 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -682,6 +682,7 @@ Var_Export(char *str, int isExport)
char *val;
char **av;
char *as;
+ int track;
int ac;
int i;
@@ -690,6 +691,12 @@ Var_Export(char *str, int isExport)
return;
}
+ if (strncmp(str, "-env", 4) == 0) {
+ track = 0;
+ str += 4;
+ } else {
+ track = VAR_EXPORT_PARENT;
+ }
val = Var_Subst(NULL, str, VAR_GLOBAL, 0);
av = brk_string(val, &ac, FALSE, &as);
for (i = 0; i < ac; i++) {
@@ -709,10 +716,10 @@ Var_Export(char *str, int isExport)
continue;
}
}
- if (Var_Export1(name, VAR_EXPORT_PARENT)) {
+ if (Var_Export1(name, track)) {
if (VAR_EXPORTED_ALL != var_exportedVars)
var_exportedVars = VAR_EXPORTED_YES;
- if (isExport) {
+ if (isExport && track) {
Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL);
}
}