OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: bin/sde-install
  6. # Copyright (C) 2006 - 2008 The OpenSDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. #Description: Install the `sde` wrapper on $HOME/bin/
  16. set -e
  17. [ -n "$SDEROOT" ] ||
  18. export SDEROOT=$( cd "${0%/*}/.."; pwd -P )
  19. . $SDEROOT/lib/libsde.in
  20. install_usage() {
  21. cat <<EOT
  22. Usage: sde install
  23. Installs a symlink of the sde wrapper at \$HOME/bin/,
  24. which is supposed to be on \$PATH
  25. EOT
  26. }
  27. # what action was requested?
  28. if [ $# -ne 0 ]; then
  29. install_usage
  30. elif [ -L "$HOME/bin/sde" ]; then
  31. if [ "$( readlink -f $HOME/bin/sde )" = "$SDEROOT/bin/sde" ]; then
  32. echo_warning "the same sde wrapper is already installed, skip."
  33. else
  34. echo_warning "sde wrapper already installed [$( readlink -f $HOME/bin/sde )]"
  35. ln -sf "$SDEROOT/bin/sde" "$HOME/bin/sde"
  36. echo_info "sde wrapper reinstalled at $HOME/bin/"
  37. fi
  38. elif [ -e "$HOME/bin/sde" ]; then
  39. echo_abort 1 "Something is already at '$HOME/bin/sde', this is not supported."
  40. else
  41. mkdir -p "$HOME/bin/"
  42. ln -s "$SDEROOT/bin/sde" "$HOME/bin/sde"
  43. echo_info "sde wrapper installed at $HOME/bin/"
  44. fi