git-svn-id: svn://svn.opensde.net/opensde/opensde/trunk@20975 10447126-35f2-4685-b0cf-6dd780d3921fmisl/sde-wrapper
@ -0,0 +1,43 @@ |
|||
#!/bin/sh |
|||
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|||
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|||
# |
|||
# Filename: bin/sde-install |
|||
# Copyright (C) 2006 - 2007 The OpenSDE Project |
|||
# |
|||
# More information can be found in the files COPYING and README. |
|||
# |
|||
# This program is free software; you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation; version 2 of the License. A copy of the |
|||
# GNU General Public License can be found in the file COPYING. |
|||
# --- SDE-COPYRIGHT-NOTE-END --- |
|||
|
|||
#Description: Install the `sde` wrapper on $HOME/bin/ |
|||
|
|||
set -e |
|||
|
|||
[ -n "$SDEROOT" ] || |
|||
export SDEROOT=$( cd "${0%/*}/.."; pwd -P ) |
|||
|
|||
. $SDEROOT/lib/libsde.in |
|||
|
|||
# what action was requested? |
|||
if [ $# -ne 0 ]; then |
|||
. $SDEROOT/lib/sde-help.in |
|||
help_command install |
|||
elif [ -L "$HOME/bin/sde" ]; then |
|||
if [ "$( readlink -f $HOME/bin/sde )" == "$SDEROOT/bin/sde" ]; then |
|||
echo_warning "the same sde wrapper is already installed, skip." |
|||
else |
|||
echo_warning "sde wrapper already installed [$( readlink -f $HOME/bin/sde )]" |
|||
ln -sf "$SDEROOT/bin/sde" "$HOME/bin/sde" |
|||
echo_info "sde wrapper reinstalled at $HOME/bin/" |
|||
fi |
|||
elif [ -e "$HOME/bin/sde" ]; then |
|||
echo_abort 1 "Something is already at '$HOME/bin/sde', this is not supported." |
|||
else |
|||
mkdir -p "$HOME/bin/" |
|||
ln -s "$SDEROOT/bin/sde" "$HOME/bin/sde" |
|||
echo_info "sde wrapper installed at $HOME/bin/" |
|||
fi |
@ -0,0 +1,17 @@ |
|||
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|||
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|||
# |
|||
# Filename: lib/sde-install.hlp |
|||
# Copyright (C) 2007 The OpenSDE Project |
|||
# |
|||
# More information can be found in the files COPYING and README. |
|||
# |
|||
# This program is free software; you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation; version 2 of the License. A copy of the |
|||
# GNU General Public License can be found in the file COPYING. |
|||
# --- SDE-COPYRIGHT-NOTE-END --- |
|||
|
|||
Usage: sde install |
|||
Installs a symlink of the sde wrapper at $HOME/bin/, |
|||
which is supposed to be on $PATH |
@ -1,44 +0,0 @@ |
|||
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|||
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|||
# |
|||
# Filename: lib/sde-install.in |
|||
# Copyright (C) 2006 The OpenSDE Project |
|||
# |
|||
# More information can be found in the files COPYING and README. |
|||
# |
|||
# This program is free software; you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation; version 2 of the License. A copy of the |
|||
# GNU General Public License can be found in the file COPYING. |
|||
# --- SDE-COPYRIGHT-NOTE-END --- |
|||
|
|||
#Description: Install the `sde` wrapper on $HOME/bin/ |
|||
|
|||
install_usage() { |
|||
cat <<EOT |
|||
Usage: sde install |
|||
Installs a symlink of the sde wrapper at $HOME/bin/, |
|||
which is supposed to be on \$PATH |
|||
EOT |
|||
} |
|||
|
|||
if [ "$module" = "install" ]; then |
|||
# what action was requested? |
|||
if [ $# -ne 0 ]; then |
|||
install_usage |
|||
elif [ -L "$HOME/bin/sde" ]; then |
|||
if [ "$( readlink -f $HOME/bin/sde )" == "$SDEROOT/bin/sde" ]; then |
|||
echo_warning "the same sde wrapper is already installed, skip." |
|||
else |
|||
echo_warning "sde wrapper already installed [$( readlink -f $HOME/bin/sde )]" |
|||
ln -sf "$SDEROOT/bin/sde" "$HOME/bin/sde" |
|||
echo_info "sde wrapper reinstalled at $HOME/bin/" |
|||
fi |
|||
elif [ -e "$HOME/bin/sde" ]; then |
|||
echo_abort 1 "Something is already at '$HOME/bin/sde', this is not supported." |
|||
else |
|||
mkdir -p "$HOME/bin/" |
|||
ln -s "$SDEROOT/bin/sde" "$HOME/bin/sde" |
|||
echo_info "sde wrapper installed at $HOME/bin/" |
|||
fi |
|||
fi |