Cleaned up variables at the end of source scripts; only keep the ones that were already in the environment

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@25944 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2008-01-14 11:17:34 +00:00
parent 3f41b31eaa
commit 7c92cd43fc
3 changed files with 71 additions and 12 deletions

View file

@ -1,3 +1,21 @@
2008-01-14 Nicola Pero <nicola.pero@meta-innovation.com>
* GNUstep.csh.in: At the end of the script unset
GNUSTEP_SYSTEM_WEB_APPS, GNUSTEP_LOCAL_WEB_APPS,
GNUSTEP_NETWORK_WEB_APPS, GNUSTEP_USER_WEB_APPS.
2008-01-14 Nicola Pero <nicola.pero@meta-innovation.com>
* GNUstep.sh.in (GNUSTEP_KEEP_CONFIG_FILE,
GNUSTEP_KEEP_USER_CONFIG_FILE): New variables used to remember if
GNUSTEP_CONFIG_FILE and GNUSTEP_USER_CONFIG_FILE were already set
in the environment by the user or if we set them in the script;
use them to decide if we need to keep them at the end of the
script, or unset them.
(GNUSTEP_USER_DEFAULTS_DIR): Unset or export this variable as
required.
* GNUstep.csh.in: Similar changes.
2008-01-14 Nicola Pero <nicola.pero@meta-innovation.com>
* configure.ac: Clearly explain in the help that --with-user-dir

View file

@ -4,12 +4,12 @@
#
# Shell initialization for the GNUstep environment.
#
# Copyright (C) 1998-2005 Free Software Foundation, Inc.
# Copyright (C) 1998-2008 Free Software Foundation, Inc.
#
# Author: Scott Christley <scottc@net-community.com>
# Author: Adam Fedor <fedor@gnu.org>
# Author: Richard Frith-Macdonald <rfm@gnu.org>
# Author: Nicola Pero <n.pero@mi.flashnet.it>
# Author: Nicola Pero <nicola.pero@meta-innovation.com>
#
# This file is part of the GNUstep Makefile Package.
#
@ -24,10 +24,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
# Set the GNUstep system root and local root
#
#
# Read our configuration files
#
@ -35,11 +31,15 @@
# Determine the location of the system configuration file
if ( ! ${?GNUSTEP_CONFIG_FILE} ) then
setenv GNUSTEP_CONFIG_FILE "@GNUSTEP_CONFIG_FILE@"
else
set GNUSTEP_KEEP_CONFIG_FILE=yes
endif
# Determine the location of the user configuration file
if ( ! ${?GNUSTEP_USER_CONFIG_FILE} ) then
setenv GNUSTEP_USER_CONFIG_FILE "@GNUSTEP_USER_CONFIG_FILE@"
else
set GNUSTEP_KEEP_USER_CONFIG_FILE=yes
endif
# Read the system configuration file
@ -254,8 +254,21 @@ if ( -e "$GNUSTEP_USER_ROOT/GNUstep.csh" ) then
source "$GNUSTEP_USER_ROOT/GNUstep.csh"
endif
if ( ! {$?GNUSTEP_KEEP_CONFIG_FILE} ) then
unsetenv GNUSTEP_CONFIG_FILE
endif
unset GNUSTEP_KEEP_CONFIG_FILE
if ( ! ${?GNUSTEP_KEEP_USER_CONFIG_FILE} ) then
unsetenv GNUSTEP_USER_CONFIG_FILE
endif
unset GNUSTEP_KEEP_USER_CONFIG_FILE
unsetenv GNUSTEP_USER_DEFAULTS_DIR
unsetenv GNUSTEP_SYSTEM_APPS
unsetenv GNUSTEP_SYSTEM_ADMIN_APPS
unsetenv GNUSTEP_SYSTEM_WEB_APPS
unsetenv GNUSTEP_SYSTEM_TOOLS
unsetenv GNUSTEP_SYSTEM_ADMIN_TOOLS
unsetenv GNUSTEP_SYSTEM_LIBRARY
@ -267,6 +280,7 @@ unsetenv GNUSTEP_SYSTEM_DOC_INFO
unsetenv GNUSTEP_NETWORK_APPS
unsetenv GNUSTEP_NETWORK_ADMIN_APPS
unsetenv GNUSTEP_NETWORK_WEB_APPS
unsetenv GNUSTEP_NETWORK_TOOLS
unsetenv GNUSTEP_NETWORK_ADMIN_TOOLS
unsetenv GNUSTEP_NETWORK_LIBRARY
@ -278,6 +292,7 @@ unsetenv GNUSTEP_NETWORK_DOC_INFO
unsetenv GNUSTEP_LOCAL_APPS
unsetenv GNUSTEP_LOCAL_ADMIN_APPS
unsetenv GNUSTEP_LOCAL_WEB_APPS
unsetenv GNUSTEP_LOCAL_TOOLS
unsetenv GNUSTEP_LOCAL_ADMIN_TOOLS
unsetenv GNUSTEP_LOCAL_LIBRARY
@ -289,6 +304,7 @@ unsetenv GNUSTEP_LOCAL_DOC_INFO
unsetenv GNUSTEP_USER_APPS
unsetenv GNUSTEP_USER_ADMIN_APPS
unsetenv GNUSTEP_USER_WEB_APPS
unsetenv GNUSTEP_USER_TOOLS
unsetenv GNUSTEP_USER_ADMIN_TOOLS
unsetenv GNUSTEP_USER_LIBRARY

View file

@ -4,12 +4,12 @@
#
# Shell initialization for the GNUstep environment.
#
# Copyright (C) 1997-2005 Free Software Foundation, Inc.
# Copyright (C) 1997-2008 Free Software Foundation, Inc.
#
# Author: Scott Christley <scottc@net-community.com>
# Author: Adam Fedor <fedor@gnu.org>
# Author: Richard Frith-Macdonald <rfm@gnu.org>
# Author: Nicola Pero <n.pero@mi.flashnet.it>
# Author: Nicola Pero <nicola.pero@meta-innovation.com>
#
# This file is part of the GNUstep Makefile Package.
#
@ -68,10 +68,6 @@ if [ -n "$ZSH_VERSION" ]; then
fi
#
# Set the GNUstep system root and local root
#
#
# Read our configuration files
#
@ -79,11 +75,18 @@ fi
# Determine the location of the system configuration file
if [ -z "$GNUSTEP_CONFIG_FILE" ]; then
GNUSTEP_CONFIG_FILE=@GNUSTEP_CONFIG_FILE@
else
# Remember that the variable was already set in the environment, and
# preserve it at the end of the script. Otherwise we'll unset it to
# avoid polluting the environment with our own internal variables.
GNUSTEP_KEEP_CONFIG_FILE=yes
fi
# Determine the location of the user configuration file
if [ -z "$GNUSTEP_USER_CONFIG_FILE" ]; then
GNUSTEP_USER_CONFIG_FILE=@GNUSTEP_USER_CONFIG_FILE@
else
GNUSTEP_KEEP_USER_CONFIG_FILE=yes
fi
# Read the system configuration file
@ -417,6 +420,12 @@ fi
# so it can print out all of the GNUstep variables.
#
if [ -n "$GNUSTEP_SH_EXPORT_ALL_VARIABLES" ]; then
unset GNUSTEP_KEEP_CONFIG_FILE GNUSTEP_KEEP_USER_CONFIG_FILE
export GNUSTEP_CONFIG_FILE GNUSTEP_USER_CONFIG_FILE
export GNUSTEP_USER_DEFAULTS_DIR
export GNUSTEP_SYSTEM_APPS GNUSTEP_SYSTEM_ADMIN_APPS GNUSTEP_SYSTEM_WEB_APPS GNUSTEP_SYSTEM_TOOLS GNUSTEP_SYSTEM_ADMIN_TOOLS
export GNUSTEP_SYSTEM_LIBRARY GNUSTEP_SYSTEM_HEADERS GNUSTEP_SYSTEM_LIBRARIES
export GNUSTEP_SYSTEM_DOC GNUSTEP_SYSTEM_DOC_MAN GNUSTEP_SYSTEM_DOC_INFO
@ -435,6 +444,22 @@ if [ -n "$GNUSTEP_SH_EXPORT_ALL_VARIABLES" ]; then
export GNUSTEP_SYSTEM_USERS_DIR GNUSTEP_LOCAL_USERS_DIR GNUSTEP_NETWORK_USERS_DIR
else
# Unset these variables but only if we set them internally; keep
# them if they were already in the environment.
if [ -z "$GNUSTEP_KEEP_CONFIG_FILE" ]; then
unset GNUSTEP_CONFIG_FILE
fi
unset GNUSTEP_KEEP_CONFIG_FILE
if [ -z "$GNUSTEP_KEEP_USER_CONFIG_FILE" ]; then
unset GNUSTEP_USER_CONFIG_FILE
fi
unset GNUSTEP_KEEP_USER_CONFIG_FILE
# Always unset these variables
unset GNUSTEP_USER_DEFAULTS_DIR
unset GNUSTEP_SYSTEM_APPS
unset GNUSTEP_SYSTEM_ADMIN_APPS
unset GNUSTEP_SYSTEM_WEB_APPS