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.

43 lines
1.4 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 - 2007 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. # what action was requested?
  21. if [ $# -ne 0 ]; then
  22. . $SDEROOT/lib/sde-help.in
  23. help_command install
  24. elif [ -L "$HOME/bin/sde" ]; then
  25. if [ "$( readlink -f $HOME/bin/sde )" == "$SDEROOT/bin/sde" ]; then
  26. echo_warning "the same sde wrapper is already installed, skip."
  27. else
  28. echo_warning "sde wrapper already installed [$( readlink -f $HOME/bin/sde )]"
  29. ln -sf "$SDEROOT/bin/sde" "$HOME/bin/sde"
  30. echo_info "sde wrapper reinstalled at $HOME/bin/"
  31. fi
  32. elif [ -e "$HOME/bin/sde" ]; then
  33. echo_abort 1 "Something is already at '$HOME/bin/sde', this is not supported."
  34. else
  35. mkdir -p "$HOME/bin/"
  36. ln -s "$SDEROOT/bin/sde" "$HOME/bin/sde"
  37. echo_info "sde wrapper installed at $HOME/bin/"
  38. fi