floppy.install 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/sh
  2. set -e
  3. vardir="$1"
  4. method=$2
  5. option=$3
  6. cd "$vardir/methods/floppy"
  7. mountpoint="$vardir/methods/mnt"
  8. . ./shvar.$option
  9. help () {
  10. echo '
  11. Now I need the disks containing the packages to be installed.
  12. I shall keep telling you what is left to be done, in case that
  13. is helpful deciding which floppy to use.'
  14. }
  15. help
  16. xit=1
  17. trap '
  18. if [ -n "$umount" ]
  19. then
  20. umount "$umount"
  21. fi
  22. exit $xit
  23. ' 0
  24. while [ -z "$goconfigure" ]
  25. do
  26. yet="`dpkg --yet-to-unpack`"
  27. if [ -z "$yet" ]
  28. then
  29. echo '
  30. All packages unpacked, going on to configure them.
  31. '
  32. goconfigure=1
  33. continue
  34. fi
  35. echo '
  36. Packages yet to be unpacked:'
  37. echo "$yet"
  38. dpkg-split -l
  39. echo -n '
  40. Insert a disk containing *.deb files, or type q to quit. '
  41. read response
  42. case "$response" in
  43. [Qq] | [Qq][Uu][Ii][Tt] )
  44. goconfigure=1
  45. ;;
  46. * )
  47. umount="$defaultfloppy"
  48. if mount -rt "$defaultfstype" "$defaultfloppy" "$mountpoint"
  49. then
  50. echo
  51. dpkg --unpack -GROEB "$mountpoint" || true
  52. umount "$defaultfloppy"
  53. fi
  54. umount=""
  55. ;;
  56. esac
  57. done
  58. if ! [ -z "$yet" ]
  59. then
  60. response=""
  61. while [ -z "$response" ]
  62. do
  63. echo -n '
  64. Not all the packages have yet been unpacked. Shall I try to
  65. proceed with configuration anyay ? If any of the packages which
  66. have been unpacked so far depend on any that haven'\''t then you'\''ll
  67. see error messages; on the other hand if you say no those packages that
  68. could have been configured will not be. (y/n) '
  69. read response
  70. case "$response" in
  71. [Nn]* )
  72. echo '
  73. OK. Be sure to come back to this, because unpacked-but-not-configured
  74. packages are not in general useable. Alternatively, use the Configure
  75. option on the dselect menu.
  76. '
  77. exit 1
  78. ;;
  79. [Yy]* )
  80. ;;
  81. * )
  82. response=""
  83. ;;
  84. esac
  85. done
  86. fi
  87. dpkg --configure --pending
  88. xit=0