dpkg (1.18.25) stretch; urgency=medium
[dpkg] / dselect / methods / floppy / update
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 '
29First I need the disk(s) which contain the Packages file(s) for
30the parts of the archive you wish to be able to install. If you
31want to install packages from the non-free and contrib areas of
32the FTP site you need a floppy with a Packages file for each of
33those, in addition to the main Packages file for the main Debian
34distribution. If you don'\''t then you just need one Packages file.'
35}
36
37help
38
39xit=1
40trap '
41 if [ -n "$umount" ]
42 then
43 umount "$umount"
44 fi
45 exit $xit
46' 0
47
48tryupdate () {
49 if [ $success = 1 ]; then return; fi
50 if [ ! -f "$mountpoint/Packages" ]; then
51 echo "$mountpoint/Packages does not exist.";
52 return
53 fi
54 if dpkg --admindir $vardir --merge-avail "$mountpoint/Packages"
55 then
56 success=1
57 echo '
58You may incorporate another Packages file from another floppy if you wish.'
59 fi
60}
61
62while [ $xit = 1 ]
63do
64 echo -n '
65Insert a disk containing a Packages file, or type q to quit. '
66 read response
67 case "$response" in
68 [Qq] | [Qq][Uu][Ii][Tt] )
69 xit=0
70 ;;
71 * )
72 umount="$defaultfloppy"
73 if mount -rt "$defaultfstype" "$defaultfloppy" "$mountpoint"
74 then
75 success=0
76 tryupdate Packages
77 tryupdate packages
78 tryupdate PACKAGES
79 umount "$defaultfloppy"
80 fi
81 umount=""
82 ;;
83 esac
84done
85
86echo '
87OK, continuing with installation.'
88
89xit=0