declare Version=2.1.3
#==============================================================================
# Copyright and license info is available in the LICENSE file included with
# the Server Deployment Package (SDP), and also available online:
# https://swarm.workshop.perforce.com/projects/perforce-software-sdp/view/main/LICENSE
#------------------------------------------------------------------------------
#==============================================================================
# Standard Environment for bash scripts.
# Use 'set -a' mode to export everything in this file.
set -a
# Require variables to be declared.
set -u
# Set aliaes for common commands. This is a safety/security precaution to
# help ensure intended commands are run, rather than identically named
# programs elsewhere in the PATH. Paths may need to adjusted if run on
# different systems.
alias rm=/bin/rm
alias mkdir=/bin/mkdir
alias mkpath="/bin/mkdir -p"
alias printf="/usr/bin/printf"
# Define a temporary directory. If /dev/shm (tmpfs) is available, try
# to use it for optimal performance; otherwise use 'mktemp -d'.
declare P4U_TMPDIR=
if [[ -d /dev/shm ]]; then
P4U_TMPDIR=/dev/shm/tmp.$$.${RANDOM}${RANDOM}
mkdir $P4U_TMPDIR > /dev/null 2>&1 || P4U_TMPDIR=$(mktemp -d)
chmod 700 $P4U_TMPDIR
else
P4U_TMPDIR=$(mktemp -d)
fi
# Initialize GARBAGE to contain the $P4U_TMPDIR. GARBAGE contains a list
# of files and/or directories to be removed (with rm -rf) upon termination
# of the script.
declare GARBAGE="$P4U_TMPDIR"
declare RGARBAGE=""
# Provide a baseline default VERBOSITY. Scripts may override this to define
# a default for a specific script. Script users may override this on a per-run
# basis. Scale:
# 1=errors only
# 2=errors and warnings
# 3=normal
# 4=verbose
declare -i VERBOSITY=5
# Store just the name of the current script, useful for logging.
declare THISSCRIPT=${0##*/}
# Store the initial command line in $CMDLINE, useful for logging.
declare CMDLINE="$0 $*"
# Initialize the NO_OP ("no operation") test mode. If set to 1, scripts
# interpret this to mean "show what would be done, without executing any
# data-affecting commands."
declare -i NO_OP=0
# Globals for runCmd, containing last command, its exit code and output.
declare CMDLAST=""
declare -i CMDEXITCODE=0
declare CMDOUTPUT=""
# Globals for runRemoteCmd, containing last command, its exit code and output.
declare RCMDLAST=""
declare -i RCMDEXITCODE=0
declare RCMDOUTPUT=""
# Header, 79 characters of screen-splitting divider.
declare H="\n==============================================================================="
# At the end of this file, return to default behavior, undoing 'set -a' above.
set +a
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #4 | 23205 | Robert Cowham | Merged all changes from dev to test | ||
| #3 | 22142 | Robert Cowham | Merge in latest changes from Dev | ||
| #2 | 20726 | Robert Cowham | Catch up from dev | ||
| #1 | 18586 | Robert Cowham | Branching using cowhamr.sdp.dev | ||
| //guest/perforce_software/sdp/dev/Server/Unix/p4/common/lib/p4u_env.sh | |||||
| #3 | 16029 | C. Thomas Tyler |
Routine merge to dev from main using: p4 merge -b perforce_software-sdp-dev |
||
| #2 | 13582 | C. Thomas Tyler |
Updated template.sh and associated bash libraries. Added show_versions() standard function and a standard '-V' flag to access it. Added version value definitions to all bash library files. |
||
| #1 | 10638 | C. Thomas Tyler | Populate perforce_software-sdp-dev. | ||
| //guest/perforce_software/sdp/main/Server/Unix/p4/common/lib/p4u_env.sh | |||||
| #1 | 10148 | C. Thomas Tyler | Promoted the Perforce Server Deployment Package to The Workshop. | ||