summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2006-04-03 17:29:38 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2006-04-03 17:29:38 +0000
commit19df49c7210dae3e6cfa5f0312a4ba0be61cbabc (patch)
tree8bbba12a91f1eda270214c8c29a1249b1fc1e3e8
parent7855d945aebffa31690333bba1eafa4c414f4fea (diff)
downloadmgaonline-19df49c7210dae3e6cfa5f0312a4ba0be61cbabc.tar
mgaonline-19df49c7210dae3e6cfa5f0312a4ba0be61cbabc.tar.gz
mgaonline-19df49c7210dae3e6cfa5f0312a4ba0be61cbabc.tar.bz2
mgaonline-19df49c7210dae3e6cfa5f0312a4ba0be61cbabc.tar.xz
mgaonline-19df49c7210dae3e6cfa5f0312a4ba0be61cbabc.zip
autoregister the host instead of running the mdkonline wizard when installing a bundle
-rwxr-xr-xmdkupdate19
1 files changed, 18 insertions, 1 deletions
diff --git a/mdkupdate b/mdkupdate
index 3bf6eaae..2701ab56 100755
--- a/mdkupdate
+++ b/mdkupdate
@@ -165,7 +165,24 @@ if (!$bundle) {
my %bundle_vars = getVarsFromSh($bundle);
rm_rf($bundle);
- $wc->{USER_EMAIL} && $wc->{HOST_ID} && $wc->{HOST_KEY} or system("/usr/sbin/mdkonline");
+ my %mapping = (
+ USER => 'USER_EMAIL',
+ #SESSION_ID => 'HOST_KEY',
+ );
+ while (my ($bundle_varname, $onlinesrv_varname) = each %mapping) {
+ $wc->{$onlinesrv_varname} = $bundle_vars{$bundle_varname};
+ }
+ if (!($wc->{HOST_ID} && $wc->{HOST_KEY})) {
+ use lang;
+ my $reg_host = mdkonline::soap_register_host($bundle_vars{USER}, $bundle_vars{PASS}, cat_('/proc/sys/kernel/hostname'), ' ', lang::read()->{country});
+ my $res = mdkonline::check_server_response($reg_host);
+ if ($res ne 'OK') {
+ $in->ask_warn(N("Error"), N("Failed to authenticate to the bundle server:\n\n%s", $reg_host->{message}));
+ exit(3);
+ }
+ mdkonline::write_wide_conf($reg_host);
+ }
+
$wc = mdkonline::read_conf();
$wc->{USER_EMAIL} or die("Configuration not uploaded to Mandriva Online");