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"
25 if [ -z "$p_main_packages" ] && [ -z "$p_ctb_packages" ] && \
26 [ -z "$p_nf_packages" ] && [ -z "$p_nus_packages " ] && \
27 [ -z "$p_lcl_packages" ]
30 No Packages files available, cannot update available packages list.
31 Hit RETURN to continue. '
38 rm -f packages-main packages-ctb packages-nf packages-nus packages-lcl
41 umount "$umount" >/dev/null 2>&1
46 if [ -n "$p_blockdev" ]
48 umount="$p_mountpoint"
49 mount -rt "$p_fstype" -o nosuid,nodev "$p_blockdev" "$p_mountpoint"
54 umount="$p_mountpoint"
55 mount -rt nfs "$p_nfs" -o nosuid,nodev "$p_mountpoint"
60 for f in main ctb nf nus lcl
62 eval 'this_packages=$p_'$f'_packages'
63 case "$this_packages" in
68 eval 'this_binary=$p_'$f'_binary'
69 if [ -z "$this_binary" ]; then continue; fi
70 if [ "$updatetype" = update ]
72 dpkg --admindir $vardir --clear-avail
75 echo Running dpkg --record-avail -R "$p_mountpoint$this_binary"
76 dpkg --admindir $vardir --record-avail -R "$p_mountpoint$this_binary"
79 packagesfile="$p_mountpoint$this_packages"
80 case "$packagesfile" in
81 *.gz | *.Z | *.GZ | *.z)
82 echo -n "Uncompressing $packagesfile ... "
83 zcat <"$packagesfile" >packages-$f
85 dpkg --admindir $vardir --$updatetype-avail packages-$f
91 dpkg --admindir $vardir --$updatetype-avail "$packagesfile"
99 echo -n 'Update OK. Hit RETURN. '