summaryrefslogtreecommitdiffstats
path: root/mdkonline.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-01-18 16:02:44 +0000
committerThierry Vignaud <tv@mandriva.org>2010-01-18 16:02:44 +0000
commitb45b03e990321511a81c28479ecf2315ca72f546 (patch)
tree0a92255a7718caf04508e5f342e46c51853b44f4 /mdkonline.pm
parent3885aab7e9e3c2d8484fce3b3b9c222403a98c8e (diff)
downloadmgaonline-b45b03e990321511a81c28479ecf2315ca72f546.tar
mgaonline-b45b03e990321511a81c28479ecf2315ca72f546.tar.gz
mgaonline-b45b03e990321511a81c28479ecf2315ca72f546.tar.bz2
mgaonline-b45b03e990321511a81c28479ecf2315ca72f546.tar.xz
mgaonline-b45b03e990321511a81c28479ecf2315ca72f546.zip
factorize get_from() (thus making mdkapplet-enterprise-update-helper
report distro version too)
Diffstat (limited to 'mdkonline.pm')
-rw-r--r--mdkonline.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index 7175355e..5ae5cd76 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -32,6 +32,7 @@ use ugtk2;
our @ISA = qw(Exporter);
our @EXPORT = qw(fork_exec
get_banner
+ get_from
get_product_id
get_stale_upgrade_filename
is_enterprise_media_supported
@@ -115,6 +116,19 @@ sub is_running {
$found;
}
+
+sub get_from {
+ my ($link, $header) = @_;
+
+ my $ua = LWP::UserAgent->new;
+ $ua->agent(sprintf('mdkapplet (mdkonline-%s; distribution: %s)',
+ $mdkonline::version, $version));
+ $ua->env_proxy;
+
+ my $response = $ua->request(POST $link, $header);
+ $response;
+}
+
# callers need to require XML::Simple
sub xml2perl {
my ($res) = @_;