OpenSDE Packages Database (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.

128 lines
3.6 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../stone/stone_mod_packages.sh
  5. # Copyright (C) 2008 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. # Copyright (C) 1998 - 2003 Clifford Wolf
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. #
  17. # [MAIN] 90 packages Package Management (Install, Update and Remove)
  18. if [ -n "$ROCK_INSTALL_SOURCE_DEV" ] ; then
  19. dev="$ROCK_INSTALL_SOURCE_DEV"
  20. dir="/mnt/source" ; root="/mnt/target"
  21. gasguiopt="-F"
  22. SDECFG_SHORTID="Automatically choose first"
  23. elif [ -n "$ROCK_INSTALL_SOURCE_URL" ] ; then
  24. dev="NETWORK INSTALL"
  25. dir="$ROCK_INSTALL_SOURCE_URL" ; root="/mnt/target"
  26. gasguiopt="-F"
  27. SDECFG_SHORTID="$( grep '^export SDECFG_SHORTID=' \
  28. /etc/SDE-CONFIG/config 2> /dev/null | cut -f2- -d= )"
  29. SDECFG_SHORTID="${SDECFG_SHORTID//\'/}"
  30. else
  31. dev="/dev/cdrom"
  32. dir="/mnt/cdrom" ; root="/"
  33. gasguiopt=
  34. SDECFG_SHORTID="$( grep '^export SDECFG_SHORTID=' \
  35. /etc/SDE-CONFIG/config 2> /dev/null | cut -f2- -d= )"
  36. SDECFG_SHORTID="${SDECFG_SHORTID//\'/}"
  37. fi
  38. read_ids() {
  39. mnt="`mktemp`"
  40. rm -f $mnt ; mkdir $mnt
  41. cmd="$cmd '' ''"
  42. if mount $opt $dev $mnt ; then
  43. for x in `cd $mnt; ls -d */{,TOOLCHAIN/}pkgs 2> /dev/null | sed -e 's,/pkgs$,,'`
  44. do
  45. cmd="$cmd '$x' 'SDECFG_SHORTID=\"$x\"'"
  46. done
  47. umount $mnt
  48. else
  49. cmd="$cmd 'The medium could not be mounted!' ''"
  50. fi
  51. rmdir $mnt
  52. }
  53. startgas() {
  54. [ -z "$( cd $dir; ls )" ] && mount $opt -v -o ro $dev $dir
  55. if [ "$SDECFG_SHORTID" = "Automatically choose first" ]; then
  56. SDECFG_SHORTID="$( cd $dir; ls -d */{,TOOLCHAIN/}pkgs 2> /dev/null | \
  57. sed -e 's,/pkgs$,,' | head -n 1 )"
  58. echo "Using Config-ID <${SDECFG_SHORTID:-None}> .."
  59. fi
  60. if [ $startgas = 1 ] ; then
  61. echo
  62. echo "Running: gasgui $gasguiopt \\"
  63. echo " -c '$SDECFG_SHORTID' \\"
  64. echo " -t '$root' \\"
  65. echo " -d '$dev' \\"
  66. echo " -s '$dir'"
  67. echo
  68. gasgui $gasguiopt -c "$SDECFG_SHORTID" -t "$root" -d "$dev" -s "$dir"
  69. elif [ $startgas = 2 ] ; then
  70. echo
  71. echo "Running: stone gas main \\"
  72. echo " '$SDECFG_SHORTID' \\"
  73. echo " '$root' \\"
  74. echo " '$dev' \\"
  75. echo " '$dir'"
  76. $STONE gas main "$SDECFG_SHORTID" "$root" "$dev" "$dir"
  77. fi
  78. }
  79. main() {
  80. local startgas=0
  81. while : ; do
  82. cmd="gui_menu packages 'Package Management
  83. Note: You can install, update and remove packages (as well as query
  84. package information) with the command-line tool \"mine\". This is just
  85. a simple frontend for the \"mine\" program.'"
  86. cmd="$cmd 'Mount Options: $opt'"
  87. cmd="$cmd 'gui_input \"Mount Options (e.g. -s -o sync) \" \"\$opt\" opt'"
  88. cmd="$cmd 'Source Device: $dev'"
  89. cmd="$cmd 'gui_input \"Source Device\" \"\$dev\" dev'"
  90. cmd="$cmd 'Mountpoint: $dir'"
  91. cmd="$cmd 'gui_input \"Mountpoint\" \"\$dir\" dir'"
  92. cmd="$cmd 'Config ID: $SDECFG_SHORTID'"
  93. cmd="$cmd 'gui_input \"Config ID\""
  94. cmd="$cmd \"\$SDECFG_SHORTID\" SDECFG_SHORTID'"
  95. read_ids
  96. cmd="$cmd '' ''"
  97. type -p gasgui > /dev/null &&
  98. cmd="$cmd 'Start gasgui Package Manager (recommended)' 'startgas=1'"
  99. cmd="$cmd 'Start gastone Package manager (minimal)' 'startgas=2'"
  100. if eval "$cmd" ; then
  101. if [ $startgas != 0 ]; then
  102. startgas $startgas
  103. break
  104. fi
  105. else
  106. break
  107. fi
  108. done
  109. }