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