Merge pull request #12 from akohlmey/shell-script-paranoia

Disable custom locale and grep options in shell scripts
This commit is contained in:
sjplimp 2016-08-27 16:59:43 -06:00 committed by GitHub
commit 6a4633af0a
31 changed files with 126 additions and 4 deletions

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -1,6 +1,10 @@
# Depend.sh = Install/unInstall files due to package dependencies # Depend.sh = Install/unInstall files due to package dependencies
# this script is invoked after any package is installed/uninstalled # this script is invoked after any package is installed/uninstalled
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# all parent/child package dependencies should be listed below # all parent/child package dependencies should be listed below
# parent package = has files that files in another package derive from # parent package = has files that files in another package derive from
# child package = has files that derive from files in another package # child package = has files that derive from files in another package

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -7,6 +7,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -5,6 +5,12 @@
# sh Make.sh Makefile.shlib # sh Make.sh Makefile.shlib
# sh Make.sh Makefile.list # sh Make.sh Makefile.list
# turn off enforced customizations
GREP_OPTIONS=
# enforce using portable C locale
LC_ALL=C
export LC_ALL GREP_OPTIONS
# function to create one style_*.h file # function to create one style_*.h file
# must whack *.d files that depend on style_*.h file, # must whack *.d files that depend on style_*.h file,
# else Make will not recreate them # else Make will not recreate them

View File

@ -5,6 +5,10 @@ mode=$1
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
# enforce using portable C locale
LC_ALL=C
export LC_ALL
action () { action () {
if (test $mode = 0) then if (test $mode = 0) then
rm -f ../$1 rm -f ../$1

View File

@ -5,6 +5,10 @@ mode=$1
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
# enforce using portable C locale
LC_ALL=C
export LC_ALL
action () { action () {
if (test $mode = 0) then if (test $mode = 0) then
rm -f ../$1 rm -f ../$1

View File

@ -5,6 +5,10 @@ mode=$1
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
# enforce using portable C locale
LC_ALL=C
export LC_ALL
action () { action () {
if (test $mode = 0) then if (test $mode = 0) then
rm -f ../$1 rm -f ../$1

View File

@ -1,6 +1,10 @@
# Package.sh = package management, called from Makefile # Package.sh = package management, called from Makefile
# Syntax: sh Package.sh DIR status/update/overwrite/diff # Syntax: sh Package.sh DIR status/update/overwrite/diff
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# package is already installed if any package *.cpp or *.h file is in src # package is already installed if any package *.cpp or *.h file is in src
# else not installed # else not installed

View File

@ -5,6 +5,10 @@ mode=$1
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
# enforce using portable C locale
LC_ALL=C
export LC_ALL
action () { action () {
if (test $mode = 0) then if (test $mode = 0) then
rm -f ../$1 rm -f ../$1

View File

@ -5,6 +5,10 @@ mode=$1
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
# enforce using portable C locale
LC_ALL=C
export LC_ALL
action () { action () {
if (test $mode = 0) then if (test $mode = 0) then
rm -f ../$1 rm -f ../$1

View File

@ -5,6 +5,10 @@ mode=$1
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
# enforce using portable C locale
LC_ALL=C
export LC_ALL
action () { action () {
if (test $mode = 0) then if (test $mode = 0) then
rm -f ../$1 rm -f ../$1

View File

@ -5,6 +5,10 @@ mode=$1
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
# enforce using portable C locale
LC_ALL=C
export LC_ALL
action () { action () {
if (test $mode = 0) then if (test $mode = 0) then
rm -f ../$1 rm -f ../$1

View File

@ -5,6 +5,10 @@ mode=$1
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
# enforce using portable C locale
LC_ALL=C
export LC_ALL
action () { action () {
if (test $mode = 0) then if (test $mode = 0) then
rm -f ../$1 rm -f ../$1

View File

@ -1,12 +1,12 @@
# Install/unInstall package files in LAMMPS # Install/unInstall package files in LAMMPS
# mode = 0/1/2 for uninstall/install/update # mode = 0/1/2 for uninstall/install/update
# this is default Install.sh for all packages
# if package has an auxiliary library or a file with a dependency,
# then package dir has its own customized Install.sh
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {

View File

@ -3,6 +3,10 @@
mode=$1 mode=$1
# enforce using portable C locale
LC_ALL=C
export LC_ALL
# arg1 = file, arg2 = file it depends on # arg1 = file, arg2 = file it depends on
action () { action () {