summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-08-18 18:12:08 +0000
committerOlivier Blin <oblin@mandriva.org>2005-08-18 18:12:08 +0000
commite08093a42beca3e38859cfeea926207cdf9f478f (patch)
tree061e6f0b3772b3e01107098d0536f000f303901d /perl-install/network
parenta3143e18f55267d29c45d3c594f7fe7ce168d4d4 (diff)
downloaddrakx-e08093a42beca3e38859cfeea926207cdf9f478f.tar
drakx-e08093a42beca3e38859cfeea926207cdf9f478f.tar.gz
drakx-e08093a42beca3e38859cfeea926207cdf9f478f.tar.bz2
drakx-e08093a42beca3e38859cfeea926207cdf9f478f.tar.xz
drakx-e08093a42beca3e38859cfeea926207cdf9f478f.zip
add get_protocol
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/ifw.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/perl-install/network/ifw.pm b/perl-install/network/ifw.pm
index 99ca87944..5be73cc59 100644
--- a/perl-install/network/ifw.pm
+++ b/perl-install/network/ifw.pm
@@ -83,6 +83,11 @@ sub get_service {
getservbyport($port, undef) || $port;
}
+sub get_protocol {
+ my ($protocol) = @_;
+ getprotobynumber($protocol) || $protocol;
+}
+
sub get_ip_address {
my ($addr) = @_;
inet_ntoa(pack('L', $addr));
", "a", "a" ], ); my %deps = ( 'libcrypto.so.0' => 'openssl', 'libssl.so.0' => 'openssl', 'mod_sxnet.so' => 'mod_ssl-sxnet', ); sub require2package { $deps{$_[0]} || $_[0] } sub mirror2text($) { $mirrors{$_[0]} && "$mirrors{$_[0]}[0] ($_[0])" } sub mirrorstext() { map { mirror2text($_) } keys %mirrors } sub text2mirror($) { first($_[0] =~ /\((.*)\)$/) } sub ftp($) { ftp::new($_[0], "$mirrors{$_[0]}[1]/$::VERSION") } sub getFile($$) { my ($file, $host) = @_; log::l("getting crypto file $file on directory $host:$mirrors{$host}[1]/$::VERSION with login $mirrors{$host}[2]"); my ($ftp, $retr) = ftp::new($_[1], "$mirrors{$host}[1]/$::VERSION", $mirrors{$host}[2] ? $mirrors{$host}[2] : (), $mirrors{$host}[3] ? $mirrors{$host}[3] : () ); $$retr->close if $$retr; $$retr = $ftp->retr($file) or ftp::rewindGetFile(); $$retr ||= $ftp->retr($file); } sub getDepslist($) { getFile("depslist-crypto", $_[0]) or die "unable to get depslist-crypto" } sub getHdlist($) { getFile("hdlist-crypto.cz2", $_[0]) or die "unable to get hdlist-crypto.cz2" } #sub packages($) { ftp($_[0])->ls } sub getPackages($) { my ($prefix, $packages, $mirror) = @_; #- extract hdlist of crypto, then depslist. require pkgs; pkgs::psUsingHdlist($prefix, '', $packages, getHdlist($mirror), "hdlistCrypto.cz2", "Crypto", '', "Crytographic site", 1) and pkgs::getOtherDeps($packages, getDepslist($mirror)); #- produce an output suitable for visualization. map { pkgs::packageName($_) } pkgs::packagesOfMedium($packages, "Crypto"); } sub get { my ($mirror, $dir, @files) = @_; foreach (@files) { log::l("crypto: downloading $_"); ftp($mirror)->get($_, "$dir/$_") } int @files; }