Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions indra/newview/linux_tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
# Install the Second Life Viewer. This script can install the viewer both
# system-wide and for an individual user.

VT102_STYLE_NORMAL='\E[0m'
VT102_COLOR_RED='\E[31m'
exec 3>&2 2> /dev/null
if command -v tput > /dev/null ; then
_STYLE_NORMAL="$(tput sgr0)"
_COLOR_RED="$(tput setaf 9)"
fi
exec 2>&3 3>&-

SCRIPTSRC=`readlink -f "$0" || echo "$0"`
RUN_PATH=`dirname "${SCRIPTSRC}" || echo .`
Expand Down Expand Up @@ -34,15 +38,15 @@ function prompt()

function die()
{
warn $1
warn "$1"
exit 1
}

function warn()
{
echo -n -e $VT102_COLOR_RED
echo $1
echo -n -e $VT102_STYLE_NORMAL
echo -n "$_COLOR_RED"
echo -e "$1"
echo -n "$_STYLE_NORMAL"
}

function homedir_install()
Expand Down Expand Up @@ -82,7 +86,9 @@ function root_install()

function install_to_prefix()
{
test -e "$1" && backup_previous_installation "$1"
if [[ -e "$1" && -z $NOBACKUP ]]; then
backup_previous_installation "$1"
fi
mkdir -p "$1" || die "Failed to create installation directory!"

echo " - Installing to $1"
Expand All @@ -95,7 +101,7 @@ function backup_previous_installation()
local backup_dir="$1".backup-$(date -I)
echo " - Backing up previous installation to $backup_dir"

mv "$1" "$backup_dir" || die "Failed to create backup of existing installation!"
mv "$1" "$backup_dir" || die "Failed to create backup of existing installation!\nSpecify NOBACKUP=1 when invoking to skip the backup step."
}


Expand Down
Loading