diff options
author | Dexter Morgan <dmorgan@mageia.org> | 2011-06-02 20:40:54 +0000 |
---|---|---|
committer | Dexter Morgan <dmorgan@mageia.org> | 2011-06-02 20:40:54 +0000 |
commit | c317ff62fe84d142f8c5f20647d7314374517558 (patch) | |
tree | 803ddbdc456111529c71cc744b5cf1ed1e21664d /grpmi/curl_download | |
download | rpmdrake-c317ff62fe84d142f8c5f20647d7314374517558.tar rpmdrake-c317ff62fe84d142f8c5f20647d7314374517558.tar.gz rpmdrake-c317ff62fe84d142f8c5f20647d7314374517558.tar.bz2 rpmdrake-c317ff62fe84d142f8c5f20647d7314374517558.tar.xz rpmdrake-c317ff62fe84d142f8c5f20647d7314374517558.zip |
Branch for updates
Diffstat (limited to 'grpmi/curl_download')
-rw-r--r-- | grpmi/curl_download/Makefile | 13 | ||||
-rw-r--r-- | grpmi/curl_download/Makefile.PL | 9 | ||||
-rw-r--r-- | grpmi/curl_download/curl_download.pm | 24 |
3 files changed, 46 insertions, 0 deletions
diff --git a/grpmi/curl_download/Makefile b/grpmi/curl_download/Makefile new file mode 100644 index 00000000..363ad0af --- /dev/null +++ b/grpmi/curl_download/Makefile @@ -0,0 +1,13 @@ +.PHONY: clean + +curl_download: + test -e Makefile_c || perl Makefile.PL + $(MAKE) -f Makefile_c + +install: + test -e Makefile_c || perl Makefile.PL + $(MAKE) -f Makefile_c install + +clean: + test ! -e Makefile_c || $(MAKE) -f Makefile_c clean + rm -f *~ *.o diff --git a/grpmi/curl_download/Makefile.PL b/grpmi/curl_download/Makefile.PL new file mode 100644 index 00000000..9bb1eebe --- /dev/null +++ b/grpmi/curl_download/Makefile.PL @@ -0,0 +1,9 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + 'NAME' => 'curl_download', + 'INSTALLDIRS' => 'vendor', + 'VERSION_FROM' => 'curl_download.pm', # finds VERSION + 'INC' => '-I.', + 'MAKEFILE' => 'Makefile_c', +); diff --git a/grpmi/curl_download/curl_download.pm b/grpmi/curl_download/curl_download.pm new file mode 100644 index 00000000..034df5f6 --- /dev/null +++ b/grpmi/curl_download/curl_download.pm @@ -0,0 +1,24 @@ +package curl_download; + +use strict; +use urpm::download; + +our $VERSION = '1.2'; + +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; |