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.
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.
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/>.
21 cd "$vardir/methods/disk"
29 umount "$umount" >/dev/null 2>&1
34 if [ -n "$p_blockdev" ]
36 umount="$p_mountpoint"
37 mount -rt "$p_fstype" -o nosuid,nodev "$p_blockdev" "$p_mountpoint"
42 umount="$p_mountpoint"
43 mount -rt nfs "$p_nfs" -o nosuid,nodev "$p_mountpoint"
46 predep="$vardir/predep-package"
50 dpkg --admindir "$vardir" --predep-package >"$predep"
53 if test $rc = 1; then break; fi
57 ($binaryprefix,$predep) = @ARGV;
58 $binaryprefix =~ s,/*$,/, if length($binaryprefix);
59 open(P, "< $predep") or die "cannot open $predep: $!\n";
62 $package= $_ if s/^Package: //i;
63 @filename= split(/ /,$_) if s/^Filename: //i;
64 @msdosfilename= split(/ /,$_) if s/^MSDOS-Filename: //i;
66 die "internal error - no package" if length($package) == 0;
67 die "internal error - no filename" if not @filename;
68 die "internal error - mismatch >@filename< >@msdosfilename<"
69 if @filename && @msdosfilename &&
70 @filename != @msdosfilename;
72 for ($i=0; $i<=$#filename; $i++) {
74 print "Looking for part $ppart of $package ... ";
75 if (-f "$binaryprefix$filename[$i]") {
76 $print= $filename[$i];
77 $invoke= "$binaryprefix$filename[$i]";
78 } elsif (-f "$binaryprefix$msdosfilename[$i]") {
79 $print= $msdosfilename[$i];
80 $invoke= "$binaryprefix$msdosfilename[$i]";
82 $base= $filename[$i]; $base =~ s,.*/,,;
83 $msdosbase= $msdosfilename[$i]; $msdosbase =~ s,.*/,,;
86 die "failed to fork for find: $!\n";
90 length($binaryprefix) ?
92 "-name",$base,"-o","-name",$msdosbase);
93 die "failed to exec find: $!\n";
95 while (chop($invoke= <X>)) { last if -f $invoke; }
97 if (substr($print,0,length($binaryprefix)+1) eq
99 $print= substr($print,length($binaryprefix));
102 if (!length($invoke)) {
105 Oh dear, I need to install or upgrade $package, but I don'\''t see
106 the appropriate file(s) anywhere. I'\''m expecting version $version or
107 later, as that is listed in the Packages file.
109 Perhaps you downloaded it with an unexpected name, or something.
110 In any case, you must find the file(s) and then either place it with
111 the correct filename(s) (as listed in the Packages file or in
112 $vardir/available) and rerun the installation, or upgrade the
113 package by using '\''dpkg --install --auto-deconfigure'\'' by hand.
119 push(@invoke,$invoke);
121 print "Running dpkg -iB for $package ...\n";
122 exec("dpkg","--admindir",$vardir,"-iB","--",@invoke);
123 die "failed to exec dpkg: $!\n";
124 ' -- "$p_mountpoint$p_main_binary" "$predep"
127 for f in main ctb nf nus lcl
129 eval 'this_binary=$p_'$f'_binary'
130 if [ -z "$this_binary" ]; then continue; fi
131 echo Running dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary"
132 dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary"
135 echo -n 'Installation OK. Hit RETURN. '