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.

127 lines
3.6 KiB

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