aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/edit_urpm_sources.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-03-21 17:12:31 +0000
committerThierry Vignaud <tv@mageia.org>2013-03-21 17:12:31 +0000
commite87bd3a7e7a00df990cce06e6f43badbc3442f55 (patch)
treeec005f1e85d896b2db80268871520db80e3bab44 /Rpmdrake/edit_urpm_sources.pm
parentc6d3e2c946d7feccb06059592e0223405ae778db (diff)
downloadrpmdrake-e87bd3a7e7a00df990cce06e6f43badbc3442f55.tar
rpmdrake-e87bd3a7e7a00df990cce06e6f43badbc3442f55.tar.gz
rpmdrake-e87bd3a7e7a00df990cce06e6f43badbc3442f55.tar.bz2
rpmdrake-e87bd3a7e7a00df990cce06e6f43badbc3442f55.tar.xz
rpmdrake-e87bd3a7e7a00df990cce06e6f43badbc3442f55.zip
merge curl_download into Rpmdrake::edit_urpm_sources
rationale: - it's its only user - it has nothing to do with curl since 2008 (and old XS curl code wasn't used anymore since 2003-05-12 when gurpm* stuff was merged in urpmi/gurpm*, grpmi/grpm.pl itself being killed on 2004-01-21) - gc was lazy
Diffstat (limited to 'Rpmdrake/edit_urpm_sources.pm')
-rw-r--r--Rpmdrake/edit_urpm_sources.pm20
1 files changed, 17 insertions, 3 deletions
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm
index 46cab7b5..960ac7f4 100644
--- a/Rpmdrake/edit_urpm_sources.pm
+++ b/Rpmdrake/edit_urpm_sources.pm
@@ -552,8 +552,7 @@ sub proxy_callback {
my $medium_name = $medium ? $medium->{name} : '';
my $w = ugtk2->new(N("Configure proxies"), grab => 1, center => 1, transient => $::main_window);
local $::main_window = $w->{real_window};
- require curl_download;
- my ($proxy, $proxy_user) = curl_download::readproxy($medium_name);
+ my ($proxy, $proxy_user) = readproxy($medium_name);
my ($user, $pass) = $proxy_user =~ /^([^:]*):(.*)$/;
my ($proxybutton, $proxyentry, $proxyuserbutton, $proxyuserentry, $proxypasswordentry);
my $sg = Gtk2::SizeGroup->new('horizontal');
@@ -618,7 +617,7 @@ sub proxy_callback {
$w->main and do {
$something_changed = 1;
- curl_download::writeproxy($proxy, $proxy_user, $medium_name);
+ writeproxy($proxy, $proxy_user, $medium_name);
};
}
@@ -1211,5 +1210,20 @@ packages as well?"));
$res;
}
+sub readproxy (;$) {
+ my $proxy = get_proxy($_[0]);
+ ($proxy->{http_proxy} || $proxy->{ftp_proxy} || '',
+ defined $proxy->{user} ? "$proxy->{user}:$proxy->{pwd}" : '');
+}
+
+sub writeproxy {
+ my ($proxy, $proxy_user, $o_media_name) = @_;
+ my ($user, $pwd) = split /:/, $proxy_user;
+ set_proxy_config(user => $user, $o_media_name);
+ set_proxy_config(pwd => $pwd, $o_media_name);
+ set_proxy_config(http_proxy => $proxy, $o_media_name);
+ set_proxy_config(ftp_proxy => $proxy, $o_media_name);
+ dump_proxy_config();
+}
1;