-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
165 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# YAIM function | ||
# This function unsets the variables used by grid-env-funcs.sh | ||
# | ||
unset myvar | ||
unset myvalue | ||
unset myfieldsep | ||
unset mytmp | ||
unset -f gridpath_prepend | ||
unset -f gridpath_append | ||
unset -f gridpath_delete | ||
unset -f gridenv_set | ||
unset -f gridenv_setind |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Functions for manipulating the grid environment | ||
# | ||
# gridpath_prepend - prepend a value to a path-like environmnet variable | ||
# - puts a ':' to the end end the beginning of the variable | ||
# - removes the value from the string and removes duplicate '::' | ||
# - prepend the value to the beginning of the variable | ||
# - removes duplicate '::' and removes ':' from the beginning and the end variable | ||
# - MANPATH has to be treated specially since, :: has a meaning -> don't get removed | ||
# - Simple : could have a meaning so if it was there in the end or the begining we should not remove it. | ||
# - export the variable, or echos the csh syntax | ||
# | ||
# gridpath_append - the same as prepend but it appends the value to the end of the variable | ||
# gridpath_delete - delete a value from an environment variable. if the value becomes null string then it unsets the environment variable | ||
# gridemv_set - sets an environment variable | ||
# gridemv_unset - unsets an environment variable | ||
# gridenv_setind - sets an environment variable if it is not already defined | ||
|
||
|
||
function gridpath_prepend() { | ||
myvar="$1" | ||
myvalue="$2" | ||
myfieldsep=":" | ||
mytmp="`eval echo \\$$myvar`" | ||
|
||
if [ "x$mytmp" = "x$myvalue" ] || [ "x$mytmp" = "x$myfieldsep$myvalue" ] || [ "x$mytmp" = "x$myvalue$myfieldsep" ] ; then | ||
mytmp="${mytmp//$myvalue/}" | ||
else | ||
mytmp="${mytmp//$myfieldsep$myvalue$myfieldsep/$myfieldsep}" #remove if in the middle | ||
mytmp="${mytmp#$myvalue$myfieldsep}" #remove if in the begining | ||
mytmp="${mytmp%$myfieldsep$myvalue}" #remove if at the end | ||
fi | ||
|
||
if [ "x$mytmp" = "x" ]; then | ||
mytmp="$myvalue" | ||
else | ||
mytmp="$myvalue$myfieldsep$mytmp" | ||
fi | ||
|
||
mytmp="${mytmp//$myfieldsep$myfieldsep$myfieldsep/$myfieldsep$myfieldsep}" | ||
|
||
if [ "x$myvar" = "xMANPATH" ] ; then | ||
mytmp="${mytmp}::" | ||
fi | ||
if [ "x$ISCSHELL" = "xyes" ]; then | ||
echo "setenv $myvar \"$mytmp\"" | ||
fi | ||
eval export ${myvar}=\""$mytmp"\" | ||
} | ||
|
||
function gridpath_append() { | ||
myvar="$1" | ||
myvalue="$2" | ||
myfieldsep=":" | ||
mytmp="`eval echo \\$$myvar`" | ||
|
||
if [ "x$mytmp" = "x$myvalue" ] || [ "x$mytmp" = "x$myfieldsep$myvalue" ] || [ "x$mytmp" = "x$myvalue$myfieldsep" ] ; then | ||
mytmp="${mytmp//$myvalue/}" | ||
else | ||
mytmp="${mytmp//$myfieldsep$myvalue$myfieldsep/$myfieldsep}" #remove if in the middle | ||
mytmp="${mytmp#$myvalue$myfieldsep}" #remove if in the begining | ||
mytmp="${mytmp%$myfieldsep$myvalue}" #remove if at the end | ||
fi | ||
|
||
if [ "x$mytmp" = "x" ]; then | ||
mytmp="$myvalue" | ||
else | ||
mytmp="$mytmp$myfieldsep$myvalue" | ||
fi | ||
|
||
mytmp="${mytmp//$myfieldsep$myfieldsep$myfieldsep/$myfieldsep$myfieldsep}" | ||
|
||
if [ "x$myvar" = "xMANPATH" ] ; then | ||
mytmp="${mytmp}::" | ||
fi | ||
if [ "x$ISCSHELL" = "xyes" ]; then | ||
echo "setenv $myvar \"$mytmp\"" | ||
fi | ||
eval export ${myvar}=\""$mytmp"\" | ||
} | ||
|
||
function gridenv_set() { | ||
myvar="$1" | ||
myvalue="$2" | ||
myfieldsep=":" | ||
|
||
if [ "x$ISCSHELL" = "xyes" ]; then | ||
echo "setenv $myvar \"$myvalue\"" | ||
fi | ||
eval export ${myvar}="\"${myvalue}\"" | ||
} | ||
|
||
function gridenv_setind() { | ||
myvar="$1" | ||
myvalue="$2" | ||
if [ "x$ISCSHELL" = "xyes" ]; then | ||
echo 'if ( ${?'$myvar'} == 0 ) setenv '$myvar \'"$myvalue"\' | ||
fi | ||
eval "export $myvar=\${$myvar:-\$myvalue}" | ||
} | ||
|
||
function gridenv_unset() { | ||
myvar="$1" | ||
eval unset \""$myvar"\" | ||
} | ||
|
||
function gridpath_delete() { | ||
myvar="${!1}" | ||
myvalue="$2" | ||
declare myvar=$(echo $myvar | sed -e "s;\(^$myvalue:\|:$myvalue$\|:$myvalue\(:\)\|^$myvalue$\);\2;g") | ||
|
||
if [ "x$ISCSHELL" = "xyes" ]; then | ||
echo "setenv $1 \"$myvar\"" | ||
fi | ||
eval export $1=\""$myvar"\" | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class vosupport::vos::atlas() | ||
{ | ||
vosupport::enable_vo { | ||
'atlas': | ||
enable_mappings_for_service => "ARGUS" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class vosupport::vos::dteam() | ||
{ | ||
vosupport::enable_vo { | ||
'dteam': | ||
enable_mappings_for_service => "ARGUS" | ||
} | ||
|
||
} |