Hello community, here is the log from the commit of package suseRegister checked in at Thu Mar 30 11:54:56 CEST 2006. -------- --- suseRegister/suseRegister.changes 2006-03-29 17:34:09.000000000 +0200 +++ suseRegister/suseRegister.changes 2006-03-30 11:53:27.000000000 +0200 @@ -1,0 +2,7 @@ +Thu Mar 30 11:52:42 CEST 2006 - mc@suse.de + +- remove hack +- use query-pool to get the products +- remove rugProductArch + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ suseRegister.spec ++++++ --- /var/tmp/diff_new_pack.26C65g/_old 2006-03-30 11:54:28.000000000 +0200 +++ /var/tmp/diff_new_pack.26C65g/_new 2006-03-30 11:54:28.000000000 +0200 @@ -12,7 +12,7 @@ Name: suseRegister Version: 1.0 -Release: 35 +Release: 36 Summary: Registration tool Group: Productivity/Other License: GPL @@ -56,6 +56,10 @@ %{_bindir}/* %changelog -n suseRegister +* Thu Mar 30 2006 - mc@suse.de +- remove hack +- use query-pool to get the products +- remove rugProductArch * Wed Mar 29 2006 - mc@suse.de - add hack to make rug products work * Wed Mar 29 2006 - mc@suse.de ++++++ 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-03-29 17:03:03.000000000 +0200 +++ new/suseRegister-1.0/suse_register 2006-03-30 11:52:25.000000000 +0200 @@ -83,6 +83,7 @@ my @registerReadableText = (); my $registerPrivPol = ""; +my $querypool = "/usr/lib/zmd/query-pool"; my $rug = "/usr/bin/rug"; my $lsb_release = "/usr/bin/lsb_release"; my $uname = "/bin/uname"; @@ -97,6 +98,7 @@ my $lastResponse = ""; my $initialDomain = ""; + push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, 'SSL_ca_path', $CA_PATH); push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, 'SSL_ca_file', undef); push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, 'SSL_verify_mode', 0x01 | 0x02 | 0x04); @@ -1234,116 +1236,47 @@ return 1; } -sub rugProductArch +sub rugProducts { - my $product = shift || undef; - my $ret = "noarch"; - my $err = ""; - - if(!defined $product || $product eq "") - { - return "noarch"; - } - - my @rugArgs = ("--terse", "product-info", "$product"); - - print STDERR "rug product-info command: $rug ".join(" ",@rugArgs)."\n" if($debug >= 1); - - my $pid = open3(\*INA, \*OUTA, \*ERRA, $rug, @rugArgs) or do { - logPrintExit("Cannot execute $rug ".join(" ", @rugArgs).": $!\n",13); - }; - - while (<OUTA>) - { - if($_ =~ /^Arch:\s*(.+)\s*$/ && defined $1 && $1 ne "") - { - $ret = $1; - last; - } - } - #chomp($msg) if(defined $msg && $msg ne ""); - while (<ERRA>) - { - $err .= "$_"; - } - close OUTA; - close ERRA; - close INA; - waitpid $pid, 0; + print STDERR "query pool command: $querypool products \@system \n" if($debug >= 1); + my $result = `$querypool products \@system`; my $code = ($?>>8); - if($code != 0) - { - $code += 20; - } - print STDERR "Get product-info failed($code): $err\n" if($debug && $code != 0); - if(!defined $ret || $ret eq "" || $ret eq "noarch") + if($code != 0) { - $ret = `$uname -i`; - chomp($ret); + $code += 30; + syslog("err", "Query products failed($code): $result"); } - - return $ret; -} - - -sub rugProducts -{ - my $msg = ""; - my $err = ""; - - my @rugArgs = ("--terse", "--no-abbrev", "products", "-i"); - - print STDERR "rug products command: $rug ".join(" ",@rugArgs)."\n" if($debug >= 1); - - my $pid = open3(\*IN, \*OUT, \*ERR, $rug, @rugArgs) or do { - logPrintExit("Cannot execute $rug ".join(" ", @rugArgs).": $!\n",13); - }; - - while (<OUT>) + else { - next if($_ =~ /^\s*$/); - $msg .= "$_"; - - my @p = split('\|', $_); - my $product = ""; - my $version = ""; - my $arch = ""; - if(defined $p[1] && $p[1] ne "") - { - $product = $p[1]; - $arch = rugProductArch($product); - } - if(defined $p[2] && $p[2] ne "") + foreach my $line (split("\n", $result)) { - $version = $p[2]; - $version =~ s/-\s*$//; - } + next if($line =~ /^\s*$/); + + my @p = split('\|', $line); + my $installed = $p[0]; + my $product = $p[1]; + my $version = $p[2]; + my $arch = $p[3]; - push @installedProducts, [$product, $version, $arch]; - } - #chomp($msg) if(defined $msg && $msg ne ""); - while (<ERR>) - { - $err .= "$_"; + if(!defined $arch || $arch eq "" || $arch eq "noarch") + { + $arch = `$uname -i`; + chomp($arch); + } + + if($installed eq "i") + { + push @installedProducts, [$product, $version, $arch]; + } + } } - close OUT; - close ERR; - close IN; - waitpid $pid, 0; - my $code = ($?>>8); - if($code != 0) - { - $code += 20; - } - - print STDERR "Get products failed($code): $msg $err\n" if($debug && $code != 0); - + print STDERR "Query products failed($code): $result\n" if($debug && $code != 0); + print STDERR "installed products: ".Data::Dumper->Dump([\@installedProducts])."\n" if($debug); - } @@ -2067,20 +2000,10 @@ # call this as soon as possible. rugStart(); - -############################################ -### BEGIN ugly hack -############################################ - -my $msg = `$zmdInit restart 2>&1`; - -sleep 6; - -### END ugly hack - if (defined $logfile && $logfile ne "") { - open($LOGDESCR, ">> $logfile") or do { + open($LOGDESCR, ">> $logfile") or do + { if(!$yastcall) { logPrintExit("Cannot open logfile <$logfile>: $!\n", 12); @@ -2150,7 +2073,6 @@ } } - if (defined $locale) { my ($l, $e) = split(/\.|@/, $locale, 2); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...