summaryrefslogtreecommitdiffstats
path: root/perl-install/crypto.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-11-28 19:14:45 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-11-28 19:14:45 +0000
commit2ee22881483e84ea8b5ef0a5125631c04d174617 (patch)
tree049f83e2f8ef8c2ed3630d26b8a9f9c525202709 /perl-install/crypto.pm
parent68db145d16c5fa22c876b294411cb9417ad3b08e (diff)
downloaddrakx-2ee22881483e84ea8b5ef0a5125631c04d174617.tar
drakx-2ee22881483e84ea8b5ef0a5125631c04d174617.tar.gz
drakx-2ee22881483e84ea8b5ef0a5125631c04d174617.tar.bz2
drakx-2ee22881483e84ea8b5ef0a5125631c04d174617.tar.xz
drakx-2ee22881483e84ea8b5ef0a5125631c04d174617.zip
no_comment
Diffstat (limited to 'perl-install/crypto.pm')
-rw-r--r--perl-install/crypto.pm41
1 files changed, 41 insertions, 0 deletions
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm
new file mode 100644
index 000000000..b9c7046dd
--- /dev/null
+++ b/perl-install/crypto.pm
@@ -0,0 +1,41 @@
+package crypto;
+
+use diagnostics;
+use strict;
+
+use common qw(:common);
+use log;
+use ftp;
+
+my %mirrors = (
+ "ftp.nectec.or.th" => [ "Thailand", "/pub/mirrors/Mandrake-crypto" ],
+ "ftp.tvd.be" => [ "Belgium", "/packages/mandrake-crypto" ],
+ "sunsite.mff.cuni.cz" => [ "Czech Republic", "/OS/Linux/Dist/Mandrake-crypto" ],
+ "ftp.uni-kl.de" => [ "Germany", "/pub/linux/mandrake/Mandrake-crypto" ],
+ "ftp.leo.org" => [ "Germany", "/pub/comp/os/unix/linux/Mandrake/Mandrake-crypto" ],
+ "sunsite.uio.no" => [ "Norway", "/pub/unix/Linux/Mandrake-crypto" ],
+ "ftp.sunet.se" => [ "Sweden", "/pub/Linux/distributions/mandrake-crypto" ],
+);
+
+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]/RPMS") }
+
+sub packages($) { ftp($_[0])->ls }
+
+sub get {
+ my ($mirror, $dir, @files) = @_;
+ foreach (@files) {
+ log::l("crypto: downloading $_");
+ ftp($mirror)->get($_, "$dir/$_")
+ }
+ int @files;
+}