Browse Source

* converted `sde install` into bin/sde-install command

git-svn-id: svn://svn.opensde.net/opensde/opensde/trunk@20975 10447126-35f2-4685-b0cf-6dd780d3921f
misl/sde-wrapper
Alejandro Mery 17 years ago
parent
commit
dbdc26fec8
3 changed files with 60 additions and 44 deletions
  1. +43
    -0
      bin/sde-install
  2. +17
    -0
      lib/sde-install.hlp
  3. +0
    -44
      lib/sde-install.in

+ 43
- 0
bin/sde-install

@ -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

+ 17
- 0
lib/sde-install.hlp

@ -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

+ 0
- 44
lib/sde-install.in

@ -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

Loading…
Cancel
Save