installPackage.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. set -e
  3. # install the target package into the target location
  4. # This file is part of PrawnOS (https://www.prawnos.com)
  5. # Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
  6. # PrawnOS is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License version 2
  8. # as published by the Free Software Foundation.
  9. # PrawnOS is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
  15. if [ -z "$1" ]
  16. then
  17. echo "No package name supplied"
  18. exit 1
  19. fi
  20. if [ -z "$2" ]
  21. then
  22. echo "No install location supplied"
  23. exit 1
  24. fi
  25. PACKAGE_NAME=$1
  26. INSTALL_LOCATION=$2
  27. if [ ! -f "$PACKAGE_NAME" ]; then
  28. echo "Error $PACKAGE_NAME must be built first"
  29. exit 1
  30. fi
  31. echo Installing $PACKAGE_NAME to $INSTALL_LOCATION
  32. cp $PACKAGE_NAME $INSTALL_LOCATION