summaryrefslogtreecommitdiffstats
path: root/mdkonline.pm
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2006-02-23 10:06:01 +0000
committerDaouda Lo <daouda@mandriva.com>2006-02-23 10:06:01 +0000
commitbcf3aba40cf21966488626311b9274a3e18924ae (patch)
tree7ada4f8ccbc06097322adb97ac719c54ac783a1a /mdkonline.pm
parent1a710de9118711b37b823bae7b008900a1747105 (diff)
downloadmgaonline-bcf3aba40cf21966488626311b9274a3e18924ae.tar
mgaonline-bcf3aba40cf21966488626311b9274a3e18924ae.tar.gz
mgaonline-bcf3aba40cf21966488626311b9274a3e18924ae.tar.bz2
mgaonline-bcf3aba40cf21966488626311b9274a3e18924ae.tar.xz
mgaonline-bcf3aba40cf21966488626311b9274a3e18924ae.zip
- make code more modular : separate prepare_upload to use it in cron
daemon exec
Diffstat (limited to 'mdkonline.pm')
-rw-r--r--mdkonline.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index 4faad566..575ab0c7 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -113,7 +113,7 @@ sub soap_upload_config {
sub register_upload_host {
my ($login, $password, $boxname, $descboxname, $country) = @_;
- my ($registered, $uploaded, $res);
+ my ($registered, $res);
my $wc = read_conf();
if (!$wc->{HOST_ID} && -e $rootconf_file) {
$res = upgrade2v3();
@@ -125,7 +125,16 @@ sub register_upload_host {
return $res if (defined $res && $res ne 'OK');
#Reread configuration
$wc = read_conf() if $res eq 'OK';
- my $r = cat_($release_file); my %p = getVarsFromSh($product_file); my $rpmdblist = get_rpmdblist();
+ $res = prepare_upload_con($wc);
+ $res
+}
+
+sub prepare_upload_conf {
+ my ($wc) = shift;
+ my ($uploaded, $res);
+ my $r = cat_($release_file);
+ my %p = getVarsFromSh($product_file);
+ my $rpmdblist = get_rpmdblist();
$wc->{HOST_ID} and $uploaded = soap_upload_config($wc->{HOST_ID}, $wc->{HOST_KEY}, $r, $p{META_CLASS}, $rpmdblist);
$res = check_server_response($uploaded);
return $res