Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
PK9Z[ֹ00 apt/setupnuW+A#!/usr/bin/perl -w # -*- Mode: Perl -*- # setup.pl --- # Author : Manoj Srivastava ( srivasta@tiamat.datasync.com ) # Created On : Wed Mar 4 15:11:47 1998 # Created On Node : tiamat.datasync.com # Last Modified By : Manoj Srivastava # Last Modified On : Tue May 19 11:25:32 1998 # Last Machine Used: tiamat.datasync.com # Update Count : 87 # Status : Unknown, Use with caution! # HISTORY : # Description : # This file is designed to go into /usr/lib/apt/methods/setup # #use strict; #use diagnostics; #printf STDERR "DEBUG: Arguments $ARGV[0];$ARGV[1];$ARGV[2];\n"; # Handle the arguments my $vardir=$ARGV[0]; my $method=$ARGV[1]; my $option=$ARGV[2]; my $config_file = '/etc/apt/sources.list'; my $boldon=`setterm -bold on`; my $boldoff=`setterm -bold off`; my @known_types = ('deb'); my @known_access = ('http', 'ftp', 'file'); my @typical_distributions = ('stable', 'unstable', 'testing', 'non-US'); my @typical_components = ('main', 'contrib', 'non-free'); my %known_access = map {($_,$_)} @known_access; my %typical_distributions = map {($_,$_)} @typical_distributions; # Read the config file, creating source records sub read_config { my %params = @_; my @Config = (); die "Required parameter Filename Missing" unless $params{'Filename'}; open (CONFIG, "$params{'Filename'}") || die "Could not open $params{'Filename'}: $!"; while () { chomp; my $rec = {}; my ($type, $urn, $distribution, $components) = m/^\s*(\S+)\s+(\S+)\s+(\S+)\s*(?:\s+(\S.*))?$/o; $rec->{'Type'} = $type; $rec->{'URN'} = $urn; $rec->{'Distribution'} = $distribution; $rec->{'Components'} = $components; push @Config, $rec; } close(CONFIG); return @Config; } # write the config file; writing out the current set of source records sub write_config { my %params = @_; my $rec; my %Seen = (); die "Required parameter Filename Missing" unless $params{'Filename'}; die "Required parameter Config Missing" unless $params{'Config'}; open (CONFIG, ">$params{'Filename'}") || die "Could not open $params{'Filename'} for writing: $!"; for $rec (@{$params{'Config'}}) { my $line = "$rec->{'Type'} $rec->{'URN'} $rec->{'Distribution'} "; $line .= "$rec->{'Components'}" if $rec->{'Components'}; $line .= "\n"; print CONFIG $line unless $Seen{$line}++; } close(CONFIG); } # write the config file; writing out the current set of source records sub print_config { my %params = @_; my $rec; my %Seen = (); die "Required parameter Config Missing" unless $params{'Config'}; for $rec (@{$params{'Config'}}) { next unless $rec; my $line = "$rec->{'Type'} " if $rec->{'Type'}; $line .= "$rec->{'URN'} " if $rec->{'URN'}; $line .= "$rec->{'Distribution'} " if $rec->{'Distribution'}; $line .= "$rec->{'Components'}" if $rec->{'Components'}; $line .= "\n"; print $line unless $Seen{$line}++; } } # Ask for and add a source record sub get_source { my %params = @_; my $rec = {}; my $answer; my ($type, $urn, $distribution, $components); if ($params{'Default'}) { ($type, $urn, $distribution, $components) = $params{'Default'} =~ m/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S.*)$/o; } $type = 'deb'; $urn = "http://http.us.debian.org/debian" unless $urn; $distribution = "stable" unless $distribution; $components = "main contrib non-free" unless $components; $rec->{'Type'} = 'deb'; $| = 1; my $done = 0; while (!$done) { print "\n"; print "$boldon URL [$urn]: $boldoff"; $answer=; chomp ($answer); $answer =~ s/\s*//og; if ($answer =~ /^\s*$/o) { $rec->{'URN'} = $urn; last; } else { my ($scheme) = $answer =~ /^\s*([^:]+):/o; if (! defined $known_access{$scheme}) { print "Unknown access scheme $scheme in $answer\n"; print " The available access methods known to me are\n"; print join (' ', @known_access), "\n"; print "\n"; } else { $rec->{'URN'} = $answer; last; } } } print "\n"; print " Please give the distribution tag to get or a path to the\n"; print " package file ending in a /. The distribution\n"; print " tags are typically something like:$boldon "; print join(' ', @typical_distributions), "$boldoff\n"; print "\n"; print "$boldon Distribution [$distribution]:$boldoff "; $answer=; chomp ($answer); $answer =~ s/\s*//og; if ($answer =~ /^\s*$/o) { $rec->{'Distribution'} = $distribution; $rec->{'Components'} = &get_components($components); } elsif ($answer =~ m|/$|o) { $rec->{'Distribution'} = "$answer"; $rec->{'Components'} = ""; } else { # A distribution tag, eh? warn "$answer does not seem to be a typical distribution tag\n" unless defined $typical_distributions{$answer}; $rec->{'Distribution'} = "$answer"; $rec->{'Components'} = &get_components($components); } return $rec; } sub get_components { my $default = shift; my $answer; print "\n"; print " Please give the components to get\n"; print " The components are typically something like:$boldon "; print join(' ', @typical_components), "$boldoff\n"; print "\n"; print "$boldon Components [$default]:$boldoff "; $answer=; chomp ($answer); $answer =~ s/\s+/ /og; if ($answer =~ /^\s*$/o) { return $default; } else { return $answer; } } sub get_sources { my @Config = (); my $done = 0; my @Oldconfig = (); if (-e $config_file) { @Oldconfig = &read_config('Filename' => $config_file) } print "\t$boldon Set up a list of distribution source locations $boldoff \n"; print "\n"; print " Please give the base URL of the debian distribution.\n"; print " The access schemes I know about are:$boldon "; print join (' ', @known_access), "$boldoff\n"; # print " The mirror scheme is special that it does not specify the\n"; # print " location of a debian archive but specifies the location\n"; # print " of a list of mirrors to use to access the archive.\n"; print "\n"; print " For example:\n"; print " file:/mnt/debian,\n"; print " ftp://ftp.debian.org/debian,\n"; print " http://ftp.de.debian.org/debian,\n"; # print " and the special mirror scheme,\n"; # print " mirror:http://www.debian.org/archivemirrors \n"; print "\n"; my $index = 0; while (!$done) { if ($Oldconfig[$index]) { push (@Config, &get_source('Default' => $Oldconfig[$index++])); } else { push (@Config, &get_source()); } print "\n"; print "$boldon Would you like to add another source?[y/N]$boldoff "; my $answer = ; chomp ($answer); $answer =~ s/\s+/ /og; if ($answer =~ /^\s*$/o) { last; } elsif ($answer !~ m/\s*y/io) { last; } } return @Config; } sub main { if (-e $config_file) { my @Oldconfig = &read_config('Filename' => $config_file); print "$boldon I see you already have a source list.$boldoff\n"; print "-" x 72, "\n"; &print_config('Config' => \@Oldconfig); print "-" x 72, "\n"; print "$boldon Do you wish to overwrite it? [y/N]$boldoff "; my $answer = ; chomp ($answer); $answer =~ s/\s+/ /og; exit 0 unless $answer =~ m/\s*y/io; } # OK. They want to be here. my @Config = &get_sources(); #&print_config('Config' => \@Config); &write_config('Config' => \@Config, 'Filename' => $config_file); } &main(); PK9Z[ L'' apt/namesnuW+A70 apt APT Acquisition [file,http,ftp] PK9Z[A:77 apt/desc.aptnuW+AThe APT installation method encompasses most other installation methods under the umbrella of the new Package Acquisition code. This method allows installation from locations in the filesystem, ftp and http URLs, supports full installation ordering and dependency checking as well as multiple sources. See the man pages apt-get(8) and sources.list(5) HTTP proxies can be used by setting http_proxy="http://proxy:port/" before running DSelect. FTP proxies require special configuration detailed in the apt.conf(5) man page (see /usr/share/doc/apt/examples/apt.conf) PK9Z[-SX apt/updatenuW+A#!/bin/bash set -e # Set the textdomain for the translations using $"..." TEXTDOMAIN="apt" # Get the configuration from /etc/apt/apt.conf CLEAN="prompt" OPTS="-f" APTGET="/usr/bin/apt-get" APTCACHE="/usr/bin/apt-cache" DPKG="/usr/bin/dpkg" DPKG_OPTS="--admindir=$1" APT_OPT0="-oDir::State::status=$1/status" APT_OPT1="-oDPkg::Options::=$DPKG_OPTS" CACHEDIR="/var/cache/apt" PROMPT="false" RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::UpdateOptions \ DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \ APTCACHE Dir::Bin::apt-cache/f CACHEDIR Dir::Cache/d \ PROMPT DSelect::PromptAfterUpdate/b` eval $RES # It looks slightly ugly to have a double / in the dpkg output CACHEDIR=`echo $CACHEDIR | sed -e "s|/$||"` STATUS=1 if $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" update then echo $"Merging available information" rm -f $CACHEDIR/available $APTCACHE dumpavail > $CACHEDIR/available $DPKG "$DPKG_OPTS" --update-avail $CACHEDIR/available rm -f $CACHEDIR/available case "$CLEAN" in Pre-Auto|PreAuto|pre-auto) $APTGET "$APT_OPT0" "$APT_OPT1" autoclean;; esac STATUS=0 fi if [ x$PROMPT = "xtrue" ]; then echo $"Press enter to continue." && read RES; fi exit $STATUS PK9Z[2 apt/installnuW+A#!/bin/bash # Set the textdomain for the translations using $"..." TEXTDOMAIN="apt" # Get the configuration from /etc/apt/apt.conf CLEAN="prompt" OPTS="-f" APTGET="/usr/bin/apt-get" DPKG="/usr/bin/dpkg" DPKG_OPTS="--admindir=$1" APT_OPT0="-oDir::State::status=$1/status" APT_OPT1="-oDPkg::Options::=$DPKG_OPTS" set -e RES=$(apt-config shell CLEAN DSelect::Clean OPTS DSelect::Options \ DPKG Dir::Bin::dpkg/f APTGET Dir::Bin::apt-get/f \ ARCHIVES Dir::Cache::Archives/d \ WAIT DSelect::WaitAfterDownload/b \ CHECKDIR DSelect::CheckDir/b) eval $RES set +e # Yes/No Prompter yesno() { # $1 = prompt # $2 = default(y) local ans def defp if [ "$2" ];then case $2 in Y|y) defp="[Y/n]" def=y;; N|n) defp="[y/N]" def=n;; *) echo $"Bad default setting!" 1>&2; exit 1;; esac else defp="[y/N]" def=n fi while :;do echo -n "$1 $defp " 1>&3 read ans case $ans in Y|y|N|n) break;; "") ans=$def;break;; esac echo done echo $ans | tr YN yn } if [ "$WAIT" = "true" ]; then $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" -d dselect-upgrade echo $"Press enter to continue." && read RES $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade RES=$? else $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade RES=$? fi # 1 means the user choose no at the prompt if [ $RES -eq 1 ]; then exit 0 fi # Finished OK if [ $RES -eq 0 ]; then if [ $(ls $ARCHIVES $ARCHIVES/partial | egrep -v "^lock$|^partial$" | wc -l) \ -eq 0 ]; then exit 0 fi NEWLS=$(ls -ld $ARCHIVES) if [ "$CHECKDIR" = "true" ]; then if [ "$OLDLS" = "$NEWLS" ]; then exit 0 fi fi # Check the cleaning mode case $(echo $CLEAN | tr '[:upper:]' '[:lower:]') in auto) $APTGET "$APT_OPT0" "$APT_OPT1" autoclean && echo $"Press enter to continue." && read RES && exit 0; ;; always) $APTGET "$APT_OPT0" "$APT_OPT1" clean && echo $"Press enter to continue." && read RES && exit 0; ;; prompt) exec 3>&1 echo -n $"Do you want to erase any previously downloaded .deb files?" if [ $(yesno "" y) = y ]; then $APTGET "$APT_OPT0" "$APT_OPT1" clean && echo $"Press enter to continue." && read RES && exit 0; fi ;; *) ;; esac else echo $"Some errors occurred while unpacking. Packages that were installed" echo $"will be configured. This may result in duplicate errors" echo $"or errors caused by missing dependencies. This is OK, only the errors" echo $"above this message are important. Please fix them and run [I]nstall again" echo $"Press enter to continue." read RES && $DPKG "$DPKG_OPTS" --configure -a exit 100 fi exit $? PK9Z[E,disk/desc.cdromnuW+AInstallation from a CD-ROM containing a Debian distribution. The CD-ROM may be or not be mounted already; it should contain a standard ISO9660 CD-ROM filesystem. PK9Z[o disk/desc.nfsnuW+AInstallation across the network, from an NFS server which not currently mounted. The server should have contain the Packages.gz file from each distribution area being installed (usually stable, contrib and non-free) as well as the corresponding binary/*/*.deb files. The easiest way for them to get this is to make a (partial) copy of the distribution site's directory hierarchy, if possible. PK9Z[k0disk/desc.harddisknuW+AInstallation from filesystem on a hard disk partition that's not currently mounted. The partition should contain the Packages.gz file from each distribution area being installed (usually stable, contrib and non-free) as well as the corresponding binary/*/*.deb files. The easiest way to get this is to make a (partial) copy of the distribution site's directory hierarchy, if possible. PK9Z[}Y9Y9 disk/setupnuW+A#!/bin/sh set -e vardir="$1" method=$2 option=$3 cd "$vardir/methods/disk" tp=/var/run/ddm$$ iarch=`dpkg --admindir $vardir --print-architecture` xit=1 trap ' rm -f $tp.? if [ -n "$umount" ] then umount "$umount" >/dev/null 2>&1 fi exit $xit ' 0 if ls -d "$tp.?" >/dev/null 2>&1 then rm $tp.? fi yesno () { while true do echo -n "$2 [$1] " read response if [ -z "$response" ] then response="$1" fi case "$response" in [Nn]*) yesno=no ; return ;; [Yy]*) yesno=yes ; return ;; esac done } print_partition_table() { device="$1" printf "p\nq\n" | fdisk "$device" 2>/dev/null } getblockdev () { mountpoint="$vardir/methods/mnt" if [ -z "$defaultdevice" ] then defaultdevice="$newdefaultdevice" elif [ "$defaultdevice" != "$newdefaultdevice" ] then echo \ "Last time you specified installation from $defaultdevice." fi promptstring="$1" while [ -z "$blockdevice" ] do echo -n "$promptstring [$defaultdevice]: " read response if [ -z "$response" ] then response="$defaultdevice" fi if ! [ -b "$response" ] then echo "$response is not a block device."; continue fi tryblockdevice="$response" if [ $option = cdrom ] then fstype=iso9660 elif [ $option = harddisk ] then blockbase="`echo \"$tryblockdevice\" | sed -e 's/[0-9]\{1,\}$//'`" set +e print_partition_table "$blockbase" >$tp.f set -e proposeddevice="$tryblockdevice" perl -ne ' next unless /^ *Device +Boot +Start +End +Blocks +Id +System *$/i .. !/\S/; next unless s:^/\S+:: && $& eq $ENV{"proposeddevice"}; next unless s/^ +(\* +)?\d+ +\d+ +\d+\+? +//; next unless m/^([0-9a-f]{1,2}) /i; %types= ( "1","msdos", "4","msdos", "6","msdos", "7","hpfs", "80","minix", "81","minix", "83","ext2" ); print $types{$1}; exit(0); ' <$tp.f >$tp.m defaultfstype="`cat $tp.m`" if [ -n "$defaultfstype" ] then cat </dev/null then echo \ "Your kernel does not appear to support that filesystem type." defaultfstype="" fi fi echo -n "Supported filesystems: " sed -e 's/^.* / /' /proc/filesystems | tr '\n' ' ' echo -n " Enter filesystem type (for $tryblockdevice) [$defaultfstype]: " read fstype if [ -z "$fstype" ] then fstype="$defaultfstype" fi fi umount="$mountpoint" if mount -rt "$fstype" -o nosuid,nodev "$tryblockdevice" "$mountpoint" then echo blockdevice="$tryblockdevice" else umount="" echo \ "Unable to mount $tryblockdevice on $mountpoint, type $fstype." fi done } outputparam () { echo "$2" | sed -e "s/'/'\\\\''/; s/^/$1='/; s/$/'/" >&3 } intrkey="`stty -a | sed -n 's/.*intr = \([^;]*\);.*/\1/p'`" echo " If you make a mistake, use the interrupt key ($intrkey) to abort. " # State variables, `best first' # {main,ctb,nf,nus,lcl}_{packages,binary} # Empty before we've found them or if they're not available, # set to the relevant bit under mountpoint otherwise. # hierbase # A directory containing a Debian FTP site mirror tree for ONE distribution. # eg /pub/debian/dists/stable # mountpoint # The mountpoint for the filesystem containing the stuff # empty or unset if we don't know yet, or if we haven't mounted anything; # may also be empty if `directory' was set. # blockdevice # The actual block device to mount. # fstype # The filesystem type to use. # defaultdevice # The default block device to mount. if [ -f shvar.$option ] then . ./shvar.$option defaultdevice="$p_blockdev" defaultnfsserver="$p_nfsserver" defaultnfsrempath="$p_nfsrempath" fi if [ $option = cdrom ] then mount >$tp.m sed -n 's/ ([^)]*)$//; s/^[^ ]* on //; s/ type iso9660$//p' <$tp.m >$tp.l ncdroms=`wc -l <$tp.l` if [ $ncdroms -gt 1 ] then response="" while [ -z "$response" ] do echo \ 'Several CD-ROMs (or other ISO9660 filesystems) are mounted:' grep 'type iso9660 ([^)]*)$' <$tp.m | nl echo -n \ 'Is it any of these ? Type a number, or `n'\'' for none. ' read response response="`echo \"$response\" | sed -e 's/[ ]*$//'`" if expr "$response" : '[0-9][0-9]*$' >/dev/null && \ [ $response -ge 1 ] && [ $response -le $ncdroms ] then mountpoint="`sed -n $response'p' <$tp.l`" echo elif expr "$response" : '[Nn]' >/dev/null then mountpoint="" else response="" fi done elif [ $ncdroms = 1 ] then mountpoint="`cat $tp.l`" perl -ne 'print if s/ type iso9660 \([^)]*\)$// && s/ on .*$//;' \ <$tp.m >$tp.d blockdevice="`cat $tp.d`" yesno yes \ "I see a CD-ROM: $blockdevice, mounted on $mountpoint. Is it the right one ?" if [ $yesno = no ] then echo 'Unmounting it ...' umount="$mountpoint" while true do echo -n \ 'Please insert the right disc, and hit return: ' read response if mount -rt iso9660 -o nosuid,nodev \ "$blockdevice" "$mountpoint" then echo break fi done fi fi if [ -z "$mountpoint" ] then if [ -b /dev/cdrom ] then echo \ 'I see that /dev/cdrom exists and is a block device.' newdefaultdevice=/dev/cdrom fi getblockdev 'Insert the CD-ROM and enter the block device name' fi fi if [ $option = nfs ] then mountpoint="$vardir/methods/mnt" while [ -z "$nfsserver" ] do echo -n \ "What is the name of the NFS server ? [$defaultnfsserver] " read response if [ -z "$response" ] && [ -n "$defaultnfsserver" ] then response="$defaultnfsserver" fi if [ -z "$response" ]; then continue; fi if [ -x /usr/bin/rpcinfo ] then if rpcinfo -u "$response" mountd | grep -q 'ready' then nfsserver="$response" else echo "$response appears not to be an NFS server." fi elif [ -x /bin/ping ] then if ping -q -c 1 "$response" | grep -q ', 1 packets received' then nfsserver="$response" else echo "$response appears to be down or nonexistent." fi else echo \ "(I can't check that now because there is no /usr/bin/rpcinfo or /bin/ping.)" nfsserver="$response" fi done while [ -z "$nfsrempath" ] do echo -n " What is the pathname on the NFS server of the filesystem with the Debian files? [$defaultnfsrempath] " read response if [ -z "$response" ] && [ -n "$defaultnfsrempath" ] then response="$defaultnfsrempath" else response="`echo \"$response\" | sed -e 's:/$::; s:^/*:/:'`" fi umount="$mountpoint" if mount -rt nfs -o nosuid,nodev "$nfsserver:$response" "$mountpoint" then echo nfsrempath="$response" else umount="" echo \ "Unable to mount NFS filesystem $nfsserver:$response." fi done nfs="$nfsserver:$nfsrempath" fi if [ $option = harddisk ] then set +e print_partition_table /dev/hda >$tp.f if [ $? != 0 ] then print_partition_table /dev/sda >$tp.f fi set -e perl -ne ' next unless /^ *Device +Boot +Start +End +Blocks +Id +System *$/i .. !/\S/; next unless / [146] +DOS \d+-bit \S+$/; next unless m:^/\S+:; print $&; ' <$tp.f >$tp.d newdefaultdevice="`cat $tp.d`" echo " I need to know which disk partition contains the distribution files; disk partitions are specified by the block device name in Linux." if [ -n "$newdefaultdevice" ] then echo \ "By the way, $newdefaultdevice looks like a DOS partition." fi getblockdev "Enter the partition's block device name" fi if [ -n "$mountpoint" ] then # We must have $mountpoint if [ $option = cdrom ] then echo \ 'All directory names should be entered relative to the root of the CD-ROM. ' elif [ $option = nfs ] then echo \ "All directory names should be entered relative to the root of the NFS filesystem, ie relative to $nfsrempath on the server. " else echo \ "All directory names should be entered relative to the root of the $fstype filesystem on $blockdevice. " fi fi while true do if [ $option = cdrom ] then echo \ "I would like to know where on the CD-ROM the top level of the Debian distribution is (eg. 'dists/stable') - this directory usually contains the Packages-Master file. If the CD-ROM is badly organised and doesn't have a straightforward copy of the distribution you may answer \`none' and we'll go through the parts I need individually." else echo \ "In order to make it easy for me to find the relevant files I'd ideally like to install from a straightforward copy of the Debian distribution. To use this I'll need to know where the top level of that copy of the distribution is (eg. 'debian/dists/stable') - this directory usually contains the Packages-Master file. If you do not have a straightforward copy of the distribution available just answer \`none' and we'll go through the parts I need individually." fi defhierbase=none # maybe ask for debian/dists and then show and ask for available dists # eg. {stable,frozen,unstable,bo,hamm,slink} if [ -n "$p_hierbase" ] then if [ -d "$mountpoint/$p_hierbase/main/binary-$iarch" ] then echo " Last time you said \`$p_hierbase', and that looks plausible." defhierbase="$p_hierbase" else echo " Last time you said \`$p_hierbase', but that doesn't look plausible, since \`$p_hierbase/main/binary-$iarch' doesn't seem to exist." fi fi if [ none = "$defhierbase" ] then if [ -d "$mountpoint/debian/dists/stable/main/binary-$iarch" ] then echo " \`/debian/dists/stable' exists and looks plausible, so that's the default." defhierbase=/debian/dists/stable elif [ -d "$mountpoint/dists/stable/main/binary-$iarch" ] then echo " \`/dists/stable' exists and looks plausible, so that's the default." defhierbase=/dists/stable fi fi echo -n \ "Distribution top level ? [$defhierbase] " read response if [ -z "$response" ] then response="$defhierbase" fi if [ none = "$response" ] then hierbase="" break elif [ -d "$mountpoint/$response/main/binary-$iarch" ] then hierbase="`echo \"$response\" | sed -e 's:/*$::; s:^/*:/:'`" break fi echo \ "$response/main/binary-$iarch does not exist. " done case "$hierbase" in /* ) ;; '' ) ;; * ) hierbase="/$hierbase" ;; esac check_binary () { # args: area-in-messages directory # eg: main "$hierbase/main/binary-$iarch" # checks wether $2 contains *.deb if ! [ -d "$mountpoint$2/" ] then echo "\`$2' does not exist." return fi if ! ( find -L "$mountpoint$2/" -name '*.deb' -print \ | head -n 1 ) 2>/dev/null | grep . >/dev/null then echo "\`$2' does not contain any *.deb packages. Hmmpf." return fi echo "Using \`$2' as $1 binary dir." this_binary="$2" } find_area () { # args: area-in-messages area-in-vars subdirectory-in-hier # last-time-binary last-time-packages # eg: main main main # "$p_main_binary" "$p_main_packages" this_binary='' this_packages='' if [ -n "$hierbase" ] then check_binary $1 "$hierbase/$3/binary-$iarch" fi if [ $option = cdrom ] && [ $2 = nf ] && [ -z "$this_binary" ] then echo ' Note: most CD-ROM distributions of Debian do not include programs available in the `non-free'\'' directory of the distribution site. This is because these programs have copyrights that prevent distribution for profit on a CD-ROM - ie they are not free software. If you wish to install these programs you'\''ll have to get them from an alternative source.' elif [ $2 = lcl ] && [ -z "$this_binary" ] then echo ' Note: By default there is no `local'\'' directory. It is intended for packages you made yourself.' fi while [ -z "$this_binary" ] do defaultbinary="$4" echo " Which directory contains the *.deb packages from the $1 distribution area (this directory is named \`$3/binary-$iarch' on the distribution site) ? Say \`none' if this area is not available." if [ $2 != main ] && [ -z "$defaultbinary" ] then defaultbinary=none fi echo -n \ "Enter _$1_ binary dir. [$4] ? " read response if [ -z "$response" ] && [ -n "$defaultbinary" ] then response="$defaultbinary" fi if [ none = "$response" ] then break fi case "$response" in '' | none) continue ;; esac check_binary $1 "`echo \"$response\" | sed -e 's:/$::; s:^/*:/:'`" done if [ -n "$this_binary" ] then for f in Packages.gz packages.gz Packages packages do if [ -f "$mountpoint/$this_binary/$f" ] then echo "Using \`$this_binary/$f' for $1." this_packages="$this_binary/$f" break fi done while [ -z "$this_packages" ] do echo -n " I can't find the $1 \`Packages' file. The information in the \`Packages' file is important for package selection during new installations, and is very useful for upgrades. If you overlooked it when downloading you should do get it now and return to this installation procedure when you have done so: you will find one Packages file and one Packages.gz file -- either will do -- in the \`binary-$iarch' subdirectory of each area on the FTP sites and CD-ROMs. Alternatively (and this will be rather slow) I can scan the packages in the distribution area - say \`scan' if you want me to do so. You need a separate Packages file from each of the distribution areas you wish to install. Where is the _$1_ \`Packages' file (if none is available, say \`none') [$5] ? " read response if [ -z "$response" ] && [ -n "$5" ] then response="$5" fi case "$response" in '') continue ;; none) break ;; scan) this_packages=scan ;; /*) this_packages="$response" ;; *) this_packages="/$response" ;; esac done fi eval $2'_binary="$this_binary"' eval $2'_packages="$this_packages"' } find_area main main main "$p_main_binary" "$p_main_packages" find_area contrib ctb contrib "$p_ctb_binary" "$p_ctb_packages" find_area non-free nf non-free "$p_nf_binary" "$p_nf_packages" find_area non-US nus non-US "$p_nus_binary" "$p_nus_packages" find_area local lcl local "$p_lcl_binary" "$p_lcl_packages" echo -n ' Hit RETURN to continue. ' read response exec 3>shvar.$option.new outputparam p_blockdev "$blockdevice" outputparam p_fstype "$fstype" outputparam p_mountpoint "$mountpoint" outputparam p_nfsserver "$nfsserver" outputparam p_nfsrempath "$nfsrempath" outputparam p_nfs "$nfs" outputparam p_hierbase "$hierbase" outputparam p_main_packages "$main_packages" outputparam p_main_binary "$main_binary" outputparam p_ctb_packages "$ctb_packages" outputparam p_ctb_binary "$ctb_binary" outputparam p_nf_packages "$nf_packages" outputparam p_nf_binary "$nf_binary" outputparam p_nus_packages "$nus_packages" outputparam p_nus_binary "$nus_binary" outputparam p_lcl_packages "$lcl_packages" outputparam p_lcl_binary "$lcl_binary" mv shvar.$option.new shvar.$option xit=0 PK9Z[& disk/namesnuW+A30 cdrom Install from a CD-ROM. 35 nfs Install from an NFS server (not yet mounted). 40 harddisk Install from a hard disk partition (not yet mounted). 42 mounted Install from a filesystem which is already mounted. PK9Z[ ߌdisk/desc.mountednuW+AInstallation from a directory on a filesystem that has already been mounted. If the options available for mounting things automatically are inadequate for your needs you'll need to get a shell command prompt (for example by switching VT using Alt-F or quitting dselect) and use it to mount the filesystem before continuing. The area you're installing from should contain the Packages.gz file from each distribution area being installed (usually stable, contrib and non-free) as well as the corresponding binary/*/*.deb files. The easiest way to do get this is to make a (partial) copy of the distribution site's directory hierarchy, if possible. PK9Z[&n disk/updatenuW+A#!/bin/sh set -e vardir="$1" method=$2 option=$3 cd "$vardir/methods/disk" . ./shvar.$option if [ -z "$p_main_packages" ] && [ -z "$p_ctb_packages" ] && \ [ -z "$p_nf_packages" ] && [ -z "$p_nus_packages " ] && \ [ -z "$p_lcl_packages" ] then echo ' No Packages files available, cannot update available packages list. Hit RETURN to continue. ' read response exit 0 fi xit=1 trap ' rm -f packages-main packages-ctb packages-nf packages-nus packages-lcl if [ -n "$umount" ] then umount "$umount" >/dev/null 2>&1 fi exit $xit ' 0 if [ -n "$p_blockdev" ] then umount="$p_mountpoint" mount -rt "$p_fstype" -o nosuid,nodev "$p_blockdev" "$p_mountpoint" fi if [ -n "$p_nfs" ] then umount="$p_mountpoint" mount -rt nfs "$p_nfs" -o nosuid,nodev "$p_mountpoint" fi updatetype=update for f in main ctb nf nus lcl do eval 'this_packages=$p_'$f'_packages' case "$this_packages" in '') continue ;; scan) eval 'this_binary=$p_'$f'_binary' if [ -z "$this_binary" ]; then continue; fi if [ "$updatetype" = update ] then dpkg --admindir $vardir --clear-avail updatetype=merge fi echo Running dpkg --record-avail -R "$p_mountpoint$this_binary" dpkg --admindir $vardir --record-avail -R "$p_mountpoint$this_binary" ;; *) packagesfile="$p_mountpoint$this_packages" case "$packagesfile" in *.gz | *.Z | *.GZ | *.z) echo -n "Uncompressing $packagesfile ... " zcat <"$packagesfile" >packages-$f echo done. dpkg --admindir $vardir --$updatetype-avail packages-$f updatetype=merge ;; '') ;; *) dpkg --admindir $vardir --$updatetype-avail "$packagesfile" updatetype=merge ;; esac ;; esac done echo -n 'Update OK. Hit RETURN. ' read response xit=0 PK9Z[?g disk/installnuW+A#!/bin/sh set -e vardir="$1" method=$2 option=$3 cd "$vardir/methods/disk" . ./shvar.$option xit=1 trap ' if [ -n "$umount" ] then umount "$umount" >/dev/null 2>&1 fi exit $xit ' 0 if [ -n "$p_blockdev" ] then umount="$p_mountpoint" mount -rt "$p_fstype" -o nosuid,nodev "$p_blockdev" "$p_mountpoint" fi if [ -n "$p_nfs" ] then umount="$p_mountpoint" mount -rt nfs "$p_nfs" -o nosuid,nodev "$p_mountpoint" fi predep="$vardir/predep-package" while true do set +e dpkg --admindir "$vardir" --predep-package >"$predep" rc=$? set -e if test $rc = 1; then break; fi test $rc = 0 perl -e ' ($binaryprefix,$predep) = @ARGV; $binaryprefix =~ s,/*$,/, if length($binaryprefix); open(P,"< $predep") || die "cannot open $predep: $!\n"; while (

) { s/\s*\n$//; $package= $_ if s/^Package: //i; @filename= split(/ /,$_) if s/^Filename: //i; @msdosfilename= split(/ /,$_) if s/^MSDOS-Filename: //i; } length($package) || die "internal error - no package"; @filename || die "internal error - no filename"; @filename==@msdosfilename || !@filename || !@msdosfilename || die "internal error - mismatch >@filename< >@msdosfilename<"; @invoke=(); $|=1; for ($i=0; $i<=$#filename; $i++) { $ppart= $i+1; print "Looking for part $ppart of $package ... "; if (-f "$binaryprefix$filename[$i]") { $print= $filename[$i]; $invoke= "$binaryprefix$filename[$i]"; } elsif (-f "$binaryprefix$msdosfilename[$i]") { $print= $msdosfilename[$i]; $invoke= "$binaryprefix$msdosfilename[$i]"; } else { $base= $filename[$i]; $base =~ s,.*/,,; $msdosbase= $msdosfilename[$i]; $msdosbase =~ s,.*/,,; defined($c= open(X,"-|")) || die "failed to fork for find: $!\n"; if (!$c) { exec("find", "-L", length($binaryprefix) ? $binaryprefix : ".", "-name",$base,"-o","-name",$msdosbase); die "failed to exec find: $!\n"; } while (chop($invoke= )) { last if -f $invoke; } $print= $invoke; if (substr($print,0,length($binaryprefix)+1) eq "$binaryprefix/") { $print= substr($print,length($binaryprefix)); } } if (!length($invoke)) { print STDERR " Oh dear, I need to install or upgrade $package, but I don'\''t see the appropriate file(s) anywhere. I'\''m expecting version $version or later, as that is listed in the Packages file. Perhaps you downloaded it with an unexpected name, or something. In any case, you must find the file(s) and then either place it with the correct filename(s) (as listed in the Packages file or in $vardir/available) and rerun the installation, or upgrade the package by using `dpkg --install --auto-deconfigure'\'' by hand. "; exit(1); } print "$print\n"; push(@invoke,$invoke); } print "Running dpkg -iB for $package ...\n"; exec("dpkg","--admindir",$vardir,"-iB","--",@invoke); die "failed to exec dpkg: $!\n"; ' -- "$p_mountpoint$p_main_binary" "$predep" done for f in main ctb nf nus lcl do eval 'this_binary=$p_'$f'_binary' if [ -z "$this_binary" ]; then continue; fi echo Running dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary" dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary" done echo -n 'Installation OK. Hit RETURN. ' read response xit=0 PK9Z[Lmulticd/desc.multi_nfsnuW+AInstallation across the network, from an NFS server which is not currently mounted. The server should contain the Packages.gz file from each distribution area being installed (usually main, contrib, non-free, local and eventually non-US) as well as the corresponding binary/*/*.deb files. The easiest way for them to get this is to make a (partial) copy of the distribution site's directory hierarchy, if possible. The contents of the mounted directory may change. Thus it's possible to use this method for installations from a CDROM set. PK9Z[v HH multicd/setupnuW+A#!/bin/sh # # The `multicd' package was initially written by Heiko Schlittermann # based on builtin access methods written by Ian # Jackson . The final packaging as well as # cleanups were made by Martin Schulze who also # put this package together for the slink release (Debian GNU/Linux # 2.1). # Copyright © 1995-1998 Ian Jackson # Copyright © 1998 Heiko Schlittermann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 dated June, 1991. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e vardir="$1" method=$2 option=$3 test -d "$vardir/methods/$method" || mkdir "$vardir/methods/$method" cd "$vardir/methods/$method" tp=/tmp/ddm$$ iarch=`dpkg --print-architecture` dist=stable xit=1 trap ' rm -f $tp.? if [ -n "$umount" ] then umount "$umount" >/dev/null 2>&1 fi exit $xit ' 0 if ls -d "$tp.?" >/dev/null 2>&1 then rm $tp.? fi #debug() { echo "DEBUG: $@"; } debug() { true; } ismulti() { debug $1 $2; test -e "$1/.disk/info" || test -e "$1$2/.disk/info"; } # 1/ mountpoint # 2/ hierarchy getdisklabel () { debug "$1" "$2" if [ -f $1/.disk/info ] then echo -n `head -1 "$1/.disk/info"` else if [ -f $1$2/.disk/info ] then echo -n `head -1 "$1$2/.disk/info"` else echo -n 'Non-Debian disc' fi fi } yesno () { while true do echo -n "$2 [$1] " read response if [ -z "$response" ] then response="$1" fi case "$response" in [Nn]*) yesno=no ; return ;; [Yy]*) yesno=yes ; return ;; esac done } getblockdev () { mountpoint="$vardir/methods/mnt" if [ -z "$defaultdevice" ] then defaultdevice="$newdefaultdevice" elif [ "$defaultdevice" != "$newdefaultdevice" ] then echo \ "Last time you specified installation from $defaultdevice." fi promptstring="$1" while [ -z "$blockdevice" ] do echo -n "$promptstring [$defaultdevice]: " read response if [ -z "$response" ] then response="$defaultdevice" fi if [ ! -b "$response" ] then echo "$response is not a block device - will try as loopback."; loop=",loop" fi tryblockdevice="$response" if [ $option = multi_cd ] then fstype=iso9660 elif [ $option = harddisk2 ] then blockbase="`echo \"$tryblockdevice\" | sed -e 's/[0-9]\{1,\}$//'`" set +e printf 'p\nq\n' | fdisk "$blockbase" 2>/dev/null >$tp.f set -e proposeddevice="$tryblockdevice" perl -ne ' next unless /^ *Device +Boot +Begin +Start +End +Blocks +Id +System *$/i .. !/\S/; next unless s:^/\S+:: && $& eq $ENV{"proposeddevice"}; next unless s/^ +(\* +)?\d+ +\d+ +\d+ +\d+\+? +//; next unless m/^([0-9a-f]{1,2}) /i; %types= ( "1","msdos", "4","msdos", "6","msdos", "7","hpfs", "80","minix", "81","minix", "83","ext2" ); print $types{$1}; exit(0); ' <$tp.f >$tp.m defaultfstype="`cat $tp.m`" if [ -n "$defaultfstype" ] then cat </dev/null then echo \ "Your kernel does not appear to support that filesystem type." defaultfstype="" fi fi echo -n "Supported filesystems: " sed -e 's/^.* / /' /proc/filesystems | tr '\n' ' ' echo -n " Enter filesystem type (for $tryblockdevice) [$defaultfstype]: " read fstype if [ -z "$fstype" ] then fstype="$defaultfstype" fi fi umount="$mountpoint" if mount -rt "$fstype" -o nosuid,nodev$loop "$tryblockdevice" "$mountpoint" then echo blockdevice="$tryblockdevice" else umount="" echo \ "Unable to mount $tryblockdevice on $mountpoint, type $fstype." fi done } outputparam () { echo "$2" | sed -e "s/'/'\\\\''/; s/^/$1='/; s/$/'/" >&3 } ## MAIN intrkey="`stty -a | sed -n 's/.*intr = \([^;]*\);.*/\1/p'`" echo " If you make a mistake, use the interrupt key ($intrkey) to abort. " # State variables, `best first' # {main,ctb,nf,nonus,nonusctb,nonusnf,lcl}_{packages,binary} # Empty before we've found them or if they're not available, # set to the relevant bit under mountpoint otherwise. # hierbase # A directory containing a Debian FTP site mirror tree. # mountpoint # The mountpoint for the filesystem containing the stuff # empty or unset if we don't know yet, or if we haven't mounted anything; # may also be empty if `directory' was set. # blockdevice # The actual block device to mount. # fstype # The filesystem type to use. # defaultdevice # The default block device to mount. p_usedevel=no if [ -f shvar.$option ] then . ./shvar.$option defaultdevice="$p_blockdev" defaultnfsserver="$p_nfsserver" defaultnfsrempath="$p_nfsrempath" usedevel="$p_usedevel" fi if [ $option = multi_cd ] then mount >$tp.m sed -n 's/ ([^)]*)$//; s/^[^ ]* on //; s/ type iso9660$//p' <$tp.m >$tp.l ncdroms=`wc -l <$tp.l` if [ $ncdroms -gt 1 ] then response="" while [ -z "$response" ] do echo \ 'Several CD-ROMs (or other ISO9660 filesystems) are mounted:' egrep 'type iso9660 \([^)]*\)$' <$tp.m | nl echo -n \ 'Is it any of these ? Type a number, or `n'\'' for none. ' read response response="`echo \"$response\" | sed -e 's/[ ]*$//'`" if expr "$response" : '[0-9][0-9]*$' >/dev/null && \ [ $response -ge 1 -a $response -le $ncdroms ] then mountpoint="`sed -n $response'p' <$tp.l`" echo elif expr "$response" : '[Nn]' >/dev/null then mountpoint="" else response="" fi done elif [ $ncdroms = 1 ] then mountpoint="`cat $tp.l`" perl -ne 'print if s/ type iso9660 \([^)]*\)$// && s/ on .*$//;' \ <$tp.m >$tp.d blockdevice="`cat $tp.d`" yesno yes \ "I see a CD-ROM: $blockdevice, mounted on $mountpoint. Is it the right one ?" if [ $yesno = no ] then echo 'Unmounting it ...' umount="$mountpoint" while true do echo -n \ 'Please insert the right disc, and hit return: ' read response if mount -rt iso9660 -o nosuid,nodev \ "$blockdevice" "$mountpoint" then echo break fi done fi fi if [ -z "$mountpoint" ] then if [ -b /dev/cdrom ] then echo \ 'I see that /dev/cdrom exists and is a block device.' newdefaultdevice=/dev/cdrom fi getblockdev 'Insert the CD-ROM and enter the block device name' fi fi if [ $option = multi_nfs ] then mountpoint="$vardir/methods/mnt" while [ -z "$nfsserver" ] do echo -n \ "What is the name of the NFS server ? [$defaultnfsserver] " read response if [ -z "$response" -a -n "$defaultnfsserver" ] then response="$defaultnfsserver" fi if [ -z "$response" ]; then continue; fi if [ -x /usr/bin/rpcinfo ] then if rpcinfo -u "$response" mountd >/dev/null then nfsserver="$response" else echo "$response appears not to be an NFS server." fi elif [ -x /bin/ping ] then if ping -q -c 1 "$response" | grep -q ', 1 packets received' then nfsserver="$response" else echo "$response appears to be down or nonexistent." fi else echo \ "(I can't check that now because there is no /usr/bin/rpcinfo or /bin/ping.)" nfsserver="$response" fi done while [ -z "$nfsrempath" ] do echo -n " What is the pathname on the NFS server of the filesystem with the Debian files ? [$defaultnfsrempath] " read response if [ -z "$response" -a -n "$defaultnfsrempath" ] then response="$defaultnfsrempath" else response="`echo \"$response\" | sed -e 's:/$::; s:^/*:/:'`" fi umount="$mountpoint" if mount -rt nfs -o nosuid,nodev "$nfsserver:$response" "$mountpoint" then echo nfsrempath="$response" else umount="" echo \ "Unable to mount NFS filesystem $nfsserver:$response." fi done nfs="$nfsserver:$nfsrempath" fi if [ $option = harddisk2 ] then set +e printf 'p\nq\n' | fdisk /dev/hda 2>/dev/null >$tp.f if [ $? != 0 ] then printf 'p\nq\n' | fdisk /dev/sda 2>/dev/null >$tp.f fi set -e perl -ne ' next unless /^ *Device +Boot +Begin +Start +End +Blocks +Id +System *$/i .. !/\S/; next unless / [146] +DOS \d+-bit \S+$/; next unless m:^/\S+:; print $&; ' <$tp.f >$tp.d newdefaultdevice="`cat $tp.d`" echo " I need to know which disk partition contains the distribution files; disk partitions are specified by the block device name in Linux." if [ -n "$newdefaultdevice" ] then echo \ "By the way, $newdefaultdevice looks like a DOS partition." fi getblockdev "Enter the partition's block device name" fi if [ -n "$mountpoint" ] then # We must have $mountpoint if [ $option = multi_cd ] then echo \ 'All directory names should be entered relative to the root of the CD-ROM. ' elif [ $option = multi_nfs ] then echo \ "All directory names should be entered relative to the root of the NFS filesystem, ie relative to $nfsrempath on the server. " else echo \ "All directory names should be entered relative to the root of the $fstype filesystem on $blockdevice. " fi fi # now try to get the users idea where the debian # hierarchy start below the mointpoint debug "mountpoint: $mountpoint" while true do if ismulti "${mountpoint}" "${hierbase}"; then multi=yes fi if [ $option = multi_cd ] then echo \ "I would like to know where on the CD-ROM the top level of the Debian distribution is - this will usually contain the \`dists' directory. If the CD-ROM is badly organized and doesn't have a straightforward copy of the distribution you may answer \`none' and we'll go through the parts I need individually." else echo \ "In order to make it easy for me to find the relevant files I'd ideally like to install from a straightforward copy of the Debian distribution. To use this I'll need to know where the top level of that copy of the distribution is - this directory usually contains the Packages-Master file. If you do not have a straightforward copy of the distribution available just answer \`none' and we'll go through the parts I need individually." fi defhierbase=none if [ -n "$p_hierbase" ]; then if [ -d "$mountpoint/$p_hierbase/dists/$dist/main/binary-$iarch" \ -o -n "$multi" ]; then echo "Last time you said \`$p_hierbase', and that looks plausible." defhierbase="$p_hierbase" else echo " Last time you said \`$p_hierbase', but that doesn't look plausible, since \`$p_hierbase/dists/$dist/main/binary-$iarch' doesn't seem to exist. And I can't get the impression that you're using a multi-CD set." fi fi # at this point defhierbase is set if it looks plausible # if `none' was entered, we assume a CD with a debian/ directory if [ none = "$defhierbase" -a -d "$mountpoint/debian/dists/$dist/main/binary-$iarch" ] then echo "\`/debian' exists and looks plausible, so that's the default." defhierbase=/debian fi echo -n "Distribution top level ? [$defhierbase] " read response if [ -z "$response" ]; then response="$defhierbase"; fi if [ none = "$response" ]; then hierbase="" break elif ismulti "$mountpoint" "$response" && [ -z "$multi" ]; then multi=yes fi if ! [ -d "$mountpoint/$response/dists/$dist/main/binary-$iarch" \ -o -n "$multi" ]; then echo \ "Neither $response/dists/$dist/main/binary-$iarch does not exist, nor are you using a multi-CD set" break fi hierbase="`echo \"$response\" | sed -e 's:/$::; s:^/*:/:; s:/\+:/:g;'`" debug "hierbase: [$hierbase]" if [ -n "$multi" ]; then disklabel=`getdisklabel "$mountpoint" "/$response"` echo "Ok, this is disc" echo " $disklabel" #echo "Updating multi CD contents file cache ..." #multi_contentsfile="${mountpoint}/${response}/.disk/contents.gz" #zcat "$multi_contentsfile" > disk-contents.$option fi break; done distribution=$dist if [ -n "$hierbase" ] then if [ -d "$mountpoint/$hierbase/dists/unstable/binary-$iarch" ] then echo \ ' Both a stable released distribution and a work-in-progress development tree are available for installation. Would you like to use the unreleased development tree (this is only recommended for experts who like to live dangerously and want to help with testing) ?' yesno "$p_usedevel" 'Use unreleased development distribution ?' usedevel="$yesno" if [ "$usedevel" = yes ] then distribution=development fi else usedevel=no fi echo fi case "$hierbase" in /* ) ;; '' ) ;; * ) hierbase="/$hierbase" ;; esac check_binary () { # args: area-in-messages directory debug "check_binary($@)" if [ ! -d "${mountpoint}$2" -a -z "$multi" ] then echo "\`$2' does not exist." return fi # In this special case it is ok for a sub-distribution to not contain any # .deb files. Each CD should contain all Packages.cd files but doesn't # need to contain the .deb files. # # if ! { find -L "$mountpoint$2" -name '*.deb' -print \ # | head -1 | grep . ; } >/dev/null 2>&1 && [ -z "$multi" ]; # then # echo "\`$2' does not contain any *.deb packages." # return # fi this_binary="$2" echo -n "Using \`$this_binary' as $1 binary dir" if [ -n "$multi" ]; then this_disk=`getdisklabel ${mountpoint} "/$hierbase"` echo " from disc" echo " \`$this_disk'" else echo "" fi } find_area () { # args: area-in-messages area-in-vars subdirectory-in-hier # last-time-binary last-time-packages debug "find_area($@)" this_binary='' this_packages='' this_disk='' if [ -n "$hierbase" ] then check_binary $1 `echo "$hierbase/dists/$3/$1/binary-$iarch" | sed 's:/\+:/:g'` debug "THIS_BINARY $this_binary" fi if [ $option = multi_cd -a $2 = nf -a -z "$this_binary" ] then echo ' Note: most CD-ROM distributions of Debian do not include programs available in the `non-free'\'' directory of the distribution site. This is because these programs have copyrights that prevent distribution for profit on a CD-ROM - ie they are not free software. If you wish to install these programs you'\''ll have to get them from an alternative source.' fi while [ -z "$this_binary" ] do defaultbinary="$4" echo " Which directory contains the *.deb packages from the $1 distribution area (this directory is named \`$3/binary' on the distribution site) ? Say \`none' if this area is not available." if [ $2 != main -a -z "$defaultbinary" ] then defaultbinary=none fi echo -n \ "Enter _$1_ binary dir. [$4] ? " read response if [ -z "$response" -a -n "$defaultbinary" ] then response="$defaultbinary" fi if [ none = "$response" ] then break fi case "$response" in '' | none) continue ;; esac check_binary $1 "`echo \"$response\" | sed -e 's:/$::; s:^/*:/:'`" done if [ -n "$this_binary" ] then if [ "$multi" = "yes" ]; then for f in Packages.cd.gz packages.cd.gz Packages.cd packages.cd do if [ -f "$mountpoint/$this_binary/$f" ] then this_packages="$this_binary/$f" echo "Using \`$this_packages' for $1." break fi done else if [ -f "${mountpoint}${hierbase}/.disk/packages/$1/Packages.gz" ]; then this_packages=`echo "${hierbase}/.disk/packages/$1/Packages.gz"|sed 's:/\+:/:g'` echo "Using \`${this_packages}' for $1." fi fi while [ -z "$this_packages" ] do echo -n " I can't find the $1 \`Packages.cd' file. The information in the \`Packages.cd' file is important for package selection during new installations, and is very useful for upgrades. If you overlooked it when downloading you should do get it now and return to this installation procedure when you have done so: you will find one Packages.cd file and one Packages.cd.gz file -- either will do -- in the \`binary' subdirectory of each area on the FTP sites and CD-ROMs. Alternatively (and this will be rather slow) I can scan the packages in the distribution area - say \`scan' if you want me to do so. You need a separate Packages.cd file from each of the distribution areas you wish to install. Where is the _$1_ \`Packages.cd' file (if none is available, say \`none') [$5] ? " read response if [ -z "$response" -a -n "$5" ] then response="$5" fi case "$response" in '') break ;; none) break ;; scan) this_packages=scan ;; /*) this_packages="$response" ;; *) this_packages="/$response" ;; esac done fi eval $2'_binary="$this_binary"' eval $2'_packages="$this_packages"' eval $2'_disk="$this_disk"' } find_area main main "$distribution" "$p_main_binary" "$p_main_packages" find_area contrib ctb "$distribution" "$p_ctb_binary" "$p_ctb_packages" find_area non-free nf "$distribution" "$p_nf_binary" "$p_nf_packages" find_area non-US/main nonus "$distribution" "$p_nonus_binary" "$p_nonus_packages" find_area non-US/contrib nonusctb "$distribution" "$p_nonusctb_binary" "$p_nonusctb_packages" find_area non-US/non-free nonusnf "$distribution" "$p_nonusnf_binary" "$p_nonusnf_packages" find_area local lcl local "$p_lcl_binary" "$p_lcl_packages" echo -n ' Hit RETURN to continue. ' read response exec 3>shvar.$option.new outputparam p_blockdev "$blockdevice" outputparam p_fstype "$fstype" outputparam p_mountpoint "$mountpoint" outputparam p_nfsserver "$nfsserver" outputparam p_nfsrempath "$nfsrempath" outputparam p_nfs "$nfs" outputparam p_hierbase "$hierbase" outputparam p_usedevel "$usedevel" outputparam p_main_packages "$main_packages" outputparam p_main_binary "$main_binary" outputparam p_main_disk "$main_disk" outputparam p_ctb_packages "$ctb_packages" outputparam p_ctb_binary "$ctb_binary" outputparam p_ctb_disk "$ctb_disk" outputparam p_nf_packages "$nf_packages" outputparam p_nf_binary "$nf_binary" outputparam p_nf_disk "$nf_disk" outputparam p_nonus_binary "$nonus_binary" outputparam p_nonus_packages "$nonus_packages" outputparam p_nonus_disk "$nonus_disk" outputparam p_nonusctb_binary "$nonusctb_binary" outputparam p_nonusctb_packages "$nonusctb_packages" outputparam p_nonusctb_disk "$nonusctb_disk" outputparam p_nonusnf_binary "$nonusnf_binary" outputparam p_nonusnf_packages "$nonusnf_packages" outputparam p_nonusnf_disk "$nonusnf_disk" outputparam p_lcl_packages "$lcl_packages" outputparam p_lcl_binary "$lcl_binary" outputparam p_multi "$multi" outputparam p_multi_contentsfile "$multi_contentsfile" mv shvar.$option.new shvar.$option xit=0 # vim:ts=4:sw=4:aw:ai: PK9Z[2& multicd/namesnuW+A31 multi_cd Install from a CD-ROM set. 36 multi_nfs Install from an NFS server (using the CD-ROM set) (not yet mounted). 46 multi_mount Install from a mounted partition with changing contents. PK9Z[Vd5 multicd/updatenuW+A#!/bin/sh # # Copyright © 1995-1998 Ian Jackson # Copyright © 1998 Heiko Schlittermann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 dated June, 1991. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e vardir="$1" method=$2 option=$3 iarch=`dpkg --print-architecture` cd "$vardir/methods/$method" . ./shvar.$option #debug() { echo "DEBUG: $@"; } debug() { true; } ismulti() { debug $1 $2; test -e "$1/.disk/info" || test -e "$1$2/.disk/info"; } packages=0 for f in main ctb nf nonus nonusctb nonusnf lcl do eval 'this_packages=$p_'$f'_packages' if [ -n "$this_packages" ] then packages=1 fi done if [ $packages eq 0 ] then echo ' No Packages files available, cannot update available packages list. Hit RETURN to continue. ' read response exit 0 fi xit=1 trap ' rm -f packages-{main,ctb,nf,nonus,nonusctb,nonusnf,lcl} if [ -n "$umount" ] then umount "$umount" >/dev/null 2>&1 fi exit $xit ' 0 if [ ! -b "$p_blockdev" ] then loop=",loop" fi if [ -n "$p_blockdev" ] then umount="$p_mountpoint" mount -rt "$p_fstype" -o nosuid,nodev${loop} "$p_blockdev" "$p_mountpoint" fi if [ -n "$p_nfs" ] then umount="$p_mountpoint" mount -rt nfs "$p_nfs" -o nosuid,nodev "$p_mountpoint" fi updatetype=update if [ -z "$p_multi" ]; then exit 1 fi for f in main ctb nf nonus nonusctb nonusnf lcl do eval 'this_packages=$p_'$f'_packages' case "$this_packages" in '') continue ;; scan) eval 'this_binary=$p_'$f'_binary' if [ -z "$this_binary" ]; then continue; fi if [ "$updatetype" = update ] then dpkg --clear-avail updatetype=merge fi echo Running dpkg --record-avail -R "$p_mountpoint$this_binary" dpkg --record-avail -R "$p_mountpoint$this_binary" ;; *) packagesfile="$p_mountpoint$this_packages" case "$packagesfile" in *.gz | *.Z | *.GZ | *.z) echo -n "Uncompressing $packagesfile ... " zcat <"$packagesfile" >packages-$f echo done. dpkg --$updatetype-avail packages-$f updatetype=merge ;; '') ;; *) dpkg --$updatetype-avail "$packagesfile" updatetype=merge ;; esac ;; esac done cp -f $vardir/available $vardir/methods/$method echo -n 'Update OK. Hit RETURN. ' read response xit=0 PK9Z[j multicd/installnuW+A#!/bin/sh # # Copyright © 1995-1998 Ian Jackson # Copyright © 1998 Heiko Schlittermann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 dated June, 1991. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e vardir="$1" method=$2 option=$3 cd "$vardir/methods/$method" . ./shvar.$option #debug() { echo "DEBUG: $@"; } debug() { true; } iarch=`dpkg --print-architecture` ismulti() { test -e "$1/.disk/info" || test -e "$1$2/.disk/info"; } # 1/ mountpoint # 2/ hierarchy getdisklabel () { debug "$1" "$2" if [ -f $1/.disk/info ] then echo -n `head -1 "$1/.disk/info"` else if [ -f $1$2/.disk/info ] then echo -n `head -1 "$1$2/.disk/info"` else echo -n 'Non-Debian disc' fi fi } xit=1 do_umount() { if [ "$method" = "multi_mount" ] then echo /bin/true return fi if [ -n "$umount" ]; then echo umount "$umount" #">/dev/null" "2>&1" fi } do_mount() { if [ "$method" = "multi_mount" ] then echo /bin/true return fi if [ ! -b "$p_blockdev" ] then loop=",loop" fi if [ -n "$p_blockdev" ] then umount="$p_mountpoint" echo mount -rt iso9660 -o nosuid,nodev${loop} "$p_blockdev" "$p_mountpoint"\; umount="$p_mountpoint" fi if [ -n "$p_nfs" ] then umount="$p_mountpoint" echo mount -rt nfs "$p_nfs" -o nosuid,nodev "$p_mountpoint"\; umount="$p_mountpoint" fi #if [ -n "$p_multi" -a -n "$p_multi_contentsfile" ]; then #echo "This is disk " #echo " "`getdisklabel "${p_mountpoint}" "${p_hierbase}"` #fi } trap 'eval `do_umount`; exit $xit' 0 eval `do_mount` predep="$vardir/predep-package" while true do thisdisk="`getdisklabel ${p_mountpoint} ${p_hierbase}`" set +e dpkg --predep-package >"$predep" rc=$? set -e if test $rc = 1; then break; fi test $rc = 0 perl -e ' ($binaryprefix,$predep,$thisdisk) = @ARGV; open(P,"< $predep") || die "cannot open $predep: $!\n"; while (

) { s/\s*\n$//; $package= $_ if s/^Package: //i; /^X-Medium:\s+(.*)\s*/ and $medium = $1; @filename= split(/ /,$_) if s/^Filename: //i; @msdosfilename= split(/ /,$_) if s/^MSDOS-Filename: //i; } length($package) || die "internal error - no package"; @filename || die "internal error - no filename"; @filename==@msdosfilename || !@filename || !@msdosfilename || die "internal error - mismatch >@filename< >@msdosfilename<"; if ($medium && ($medium ne $thisdisk)) { print " This is $thisdisk However, $package is expected on disc: $medium Please change the discs and press . "; exit(1); } @invoke=(); $|=1; for ($i=0; $i<=$#filename; $i++) { $ppart= $i+1; print "Looking for part $ppart of $package ... "; if (-f "$binaryprefix$filename[$i]") { $print= $filename[$i]; $invoke= "$binaryprefix$filename[$i]"; } elsif (-f "$binaryprefix$msdosfilename[$i]") { $print= $msdosfilename[$i]; $invoke= "$binaryprefix$msdosfilename[$i]"; } else { $base= $filename[$i]; $base =~ s,.*/,,; $msdosbase= $msdosfilename[$i]; $msdosbase =~ s,.*/,,; defined($c= open(X,"-|")) || die "failed to fork for find: $!\n"; if (!$c) { exec("find", "-L", length($binaryprefix) ? $binaryprefix : ".", "-name",$base,"-o","-name",$msdosbase); die "failed to exec find: $!\n"; } while (chop($invoke= )) { last if -f $invoke; } $print= $invoke; if (substr($print,0,length($binaryprefix)+1) eq "$binaryprefix/") { $print= substr($print,length($binaryprefix)); } } if (!length($invoke)) { print STDERR " Oh dear, I need to install or upgrade $package, but I don'\''t see the appropriate file(s) anywhere. I'\''m expecting version $version or later, as that is listed in the Packages.cd file. Perhaps you downloaded it with an unexpected name, or something. In any case, you must find the file(s) and then either place it with the correct filename(s) (as listed in the Packages.cd file or in /var/lib/dpkg/available) and rerun the installation, or upgrade the package by using `dpkg --install --auto-deconfigure'\'' by hand. "; exit(1); } print "$print\n"; push(@invoke,$invoke); } print "Running dpkg -iB for $package ...\n"; exec("dpkg","-iB","--",@invoke); die "failed to exec dpkg: $!\n"; ' -- "$p_mountpoint$p_hierbase" "$predep" "$thisdisk" done perl -e ' $SIG{INT} = sub { cd $vardir; unlink ; exit 1; }; $| = 1; my ($vardir, $mountpoint, $hierbase, $mount, $umount) = @ARGV; my $line; my $AVAIL = "$vardir/methods/multicd/available"; my $STATUS = "$vardir/status"; my %Installed, %Filename, %Medium; print "Get currently installed package versions..."; open(IN, "$STATUS") or die "Cannot open $STATUS: $!\n"; $line = 0; { local $/ = ""; while () { my %status; my @pstat; $line++ % 20 or print "."; s/\n\s+/ /g; %status = ("", split /^(\S*?):\s*/m, $_); map { chomp $status{$_}; $status{$_} =~ s/^\s*(.*?)\s*$/$1/;} keys %status; @pstat = split(/ /, $status{Status}); next unless ($pstat[0] eq "install"); if ($pstat[2] eq "config-files" || $pstat[2] eq "not-installed") { $Installed{$status{Package}} = "0.0"; } else { $Installed{$status{Package}} = $status{Version} || "" ; } }; } print "\nGot ", scalar keys %Installed, " installed/pending packages\n"; print "Scanning available packages..."; $line = 0; open(IN, "$AVAIL") or die("Cannot open $AVAIL: $!\n"); { local $/ = ""; while () { my $updated; $line++ % 20 or print "."; s/\n\s+/ /g; %avail = ("", split /^(\S*?):\s*/m, $_); map { chomp $avail{$_}; $avail{$_} =~ s/^\s*(.*?)\s*$/$1/;} keys %avail; next unless defined $Installed{$avail{Package}}; system "dpkg", "--compare-versions", $avail{Version}, "gt", $Installed{$avail{Package}}; $updated = ($? == 0); #print "$avail{Package}(" . ($updated ? "+" : "=") . ") "; $updated or next; $Filename{$avail{Package}} = $avail{Filename}; next unless defined $avail{"X-Medium"}; ${Medium{$avail{"X-Medium"}}} or ${Medium{$avail{"X-Medium"}}} = []; push @{${Medium{$avail{"X-Medium"}}}}, $avail{Package}; }; }; print "\n"; if (@_ = keys(%Medium)) { print "You will need the following distribution disc(s):\n", join (", ", @_), "\n"; } foreach $need (sort @_) { if (-r "$mountpoint/.disk/info") { open(IN, "$mountpoint/.disk/info") or die("$mountpoint/.disk/info: $!\n"); } else { open(IN, "$mountpoint/$hierbase/.disk/info") or die("$mountpoint/$hierbase/.disk/info: $!\n"); } $disk = ; chomp $disk; close(IN); print "Processing disc\n $need\n"; while ($disk ne $need) { print "Wrong disc. This is disc\n $disk\n"; print "However, I need disc\n $need\n"; print "Please change the discs and press \n"; system($umount); ; system($mount); $? and warn("Cannot mount $mount\n"); } continue { if (-r "$mountpoint/.disk/info") { open(IN, "$mountpoint/.disk/info") or die("$mountpoint/.disk/info: $!\n"); } else { open(IN, "$mountpoint/$hierbase/.disk/info") or die("$mountpoint/$hierbase/.disk/info: $!\n"); } $disk = ; chomp $disk; close(IN); } -d "tmp" || mkdir "tmp", 0755 or die("Cannot mkdir tmp: $!\n"); unlink ; print "creating symlinks...\n"; foreach (@{$Medium{$need}}) { ($basename = $Filename{$_}) =~ s/.*\///; symlink "$mountpoint/$hierbase/$Filename{$_}", "tmp/$basename"; } chdir "tmp" or die "Cannot chdir to tmp: $!\n"; system "dpkg", "-iGROEB", "."; unlink <*>; chdir ".."; if ($?) { print "\nThe dpkg run produced errors. Please tell me, if I should\n", "continue with the next CD. [Y/n]: "; $ans = ; exit 1 if $ans =~ /^n/i; $ouch = $?; } } exit $ouch; ' "$vardir" "$p_mountpoint" "$p_hierbase" "`do_mount`" "`do_umount`" echo -n 'Installation OK. Hit RETURN. ' read response xit=0 # vim:ts=4:sw=4:aw:ai: PK9Z[iנmulticd/desc.multi_cdnuW+AInstallation from a CD-ROM set containing a Debian distribution. The CD-ROMs may be or not be mounted already and should contain a standard ISO9660 CD-ROM filesystem. PK9Z[3!!multicd/desc.multi_mountnuW+AInstallation from a pre-mounted directory with changing content. The directory contains the Packages.gz file from each distribution area being installed (usually main, contrib, non-free, local and eventually non-US) as well as an excerpt of the corresponding binary/*/*.deb files. The easiest way for them to get this is to make a (partial) copy of the distribution site's directory hierarchy, if possible. The contents of the mounted directory may change. Thus it's possible to use this method for installations from images of a CDROM set. PK9Z[_6  floppy/setupnuW+A#!/bin/sh set -e vardir="$1" method=$2 option=$3 cd "$vardir/methods/floppy" defaultfloppy=fd0 defaultfstype=msdos if [ -f shvar.$option ] then . ./shvar.$option defaultfloppy="`echo \"$defaultfloppy\" | sed -e 's,^/dev/,,'`" fi while [ -z "$floppy" ] do echo -n ' Which floppy disk drive do you wish to use ? Give the name in /dev (eg fd0) or the MSDOS drive letter (eg A). ['$defaultfloppy'] ' read floppy if [ -z "$floppy" ] then floppy="$defaultfloppy" fi case "$floppy" in [ABab] | [ABab]: ) floppy="`echo $floppy | \ sed -e 's/:$//; s,^[Aa],/dev/fd0,; s,^[Bb],/dev/fd1,'`" ;; /* ) ;; * ) floppy="/dev/$floppy" ;; esac if ! [ -b "$floppy" ] then echo "$floppy is not a block device." floppy="" fi done while [ -z "$fstype" ] do echo -n ' What kind of filesystem is on the floppies ? ['$defaultfstype'] ' read fstype if [ -z "$fstype" ] then fstype="$defaultfstype" fi if ! grep " $fstype$" /proc/filesystems >/dev/null then echo \ "Your kernel does not appear to support that filesystem type." fstype="" fi done echo outputparam () { echo "$2" | sed -e "s/'/'\\\\''/; s/^/$1='/; s/$/'/" >&3 } exec 3>shvar.$option.new outputparam defaultfloppy "$floppy" outputparam defaultfstype "$fstype" mv shvar.$option.new shvar.$option exit 0 PK9Z[// floppy/namesnuW+A50 floppy Install from a pile of floppy disks. PK9Z[floppy/desc.floppynuW+AInstallation using a pile of floppies, at least one of which (usually the first) contains the Packages file, and the rest of which contain the binary *.deb files. If you are installing software from the `non-free' or `contrib' directories as well as the main Debian distribution you must have the Packages files for those areas on separate floppies. The usual way to do this is to put each Packages file on the first floppy which contains packages from the relevant area. PK9Z[) floppy/updatenuW+A#!/bin/sh set -e vardir="$1" method=$2 option=$3 cd "$vardir/methods/floppy" mountpoint="$vardir/methods/mnt" . ./shvar.$option help () { echo ' First I need the disk(s) which contain the Packages file(s) for the parts of the archive you wish to be able to install. If you want to install packages from the non-free and contrib areas of the FTP site you need a floppy with a Packages file for each of those, in addition to the main Packages file for the main Debian distribution. If you don'\''t then you just need one Packages file.' } help xit=1 trap ' if [ -n "$umount" ] then umount "$umount" fi exit $xit ' 0 tryupdate () { if [ $success = 1 ]; then return; fi if [ ! -f "$mountpoint/Packages" ]; then echo "$mountpoint/Packages does not exist."; return fi if dpkg --admindir $vardir --merge-avail "$mountpoint/Packages" then success=1 echo ' You may incorporate another Packages file from another floppy if you wish.' fi } while [ $xit = 1 ] do echo -n ' Insert a disk containing a Packages file, or type q to quit. ' read response case "$response" in [Qq] | [Qq][Uu][Ii][Tt] ) xit=0 ;; * ) umount="$defaultfloppy" if mount -rt "$defaultfstype" "$defaultfloppy" "$mountpoint" then success=0 tryupdate Packages tryupdate packages tryupdate PACKAGES umount "$defaultfloppy" fi umount="" ;; esac done echo ' OK, continuting with installation.' xit=0 PK9Z[/ffloppy/installnuW+A#!/bin/sh set -e vardir="$1" method=$2 option=$3 cd "$vardir/methods/floppy" mountpoint="$vardir/methods/mnt" . ./shvar.$option help () { echo ' Now I need the disks containing the packages to be installed. I shall keep telling you what is left to be done, in case that is helpful deciding which floppy to use.' } help xit=1 trap ' if [ -n "$umount" ] then umount "$umount" fi exit $xit ' 0 while [ -z "$goconfigure" ] do yet="`dpkg --admindir $vardir --yet-to-unpack`" if [ -z "$yet" ] then echo ' All packages unpacked, going on to configure them. ' goconfigure=1 continue fi echo ' Packages yet to be unpacked:' echo "$yet" dpkg-split -l echo -n ' Insert a disk containing *.deb files, or type q to quit. ' read response case "$response" in [Qq] | [Qq][Uu][Ii][Tt] ) goconfigure=1 ;; * ) umount="$defaultfloppy" if mount -rt "$defaultfstype" "$defaultfloppy" "$mountpoint" then echo dpkg --admindir $vardir --unpack -GROEB "$mountpoint" || true umount "$defaultfloppy" fi umount="" ;; esac done if ! [ -z "$yet" ] then response="" while [ -z "$response" ] do echo -n ' Not all the packages have yet been unpacked. Shall I try to proceed with configuration anyay ? If any of the packages which have been unpacked so far depend on any that haven'\''t then you'\''ll see error messages; on the other hand if you say no those packages that could have been configured will not be. (y/n) ' read response case "$response" in [Nn]* ) echo ' OK. Be sure to come back to this, because unpacked-but-not-configured packages are not in general useable. Alternatively, use the Configure option on the dselect menu. ' exit 1 ;; [Yy]* ) ;; * ) response="" ;; esac done fi dpkg --admindir $vardir --configure --pending xit=0 PK9Z[v ftp/setupnuW+A#!/usr/bin/perl # -*-perl-*- # # Copyright © 1996 Andy Guy # Copyright © 1998 Martin Schulze # Copyright © 1999, 2009 Raphaël Hertzog # # This program has been distributed under the terms of the GNU GPL. use strict; use warnings; use vars qw(%config); #use diagnostics; use lib '/usr/lib/perl5/Debian'; use lib '/usr/share/perl5/Debian'; eval 'use Net::FTP;'; if ($@) { print STDERR "Please install the 'perl' package if you want to use the\n" . "FTP access method of dselect.\n\n"; exit 1; } use Dselect::Ftp; # deal with arguments my $vardir = $ARGV[0]; my $method = $ARGV[1]; my $option = $ARGV[2]; if ($option eq "manual") { print "Manual package installation.\n"; exit 0; } #print "vardir: $vardir, method: $method, option: $option\n"; #Defaults my $arch=`dpkg --print-architecture`; $arch='i386' if $?; chomp $arch; my $logname = `whoami`; chomp $logname; my $host = `cat /etc/mailname || dnsdomainname`; chomp $host; $config{'dldir'} = "debian"; $config{'use_auth_proxy'} = 0; $config{'proxyhost'} = ""; $config{'proxylogname'} = $logname; $config{'proxypassword'} = ""; my $methdir = "$vardir/methods/ftp"; my $exit = 0; my $problem = 0; if (-f "$methdir/vars") { read_config("$methdir/vars"); } chdir "$methdir"; if (! -d "debian") { mkdir "debian", 0755; } # get info from user $| = 1; print <[0], # Ftp server $_->[4], # username $_->[5], # password $_->[1], # ftp dir $_->[3], # passive $config{'use_auth_proxy'}, $config{'proxyhost'}, $config{'proxylogname'}, $config{'proxypassword'}); my @dists = @{$_->[2]}; my $dist; foreach $dist (@dists) { my $dir = "$dist/binary-$arch"; print "Checking $dir...\n"; # if(!$ftp->pasv()) { print $ftp->message . "\n"; die "error"; } my @dirlst = $ftp->ls("$dir/"); my $got_pkgfile = 0; my $line = ""; foreach $line (@dirlst) { if($line =~ /Packages/) { $got_pkgfile=1; } } if( !$got_pkgfile) { print "Warning: Could not find a Packages file in $dir\n", "This may not be a problem if the directory is a symbolic link\n"; $problem=1; } } print "Closing ftp connection...\n"; $ftp->quit(); } } # download stuff (protect from ^C) print "\nUsing FTP to check directories...(stop with ^C)\n\n"; eval { local $SIG{INT} = sub { die "Interrupted!\n"; }; download(); }; if($@) { $ftp->quit(); print "FTP ERROR - "; if ($@ eq "connect") { print "config was untested\n"; } else { print "$@\n"; } $exit = 1; }; # output new vars file $config{'done'} = 1; store_config("$methdir/vars"); chmod 0600, "$methdir/vars"; if($exit || $problem) { print "Press return to continue\n"; ; } exit $exit; PK9Z[n\ ftp/namesnuW+A60 ftp Install using ftp. PK9Z[?[ ftp/updatenuW+A#!/usr/bin/perl # -*-perl-*- # # Copyright © 1996 Andy Guy # Copyright © 1998 Martin Schulze # Copyright © 1999, 2009 Raphaël Hertzog # # This program has been distributed under the terms of the GNU GPL. use strict; use warnings; #use diagnostics; use lib '/usr/lib/perl5/Debian'; use lib '/usr/share/perl5/Debian'; eval 'use Net::FTP;'; if ($@) { print STDERR "Please install the 'perl' package if you want to use the\n" . "FTP access method of dselect.\n\n"; exit 1; } use Dselect::Ftp; # deal with arguments my $vardir = $ARGV[0]; my $method = $ARGV[1]; my $option = $ARGV[2]; if ($option eq "manual") { print "Enter package file names or a blank line to finish\n"; while(1) { print "Enter package file name:"; my $fn = ; chomp $fn; if ( $fn == "") { exit 0; } if ( -f $fn ) { system ("dpkg", "--merge-avail", $fn); } else { print "Could not find $fn, try again\n"; } }; }; #print "vardir: $vardir, method: $method, option: $option\n"; my $arch=`dpkg --print-architecture`; $arch='i386' if $?; chomp $arch; my $exit = 0; # get info from control file read_config("$vardir/methods/ftp/vars"); chdir "$vardir/methods/ftp"; print "Getting Packages files...(stop with ^C)\n\n"; my @pkgfiles; my $ftp; my $packages_modified = 0; sub download { foreach (@{$config{'site'}}) { my $site = $_; $ftp = do_connect ($_->[0], # Ftp server $_->[4], # username $_->[5], # password $_->[1], # ftp dir $_->[3], # passive $config{'use_auth_proxy'}, $config{'proxyhost'}, $config{'proxylogname'}, $config{'proxypassword'}); my @dists = @{$_->[2]}; my $dist; PACKAGE: foreach $dist (@dists) { my $dir = "$dist/binary-$arch"; my $must_get = 0; my $newest_pack_date; # check existing Packages on remote site print "\nChecking for Packages file... "; $newest_pack_date = do_mdtm ($ftp, "$dir/Packages.gz"); if (defined $newest_pack_date) { print "$dir/Packages.gz\n"; } else { $dir = "$dist"; $newest_pack_date = do_mdtm ($ftp, "$dir/Packages.gz"); if (defined $newest_pack_date) { print "$dir/Packages.gz\n"; } else { print "Couldn't find Packages.gz in $dist/binary-$arch or $dist; ignoring.\n"; print "Your setup is probably wrong, check the distributions directories,\n"; print "and try with passive mode enabled/disabled (if you use a proxy/firewall)\n"; next PACKAGE; } } # we now have $dir set to point to an existing Packages.gz file # check if we already have a Packages file (and get its date) $dist =~ tr/\//_/; my $file = "Packages.$site->[0].$dist"; # if not if (! -f $file) { # must get one # print "No Packages here; must get it.\n"; $must_get = 1; } else { # else check last modification date my @pack_stat = stat($file); if($newest_pack_date > $pack_stat[9]) { # print "Packages has changed; must get it.\n"; $must_get = 1; } elsif ($newest_pack_date < $pack_stat[9]) { print " Our file is newer than theirs; skipping.\n"; } else { print " Already up-to-date; skipping.\n"; } } if ($must_get) { -f "Packages.gz" and unlink "Packages.gz"; -f "Packages" and unlink "Packages"; my $size = 0; TRY_GET_PACKAGES: while (1) { if ($size) { print " Continuing "; } else { print " Getting "; } print "Packages file from $dir...\n"; eval { if ($ftp->get("$dir/Packages.gz", "Packages.gz", $size)) { if (system("gunzip", "Packages.gz")) { print " Couldn't gunzip Packages.gz, stopped"; die "error"; } } else { print " Couldn't get Packages.gz from $dir !!! Stopped."; die "error"; } }; if ($@) { $size = -s "Packages.gz"; if (ref($ftp)) { $ftp->abort(); $ftp->quit(); }; if (yesno ("y", "Transfer failed at $size: retry at once")) { $ftp = do_connect ($site->[0], # Ftp server $site->[4], # username $site->[5], # password $site->[1], # ftp dir $site->[3], # passive $config{'use_auth_proxy'}, $config{'proxyhost'}, $config{'proxylogname'}, $config{'proxypassword'}); if ($newest_pack_date != do_mdtm ($ftp, "$dir/Packages.gz")) { print ("Packages file has changed !\n"); $size = 0; } next TRY_GET_PACKAGES; } else { die "error"; } } last TRY_GET_PACKAGES; } if(!rename "Packages", "Packages.$site->[0].$dist") { print " Couldn't rename Packages to Packages.$site->[0].$dist"; die "error"; } else { # set local Packages file to same date as the one it mirrors # to allow comparison to work. utime $newest_pack_date, $newest_pack_date, "Packages.$site->[0].$dist"; $packages_modified = 1; } } push @pkgfiles, "Packages.$site->[0].$dist"; } $ftp->quit(); } } eval { local $SIG{INT} = sub { die "Interrupted!\n"; }; download(); }; if($@) { $ftp->quit() if (ref($ftp)); if($@ =~ /timeout/i) { print "FTP TIMEOUT\n"; } else { print "FTP ERROR - $@\n"; } $exit = 1; }; my $ans; if ($packages_modified) { # don't clear if nothing changed print < # Copyright © 1998 Martin Schulze # Copyright © 1999, 2009 Raphaël Hertzog # # This program has been distributed under the terms of the GNU GPL. use strict; use warnings; use vars qw(%config $ftp); #use diagnostics; use lib '/usr/lib/perl5/Debian'; use lib '/usr/share/perl5/Debian'; eval q{ use Net::FTP; use File::Path; use File::Basename; use File::Find; use Data::Dumper; }; if ($@) { print STDERR "Please install the 'perl' package if you want to use the\n" . "FTP access method of dselect.\n\n"; exit 1; } use Dselect::Ftp; # exit value my $exit = 0; # deal with arguments my $vardir = $ARGV[0]; my $method = $ARGV[1]; my $option = $ARGV[2]; if ($option eq "manual" ) { print "manual mode not supported yet\n"; exit 1; } #print "vardir: $vardir, method: $method, option: $option\n"; my $methdir = "$vardir/methods/ftp"; # get info from control file read_config("$methdir/vars"); chdir "$methdir"; mkpath(["$methdir/$config{'dldir'}"], 0, 0755); #Read md5sums already calculated my %md5sums; if (-f "$methdir/md5sums") { local $/; open(MD5SUMS, "$methdir/md5sums") || die "Couldn't read file $methdir/md5sums"; my $code = ; close MD5SUMS; use vars qw($VAL1); my $res = eval $code; if ($@) { die "Couldn't eval $methdir/md5sums content: $@\n"; } if (ref($res)) { %md5sums = %{$res} } } # get a block # returns a ref to a hash containing flds->fld contents # white space from the ends of lines is removed and newlines added # (no trailing newline). # die's if something unexpected happens sub getblk { my $fh = shift; my %flds; my $fld; while (<$fh>) { if ( ! /^$/ ) { FLDLOOP: while (1) { if ( /^(\S+):\s*(.*)\s*$/ ) { $fld = lc($1); $flds{$fld} = $2; while (<$fh>) { if ( /^$/ ) { return %flds; } elsif ( /^(\s.*)$/ ) { $flds{$fld} = $flds{$fld} . "\n" . $1; } else { next FLDLOOP; } } return %flds; } else { die "Expected a start of field line, but got:\n$_"; } } } } return %flds; } # process status file # create curpkgs hash with version (no version implies not currently installed) # of packages we want print "Processing status file...\n"; my %curpkgs; sub procstatus { my (%flds, $fld); open (STATUS, "$vardir/status") or die "Could not open status file"; while (%flds = getblk(\*STATUS), %flds) { if($flds{'status'} =~ /^install ok/) { my $cs = (split(/ /, $flds{'status'}))[2]; if(($cs eq "not-installed") || ($cs eq "half-installed") || ($cs eq "config-files")) { $curpkgs{$flds{'package'}} = ""; } else { $curpkgs{$flds{'package'}} = $flds{'version'}; } } } close(STATUS); } procstatus(); sub dcmpvers { my($a, $p, $b) = @_; my ($r); $r = system("/usr/bin/dpkg", "--compare-versions", "$a", "$p", "$b"); $r = $r/256; if ($r == 0) { return 1; } elsif ($r == 1) { return 0; } die "dpkg --compare-versions $a $p $b - failed with $r"; } # process package files, looking for packages to install # create a hash of these packages pkgname => version, filenames... # filename => md5sum, size # for all packages my %pkgs; my %pkgfiles; sub procpkgfile { my $fn = shift; my $site = shift; my $dist = shift; my(@files,@sizes,@md5sums,$pkg,$ver,$fl,$nfs,$fld); my(%flds); open(PKGFILE, "$fn") or die "Could not open package file $fn"; while(%flds = getblk(\*PKGFILE), %flds) { $pkg = $flds{'package'}; $ver = $curpkgs{$pkg}; @files = split(/[\s\n]+/, $flds{'filename'}); @sizes = split(/[\s\n]+/, $flds{'size'}); @md5sums = split(/[\s\n]+/, $flds{'md5sum'}); if ( defined($ver) && ( ($ver eq "") || dcmpvers( $ver, "lt", $flds{'version'} ) )) { $pkgs{$pkg} = [ $flds{'version'}, [ @files ], $site ]; $curpkgs{$pkg} = $flds{'version'}; } $nfs = scalar(@files); if(($nfs != scalar(@sizes)) || ($nfs != scalar(@md5sums)) ) { print "Different number of filenames, sizes and md5sums for $flds{'package'}\n"; } else { my $i = 0; foreach $fl (@files) { $pkgfiles{$fl} = [ $md5sums[$i], $sizes[$i], $site, $dist ]; $i++; } } } } print "\nProcessing Package files...\n"; my ($dist,$site,$fn,$i,$j); $i = 0; foreach $site (@{$config{'site'}}) { $j = 0; foreach $dist (@{$site->[2]}) { $fn = $dist; $fn =~ tr#/#_#; $fn = "Packages.$site->[0].$fn"; if (-f $fn) { print " $site->[0] $dist...\n"; procpkgfile($fn,$i,$j); } else { print "Could not find packages file for $site->[0] $dist distribution (re-run Update)\n" } $j++; } $i++; } my $dldir = $config{'dldir'}; # md5sum sub md5sum($) { my $fn = shift; my $m = `md5sum $fn`; $m = (split(" ", $m))[0]; $md5sums{"$dldir/$fn"} = $m; return $m; } # construct list of files to get # hash of filenames => size of downloaded part # query user for each paritial file print "\nConstructing list of files to get...\n"; my %downloads; my ($pkg, $dir, @info, @files, $csize, $size); my $totsize = 0; foreach $pkg (keys(%pkgs)) { @files = @{$pkgs{$pkg}[1]}; foreach $fn (@files) { #Look for a partial file if (-f "$dldir/$fn.partial") { rename "$dldir/$fn.partial", "$dldir/$fn"; } $dir = dirname($fn); if(! -d "$dldir/$dir") { mkpath(["$dldir/$dir"], 0, 0755); } @info = @{$pkgfiles{$fn}}; $csize = int($info[1]/1024)+1; if(-f "$dldir/$fn") { $size = -s "$dldir/$fn"; if($info[1] > $size) { # partial download if(yesno("y", "continue file: $fn (" . nb($size) ."/" . nb($info[1]). ")")) { $downloads{$fn} = $size; $totsize += $csize - int($size/1024); } else { $downloads{$fn} = 0; $totsize += $csize; } } else { # check md5sum if (! exists $md5sums{"$dldir/$fn"}) { $md5sums{"$dldir/$fn"} = md5sum("$dldir/$fn"); } if ($md5sums{"$dldir/$fn"} eq $info[0]) { print "already got: $fn\n"; } else { print "corrupted: $fn\n"; $downloads{$fn} = 0; } } } else { my $ffn = $fn; $ffn =~ s/binary-[^\/]+/.../; print "want: " . $config{'site'}[$pkgfiles{$fn}[2]][0] . " $ffn (${csize}k)\n"; $downloads{$fn} = 0; $totsize += $csize; } } } my $avsp = `df -Pk $dldir| awk '{ print \$4}' | tail -n 1`; chomp $avsp; print "\nApproximate total space required: ${totsize}k\n"; print "Available space in $dldir: ${avsp}k\n"; #$avsp = `df -k $::dldir| paste -s | awk '{ print \$11}'`; #chomp $avsp; if($totsize == 0) { print "Nothing to get."; } else { if($totsize > $avsp) { print "Space required is greater than available space,\n"; print "you will need to select which items to get.\n"; } # ask user which files to get if(($totsize > $avsp) || yesno("n", "Do you want to select the files to get")) { $totsize = 0; my @files = sort(keys(%downloads)); my $fn; my $def = "y"; foreach $fn (@files) { my @info = @{$pkgfiles{$fn}}; my $csize = int($info[1] / 1024) + 1; my $rsize = int(($info[1] - $downloads{$fn}) / 1024) + 1; if ($rsize + $totsize > $avsp) { print "no room for: $fn\n"; delete $downloads{$fn}; } else { if(yesno($def, $downloads{$fn} ? "download: $fn ${rsize}k/${csize}k (total = ${totsize}k)" : "download: $fn ${rsize}k (total = ${totsize}k)")) { $def = "y"; $totsize += $rsize; } else { $def = "n"; delete $downloads{$fn}; } } } } } sub download() { my $i = 0; my ($site, $ftp); foreach $site (@{$config{'site'}}) { my @getfiles = grep { $pkgfiles{$_}[2] == $i } keys %downloads; my @pre_dist = (); # Directory to add before $fn #Scan distributions for looking at "(../)+/dir/dir" my ($n,$cp); $cp = -1; foreach (@{$site->[2]}) { $cp++; $pre_dist[$cp] = ""; $n = (s#\.\./#../#g); next if (! $n); if (m#^((?:\.\./){$n}(?:[^/]+/){$n})#) { $pre_dist[$cp] = $1; } } if (! @getfiles) { $i++; next; } $ftp = do_connect ($site->[0], #$::ftpsite, $site->[4], #$::username, $site->[5], #$::password, $site->[1], #$::ftpdir, $site->[3], #$::passive, $config{'use_auth_proxy'}, $config{'proxyhost'}, $config{'proxylogname'}, $config{'proxypassword'}); $::ftp = $ftp; local $SIG{'INT'} = sub { die "Interrupted !\n"; }; my ($fn,$rsize,$res,$pre); foreach $fn (@getfiles) { $pre = $pre_dist[$pkgfiles{$fn}[3]] || ""; if ($downloads{$fn}) { $rsize = ${pkgfiles{$fn}}[1] - $downloads{$fn}; print "getting: $pre$fn (". nb($rsize) . "/" . nb($pkgfiles{$fn}[1]) . ")\n"; } else { print "getting: $pre$fn (". nb($pkgfiles{$fn}[1]) . ")\n"; } $res = $ftp->get("$pre$fn", "$dldir/$fn", $downloads{$fn}); if(! $res) { my $r = $ftp->code(); print $ftp->message() . "\n"; if (!($r == 550 || $r == 450)) { return 1; } else { #Try to find another file or this package print "Looking for another version of the package...\n"; my ($dir,$package) = ($fn =~ m#^(.*)/([^/]+)_[^/]+.deb$#); my $protected = $package; $protected =~ s/\+/\\\+/g; my $list = $ftp->ls("$pre$dir"); if ($ftp->ok() && ref($list)) { foreach (@{$list}) { if (m/($dir\/${protected}_[^\/]+.deb)/i) { print "Package found : $_\n"; print "getting: $_ (size not known)\n"; $res = $ftp->get($_, "$dldir/$1"); if (! $res) { $r = $ftp->code(); print $ftp->message() . "\n"; return 1 if ($r != 550 and $r != 450); } } } } } } # fully got, remove it from list in case we have to re-download delete $downloads{$fn}; } $ftp->quit(); $i++; } return 0; } # download stuff (protect from ^C) if($totsize != 0) { if(yesno("y", "\nDo you want to download the required files")) { DOWNLOAD_TRY: while (1) { print "Downloading files... use ^C to stop\n"; eval { if ((download() == 1) && yesno("y", "\nDo you want to retry downloading at once")) { next DOWNLOAD_TRY; } }; if($@ =~ /Interrupted|Timeout/i ) { # close the FTP connection if needed if ((ref($::ftp) =~ /Net::FTP/) and ($@ =~ /Interrupted/i)) { $::ftp->abort(); $::ftp->quit(); undef $::ftp; } print "FTP ERROR\n"; if (yesno("y", "\nDo you want to retry downloading at once")) { # get the first $fn that foreach would give: # this is the one that got interrupted. my $ffn; MY_ITER: foreach $ffn (keys(%downloads)) { $fn = $ffn; last MY_ITER; } my $size = -s "$dldir/$fn"; # partial download if(yesno("y", "continue file: $fn (at $size)")) { $downloads{$fn} = $size; } else { $downloads{$fn} = 0; } next DOWNLOAD_TRY; } else { $exit = 1; last DOWNLOAD_TRY; } } elsif ($@) { print "An error occured ($@) : stopping download\n"; } last DOWNLOAD_TRY; } } } # remove duplicate packages (keep latest versions) # move half downloaded files out of the way # delete corrupted files print "\nProcessing downloaded files...(for corrupt/old/partial)\n"; my %vers; # package => version my %files; # package-version => files... # check a deb or split deb file # return 1 if it a deb file, 2 if it is a split deb file # else 0 sub chkdeb($) { my ($fn) = @_; # check to see if it is a .deb file if(!system("dpkg-deb --info $fn 2>&1 >/dev/null && dpkg-deb --contents $fn 2>&1 >/dev/null")) { return 1; } elsif(!system("dpkg-split --info $fn 2>&1 >/dev/null")) { return 2; } return 0; } sub getdebinfo($) { my ($fn) = @_; my $type = chkdeb($fn); my ($pkg, $ver); if($type == 1) { open(PKGFILE, "dpkg-deb --field $fn |"); my %fields = getblk(\*PKGFILE); close(PKGFILE); $pkg = $fields{'package'}; $ver = $fields{'version'}; if($fields{'package_revision'}) { $ver .= '-' . $fields{'package_revision'}; } return $pkg, $ver; } elsif ( $type == 2) { open(PKGFILE, "dpkg-split --info $fn|"); while() { /Part of package:\s*(\S+)/ and $pkg = $+; /\.\.\. version:\s*(\S+)/ and $ver = $+; } close(PKGFILE); return $pkg, $ver; } print "could not figure out type of $fn\n"; return $pkg, $ver; } # process deb file to make sure we only keep latest versions sub prcdeb($$) { my ($dir, $fn) = @_; my ($pkg, $ver) = getdebinfo($fn); if(!defined($pkg) || !defined($ver)) { print "could not get package info from file\n"; return 0; } if($vers{$pkg}) { if(dcmpvers($vers{$pkg}, "eq", $ver)) { $files{$pkg . $ver} = [ $files{$pkg . $ver }, "$dir/$fn" ]; } elsif (dcmpvers($vers{$pkg}, "gt", $ver)) { print "old version\n"; unlink $fn; } else { # else $ver is gt current version my ($c); foreach $c (@{$files{$pkg . $vers{$pkg}}}) { print "replaces: $c\n"; unlink "$vardir/methods/ftp/$dldir/$c"; } $vers{$pkg} = $ver; $files{$pkg . $ver} = [ "$dir/$fn" ]; } } else { $vers{$pkg} = $ver; $files{$pkg . $ver} = [ "$dir/$fn" ]; } } sub prcfile() { my ($fn) = $_; if (-f $fn and $fn ne '.') { my $dir = "."; if (length($File::Find::dir) > length($dldir)) { $dir = substr($File::Find::dir, length($dldir)+1); } print "$dir/$fn\n"; if(defined($pkgfiles{"$dir/$fn"})) { my @info = @{$pkgfiles{"$dir/$fn"}}; my $size = -s $fn; if($size == 0) { print "zero length file\n"; unlink $fn; } elsif($size < $info[1]) { print "partial file\n"; rename $fn, "$fn.partial"; } elsif(( (exists $md5sums{"$dldir/$fn"}) and ($md5sums{"$dldir/$fn"} ne $info[0]) ) or (md5sum($fn) ne $info[0])) { print "corrupt file\n"; unlink $fn; } else { prcdeb($dir, $fn); } } elsif($fn =~ /.deb$/) { if(chkdeb($fn)) { prcdeb($dir, $fn); } else { print "corrupt file\n"; unlink $fn; } } else { print "non-debian file\n"; } } } find(\&prcfile, "$dldir/"); # install .debs if(yesno("y", "\nDo you want to install the files fetched")) { print "Installing files...\n"; #Installing pre-dependent package before ! my (@flds, $package, @filename, $r); while (@flds = `dpkg --predep-package`, $? == 0) { foreach (@flds) { s/\s*\n//; $package= $_ if s/^Package: //i; @filename= split(/ +/,$_) if s/^Filename: //i; } @filename = map { "$dldir/$_" } @filename; next if (! @filename); $r = system('dpkg', '-iB', '--', @filename); if ($r) { print "DPKG ERROR\n"; $exit = 1; } } #Installing other packages after $r = system("dpkg", "-iGREOB", $dldir); if($r) { print "DPKG ERROR\n"; $exit = 1; } } sub removeinstalled { my $fn = $_; if (-f $fn and $fn ne '.') { my $dir = "."; if (length($File::Find::dir) > length($dldir)) { $dir = substr($File::Find::dir, length($dldir)+1); } if($fn =~ /.deb$/) { my($pkg, $ver) = getdebinfo($fn); if(!defined($pkg) || !defined($ver)) { print "Could not get info for: $dir/$fn\n"; } else { if($curpkgs{$pkg} and dcmpvers($ver, "le", $curpkgs{$pkg})) { print "deleting: $dir/$fn\n"; unlink $fn; } else { print "leaving: $dir/$fn\n"; } } } else { print "non-debian: $dir/$fn\n"; } } } # remove .debs that have been installed (query user) # first need to reprocess status file if(yesno("y", "\nDo you wish to delete the installed package (.deb) files?")) { print "Removing installed files...\n"; %curpkgs = (); procstatus(); find(\&removeinstalled, "$dldir/"); } # remove whole ./debian directory if user wants to if(yesno("n", "\nDo you want to remove $dldir directory?")) { rmtree("$dldir"); } #Store useful md5sums foreach (keys %md5sums) { next if (-f $_); delete $md5sums{$_}; } open(MD5SUMS, ">$methdir/md5sums") || die "Can't open $methdir/md5sums in write mode : $!\n"; print MD5SUMS Dumper(\%md5sums); close MD5SUMS; exit $exit; PK9Z[kyy ftp/desc.ftpnuW+AInstallation using ftp, you must know one (or more) ftp site(s) and the correct directories for the Debian distribution. PK9Z[E.''ftp/README.mirrors.txtnuW+ADebian - worldwide mirror sites This file is broken up into two separate mirror listings: primary and Secondary mirror sites. The definitions are as follows: A Primary mirror site has good bandwidth, is available 24 hours a day, and has an easy to remember names of the form ftp..debian.org. Additionally, most of them are updated automatically after updates to the Debian archive. A Secondary mirror site may have restrictions on what they mirror (due to space restrictions). Just because a site is Secondary doesn't necessarily mean it'll be any slower or less up to date than a Primary site. Use the site closest to you for the fastest downloads possible whether is be a primary or secondary site. The program netselect can be used to determine the fastest of a list of sites. If you know of any mirrors that are missing from this list, please have the site maintainer fill out http://www.debian.org/mirror/submit To contact the maintainer of this page, write to mirrors@debian.org Primary ISO Mirror Sites ------------------------ /debian? /debian-non-US? Australia - ftp.au.debian.org Yes Yes Austria - ftp.at.debian.org Yes Yes Germany - ftp.de.debian.org Yes Yes Japan - ftp.jp.debian.org Yes No Korea - ftp.kr.debian.org Yes No United States - ftp.debian.org Yes No Secondary FTP and HTTP mirrors of the Debian archive ---------------------------------------------------- HOSTNAME FTP HTTP -------- --- ---- Australia --------- ftp.au.debian.org /pub/debian/ /debian/ ftp.wa.au.debian.org /pub/linux/debian/ /debian/ ftp.monash.edu.au /pub/linux/distributions/debian /pub/linux/distributions/debian linux.org.au /pub/debian/ /mirrors/debian/ ftp.uwa.edu.au /mirrors/linux/debian/ ftp.tower.net.au /debian/ Austria ------- ftp.at.debian.org /debian/ /debian/ Belgium ------- ftp.linkline.be /debian/ ftp.kulnet.kuleuven.ac.be /pub/mirror/ftp.debian.org/debian/ Brazil ------ linux.if.usp.br /debian/ /ftpmaster/debian/ ftp.br.debian.org /debian/ ftp.unioeste-foz.br /pub/debian/ Bulgaria -------- ftp.bg.debian.org /debian/ Canada ------ ftp.ca.debian.org /debian/ /debian/ ftp.crc.ca /pub/systems/linux/debian/ conan.eecg.toronto.edu /debian/ /debian/ mirror.direct.ca /linux/debian/ /linux/debian/ China ----- freesoft.cei.gov.cn /pub/mirrors/ftp.debian.org/ /pub/mirrors/ftp.debian.org/ Costa Rica ---------- debian.efis.ucr.ac.cr /debian/ /debian/ Czech Republic -------------- ftp.debian.cz /debian/ /debian/ Denmark ------- ftp.sunsite.auc.dk /pub/os/linux/debian/ /ftp/pub/os/linux/debian/ ftp.uni-c.dk /mirror/ftp.debian.org/pub/debian/ /mirror/ftp.debian.org/pub/debian/ ftp.dk.debian.org /debian/ /debian/ ftp.dkuug.dk /pub/debian/ Finland ------- sunsite.tut.fi /debian/ /debian/ France ------ ftp.iut-bm.univ-fcomte.fr /pub/linux/distributions/debian/ /pub/linux/distributions/debian/ ftp.eudil.fr /debian/ ftp.proxad.net /mirrors/ftp.debian.org/ ftp.minet.net /pub/distrib/debian Germany ------- ftp.tu-clausthal.de /pub/linux/debian ftp.de.debian.org /debian/ /debian/ source.rfc822.org /debian/ Germany (de) ------------ debian.uni-essen.de /debian/ /debian/ Hong Kong --------- sunsite.ust.hk /pub/debian/ /pub/debian/ Hungary ------- sunsite.math.klte.hu /pub/debian/ ftp.index.hu /pub/debian mlf.linux.rulez.org /debian/ /debian/ Indonesia --------- debian-mirror.piksi.itb.ac.id /debian/ Ireland ------- ftp.esat.net /mirrors/ftp.debian.org/debian/ /mirrors/ftp.debian.org/debian/ Israel ------ ftp.tls.co.il /debian/ /debian/ Italy ----- ftp3.linux.it /debian/ /debian/ palmaria.garda-access.com /pub/linux/debian ftp.students.cs.unibo.it /Mirrors/ftp.debian.org freedom.dicea.unifi.it /ftp/pub/linux/debian/ /ftp/pub/linux/debian/ JP -- ftp.dti.ad.jp /pub/Linux/debian/ Japan ----- mirror.nucba.ac.jp /mirror/debian/ /mirror/debian/ ftp.jp.debian.org /debian/ ring.asahi-net.or.jp /pub/linux/debian/debian/ /archives/linux/debian/debian/ SunSITE.sut.ac.jp /pub/archives/linux/debian /pub/archives/linux/debian Mexico ------ ftp.iteso.mx ftp://ftp.iteso.mx/pub/Linux/distributions/debian/http://ftp.iteso.mx/Linux/distributions/debian/ NZ -- ftp.clear.net.nz /debian/ Netherlands ----------- ftp.cistron.nl /pub/debian/ ftp.nluug.nl /pub/os/Linux/distr/Debian ftp.demon.nl /pub/mirrors/linux/debian/ New Zealand ----------- Norway ------ ftp.nvg.ntnu.no /mirror/debian/ Poland ------ ftp.pl.debian.org /pub/debian/ /debian/ ftp.fnet.pl /pub/debian ftp.nvg.ntnu.no /mirror/debian/ Portugal -------- ftp.uevora.pt /debian/ /debian/ Russia ------ ftp.chg.ru /pub/Linux/debian/ Slovak Republic --------------- ftp.tuke.sk /pub/debian /debian Slovenia -------- ftp.arnes.si /software/unix/linux/debian/ ftp.camtp.uni-mb.si /debian/ /debian/ South Africa ------------ ftp.is.co.za /linux/distributions/debian/ ftp.linux.co.za /pub/distributions/debian/ Spain ----- ftp.es.debian.org /debian/ ceu.fi.udc.es /debian/ /debian/ Sweden ------ nowhere.campus.luth.se /debian/ /debian/ ftp.lh.umu.se /debian/ /debian/ ftp.sunet.se /pub/os/Linux/distributions/debian/ /pub/os/Linux/distributions/debian/ ftp.du.se /debian/ Switzerland ----------- sunsite.cnlab-switch.ch /mirror/debian/ /ftp/mirror/debian/ ftp.urbanet.ch /mirror/debian/ Thailand -------- debian.linuxchat.org /debian/ /debian/ UK -- ftp.uk.debian.org /debian/ /debian/ ftp.demon.co.uk /pub/mirrors/linux/debian sunsite.org.uk /Mirrors/ftp.debian.org/pub/debian/ /Mirrors/ftp.debian.org/pub/debian/ ftp.mcc.ac.uk /pub/linux/distributions/Debian www.hensa.ac.uk /mirrors/ftp.debian.org/debian/ /mirrors/ftp.debian.org/debian/ US -- http.us.debian.org /debian/ /debian/ ftp.debian.org /debian/ /debian/ ftp.netgod.net /debian/ debian.midco.net /debian/ /debian/ ftp.eecs.umich.edu /debian/ /debian/ debian.terrabox.com /debian/ /debian/ llug.sep.bnl.gov /debian/ /debian/ debian.crosslink.net /pub/debian/ /debian/ debian.crosslink.net /pub/debian/ /debian/ ftp-mirror.internap.com /pub/debian/ /pub/debian/ ftp.us.debian.org /debian/ ftp.fuller.edu /debian/ /debian/ santanni.cc.gatech.edu /pub/linux/distributions/debian/ ftp.cdrom.com /pub/linux/debian debian.egr.msu.edu /debian/ ftp.tux.org /pub/distributions/debian/ /pub/distributions/debian/ debian.ssc.com /pub/debian/ sunsite.unc.edu /pub/Linux/distributions/debian/ /pub/Linux/distributions/debian/ debian.law.miami.edu /debian/ /debian/ ftp.opensource.captech.com /debian/ /debian/ ftp-mirror.internap.com /pub/debian/ /pub/debian/ csociety-ftp.ecn.purdue.edu /pub/debian/ ftp.linuxberg.com /pub/distributions/Debian/ ftp.cs.unm.edu /mirrors/debian /mirrors/debian debian.gimp.dyndns.org /debian/ /debian/ ftp.cs.wisc.edu /pub/mirrors/linux/debian PK9Z[ֹ00 apt/setupnuW+APK9Z[ L'' iapt/namesnuW+APK9Z[A:77 apt/desc.aptnuW+APK9Z[-SX