summaryrefslogtreecommitdiffstats
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
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)
-rwxr-xr-xmdkapplet-enterprise-update-helper11
-rwxr-xr-xmdkapplet-restricted-helper12
-rw-r--r--mdkonline.pm14
3 files changed, 14 insertions, 23 deletions
diff --git a/mdkapplet-enterprise-update-helper b/mdkapplet-enterprise-update-helper
index d6d0754a..5c0c85e0 100755
--- a/mdkapplet-enterprise-update-helper
+++ b/mdkapplet-enterprise-update-helper
@@ -101,17 +101,6 @@ sub get_restricted_authentication() {
}
}
-sub get_from {
- my ($link, $header) = @_;
-
- my $ua = LWP::UserAgent->new;
- $ua->agent("mdkapplet (mdkonline-$mdkonline::version)");
- $ua->env_proxy;
-
- my $response = $ua->request(POST $link, $header);
- $response;
-}
-
sub has_mes5_rights {
my ($ref) = @_;
$ref->{data}{groups}{'es5-prod'} || $ref->{data}{groups}{'es5-demo'};
diff --git a/mdkapplet-restricted-helper b/mdkapplet-restricted-helper
index 18aefdb1..e3e19b63 100755
--- a/mdkapplet-restricted-helper
+++ b/mdkapplet-restricted-helper
@@ -107,18 +107,6 @@ sub get_restricted_authentication() {
}
}
-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;
-}
-
my $error;
sub add_restricted_medium {
my ($email, $password) = @_;
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) = @_;