diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-12-02 17:33:23 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-12-02 17:33:23 +0000 |
commit | 22e857958eeb3ee4a4b1843268992aa8814ef7e4 (patch) | |
tree | ff9ee9a7ff26e1d245cc81165fb5d345eb21971d /perl-install/proxy.pm | |
parent | 77de0bfad055e0d6faec34b1291f50d076176984 (diff) | |
download | drakx-22e857958eeb3ee4a4b1843268992aa8814ef7e4.tar drakx-22e857958eeb3ee4a4b1843268992aa8814ef7e4.tar.gz drakx-22e857958eeb3ee4a4b1843268992aa8814ef7e4.tar.bz2 drakx-22e857958eeb3ee4a4b1843268992aa8814ef7e4.tar.xz drakx-22e857958eeb3ee4a4b1843268992aa8814ef7e4.zip |
this package is unused, no need to keep it
Diffstat (limited to 'perl-install/proxy.pm')
-rw-r--r-- | perl-install/proxy.pm | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/perl-install/proxy.pm b/perl-install/proxy.pm deleted file mode 100644 index 361d2c6e8..000000000 --- a/perl-install/proxy.pm +++ /dev/null @@ -1,110 +0,0 @@ -package proxy; # $Id$ - -use diagnostics; -use strict; -use run_program; -use common; -use log; -use c; - - -sub main { - my ($prefix, $in) = @_; - my $proxy_cfg = {}; - my $config_file = "$prefix/usr/lib/wgetrc"; - - # grab current config - foreach (cat_($config_file)) { - /http_proxy = (http:.*):(\d+)/ and ($proxy_cfg->{http_url}, $proxy_cfg->{http_port}) = ($1, $2); - /ftp_proxy = ((?:ftp|http):.*):(\d+)/ and ($proxy_cfg->{ftp_url}, $proxy_cfg->{ftp_port}) = ($1, $2); - /http_user = (.*)/ and ($proxy_cfg->{login}) = $1; - if (/http_passwd = (.*)/) { - ($proxy_cfg->{passwd}) = $1; - ($proxy_cfg->{passwd2}) = $1; - } - } - begin: - $::isWizard = 1; - $::Wizard_no_previous = 1; - $in->ask_okcancel(N("Proxy configuration"), - N("Welcome to the proxy configuration utility.\n\nHere, you'll be able to set up your http and ftp proxies\nwith or without login and password\n" - ), 1); - - # http proxy - step_http_proxy: - undef $::Wizard_no_previous; - $proxy_cfg->{http_url} ||= "http://www.proxy.com/"; - $in->ask_from(N("Proxy configuration"), - N("Please fill in the http proxy informations\nLeave it blank if you don't want an http proxy"), - [ { label => N("URL"), val => \$proxy_cfg->{http_url} }, - { label => N("port"), val => \$proxy_cfg->{http_port} } - ], - complete => sub { - if ($proxy_cfg->{http_url} && $proxy_cfg->{http_url} !~ /^http:/) { - $in->ask_warn('', N("Url should begin with 'http:'")); - return (1,0); - } - if ($proxy_cfg->{http_port} && $proxy_cfg->{http_port} !~ /^\d+$/) { - $in->ask_warn('', N("The port part should be numeric")); - return (1,1); - } - 0; - } - ) or goto begin; - - # ftp proxy - step_ftp_proxy: - $proxy_cfg->{ftp_url} ||= "ftp://ftp.proxy.com/"; - $in->ask_from(N("Proxy configuration"), - N("Please fill in the ftp proxy informations\nLeave it blank if you don't want an ftp proxy"), - [ { label => N("URL"), val => \$proxy_cfg->{ftp_url} }, - { label => N("port"), val => \$proxy_cfg->{ftp_port} } - ], - complete => sub { - if ($proxy_cfg->{ftp_url} && $proxy_cfg->{ftp_url} !~ /^(ftp|http):/) { - $in->ask_warn('', N("Url should begin with 'ftp:' or 'http:'")); - return (1,0); - } - if ($proxy_cfg->{ftp_port} && $proxy_cfg->{ftp_port} !~ /^\d+$/) { - $in->ask_warn('', N("The port part should be numeric")); - return (1,1); - } - 0; - } - ) or goto step_http_proxy; - - # proxy login/passwd - step_login: - $in->ask_from(N("Proxy configuration"), - N("Please enter proxy login and password, if any.\nLeave it blank if you don't want login/passwd"), - [ { label => N("login"), val => \$proxy_cfg->{login} }, - { - label => N("password"), val => \$proxy_cfg->{passwd}, hidden => 1 }, - { - label => N("re-type password"), val => \$proxy_cfg->{passwd2}, hidden => 1 } - ], - complete => sub { - if ($proxy_cfg->{passwd} ne $proxy_cfg->{passwd2}) { - $in->ask_warn('', N("The passwords don't match. Try again!")); - return(1,1); - } - 0; - } - ) or goto step_ftp_proxy; - # save config - substInFile { - s/^(http|ftp)_proxy.*\n//; - eof and $_ .= "http_proxy = $proxy_cfg->{http_url}:$proxy_cfg->{http_port} -ftp_proxy = $proxy_cfg->{ftp_url}:$proxy_cfg->{ftp_port}\n"; - } $config_file; - $proxy_cfg->{login} and substInFile { - s/^http_(user|passwd).*\n//; - eof and $_ .= "http_user = $proxy_cfg->{login} -http_passwd = $proxy_cfg->{passwd}\n" } $config_file; - log::l("[drakproxy] Installation complete, exiting\n"); -} - -#--------------------------------------------- -# WONDERFULL pad -#--------------------------------------------- -1; |