Hello community, here is the log from the commit of package suseRegister checked in at Wed Aug 16 14:35:00 CEST 2006. -------- --- suseRegister/suseRegister.changes 2006-07-13 09:46:41.000000000 +0200 +++ suseRegister/suseRegister.changes 2006-08-16 11:40:05.000000000 +0200 @@ -1,0 +2,5 @@ +Wed Aug 16 11:25:05 CEST 2006 - mc@suse.de + +- configure proxy values for zmd + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ suseRegister.spec ++++++ --- /var/tmp/diff_new_pack.H8lQNi/_old 2006-08-16 14:34:55.000000000 +0200 +++ /var/tmp/diff_new_pack.H8lQNi/_new 2006-08-16 14:34:55.000000000 +0200 @@ -12,8 +12,8 @@ Name: suseRegister Version: 1.0 -Release: 65 -Summary: Registration tool +Release: 66 +Summary: Registration Tool Group: Productivity/Other License: GPL Source: %{name}-%{version}.tar.bz2 @@ -37,7 +37,7 @@ BuildArchitectures: noarch %description -Commandline tool to register Novell/SUSE products. +Command line tool for registering Novell and SUSE products. @@ -66,6 +66,8 @@ /usr/lib/suseRegister/bin/* %changelog -n suseRegister +* Wed Aug 16 2006 - mc@suse.de +- configure proxy values for zmd * Thu Jul 13 2006 - mc@suse.de - add extra update sources feature (Feature #300728] - set envVar LANGUAGE to en_US to get english command output ++++++ suseRegister-1.0.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/suseRegister-1.0/suse_register new/suseRegister-1.0/suse_register --- old/suseRegister-1.0/suse_register 2006-07-13 09:24:06.000000000 +0200 +++ new/suseRegister-1.0/suse_register 2006-08-16 11:24:12.000000000 +0200 @@ -1655,7 +1655,7 @@ sub rugPreferences { my $pref = shift || undef; - my $value = shift || undef; + my $value = shift || ""; my $msg = ""; my $code = 0; @@ -1671,10 +1671,11 @@ print STDERR "No preference.\n"; return 1; } - if (!defined $value || $value eq "") + + # empty value could be a valid value + if (!defined $value ) { - print STDERR "No value for preference $pref.\n"; - return 1; + $value = ""; } my @rugArgs = ("--quiet", "set", "$pref", "$value"); @@ -1712,6 +1713,57 @@ return ($code,$msg); } +sub zmdProxyConfig +{ + my $proxyUrl = ""; + + if(exists $ENV{'ALL_PROXY'} && defined $ENV{'ALL_PROXY'} && $ENV{'ALL_PROXY'} =~ /^http/ ) + { + $proxyUrl = $ENV{'ALL_PROXY'}; + } + + if(exists $ENV{'HTTPS_PROXY'} && defined $ENV{'HTTPS_PROXY'} && $ENV{'HTTPS_PROXY'} =~ /^http/ ) + { + $proxyUrl = $ENV{'HTTPS_PROXY'}; + } + + if(exists $ENV{'https_proxy'} && defined $ENV{'https_proxy'} && $ENV{'https_proxy'} =~ /^http/ ) + { + $proxyUrl = $ENV{'https_proxy'}; + } + + if($noproxy) + { + rugPreferences("proxy-url" , ""); + rugPreferences("proxy-username", ""); + rugPreferences("proxy-password", ""); + } + elsif($proxyUrl ne "") + { + my $puser = ""; + my $ppass = ""; + + if(-e "$ENV{HOME}/.curlrc") + { + open(IN, "< $ENV{HOME}/.curlrc") or logPrintExit("Cannot open .curlrc: $!\n", 13); + while(<IN>) + { + if( $_ =~ /^\s*proxy-user\s*=\s*"?([^:]+):([^":]+)"?\s*$/) + { + $puser = $1; + $ppass = $2; + last; + } + } + close IN; + } + + rugPreferences("proxy-url" , $proxyUrl); + rugPreferences("proxy-username", $puser); + rugPreferences("proxy-password", $ppass); + } +} + sub configureZMD { my $tree = shift || undef; @@ -1724,6 +1776,8 @@ #print Data::Dumper->Dump([$tree]); + zmdProxyConfig(); + if($addRegSrvSrc) { ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org