install 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/sh
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. set -e
  16. vardir="$1"
  17. method=$2
  18. option=$3
  19. cd "$vardir/methods/floppy"
  20. mountpoint="$vardir/methods/mnt"
  21. . ./shvar.$option
  22. help () {
  23. echo '
  24. Now I need the disks containing the packages to be installed.
  25. I shall keep telling you what is left to be done, in case that
  26. is helpful deciding which floppy to use.'
  27. }
  28. help
  29. xit=1
  30. trap '
  31. if [ -n "$umount" ]
  32. then
  33. umount "$umount"
  34. fi
  35. exit $xit
  36. ' 0
  37. while [ -z "$goconfigure" ]
  38. do
  39. yet="`dpkg --admindir $vardir --yet-to-unpack`"
  40. if [ -z "$yet" ]
  41. then
  42. echo '
  43. All packages unpacked, going on to configure them.
  44. '
  45. goconfigure=1
  46. continue
  47. fi
  48. echo '
  49. Packages yet to be unpacked:'
  50. echo "$yet"
  51. dpkg-split -l
  52. echo -n '
  53. Insert a disk containing *.deb files, or type q to quit. '
  54. read response
  55. case "$response" in
  56. [Qq] | [Qq][Uu][Ii][Tt] )
  57. goconfigure=1
  58. ;;
  59. * )
  60. umount="$defaultfloppy"
  61. if mount -rt "$defaultfstype" "$defaultfloppy" "$mountpoint"
  62. then
  63. echo
  64. dpkg --admindir $vardir --unpack -GROEB "$mountpoint" || true
  65. umount "$defaultfloppy"
  66. fi
  67. umount=""
  68. ;;
  69. esac
  70. done
  71. if ! [ -z "$yet" ]
  72. then
  73. response=""
  74. while [ -z "$response" ]
  75. do
  76. echo -n '
  77. Not all the packages have yet been unpacked. Shall I try to
  78. proceed with configuration anyay ? If any of the packages which
  79. have been unpacked so far depend on any that haven'\''t then you'\''ll
  80. see error messages; on the other hand if you say no those packages that
  81. could have been configured will not be. (y/n) '
  82. read response
  83. case "$response" in
  84. [Nn]* )
  85. echo '
  86. OK. Be sure to come back to this, because unpacked-but-not-configured
  87. packages are not in general useable. Alternatively, use the Configure
  88. option on the dselect menu.
  89. '
  90. exit 1
  91. ;;
  92. [Yy]* )
  93. ;;
  94. * )
  95. response=""
  96. ;;
  97. esac
  98. done
  99. fi
  100. dpkg --admindir $vardir --configure --pending
  101. xit=0