aix-pm-cvs Mailing List for AIX Perl Modules
Status: Alpha
Brought to you by:
gonter
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
|
Feb
(20) |
Mar
(14) |
Apr
(2) |
May
(15) |
Jun
(22) |
Jul
(11) |
Aug
(31) |
Sep
(11) |
Oct
(19) |
Nov
(15) |
Dec
|
| 2008 |
Jan
|
Feb
(4) |
Mar
|
Apr
(2) |
May
(6) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(10) |
Oct
(14) |
Nov
(7) |
Dec
(12) |
| 2009 |
Jan
|
Feb
(5) |
Mar
(8) |
Apr
(41) |
May
(8) |
Jun
(6) |
Jul
(3) |
Aug
(6) |
Sep
(6) |
Oct
(4) |
Nov
(7) |
Dec
|
| 2010 |
Jan
(2) |
Feb
(9) |
Mar
(7) |
Apr
(15) |
May
|
Jun
(5) |
Jul
(9) |
Aug
(2) |
Sep
(1) |
Oct
(17) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(6) |
Apr
(1) |
May
(7) |
Jun
(7) |
Jul
|
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(1) |
Dec
(5) |
| 2012 |
Jan
(17) |
Feb
(7) |
Mar
(8) |
Apr
(11) |
May
(8) |
Jun
(2) |
Jul
(1) |
Aug
(5) |
Sep
(2) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2013 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(4) |
Aug
|
Sep
(5) |
Oct
(3) |
Nov
(2) |
Dec
(4) |
| 2014 |
Jan
(6) |
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(4) |
Jul
(2) |
Aug
(5) |
Sep
(3) |
Oct
|
Nov
(2) |
Dec
(7) |
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(5) |
Oct
(4) |
Nov
(3) |
Dec
(1) |
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(5) |
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
| 2017 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
(3) |
Nov
(4) |
Dec
|
|
From: Gerhard G. <go...@us...> - 2017-11-27 12:39:11
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26015/modules/util/Util Modified Files: Simple_CSV.pm Log Message: upstream changes Index: Simple_CSV.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/Simple_CSV.pm,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Simple_CSV.pm 23 Nov 2017 13:25:47 -0000 1.53 --- Simple_CSV.pm 27 Nov 2017 12:39:09 -0000 1.54 *************** *** 121,133 **** } - sub rows - { - my $self= shift; - - return undef unless (exists ($self->{data})); - - (wantarray) ? @{$self->{data}} : $self->{data}; - } - =head2 $csv->get_csv_file ($filename) --- 121,124 ---- *************** *** 452,455 **** --- 443,459 ---- } + =head2 my $data= $csv->data () + + =cut + + sub data + { + my $obj= shift; + + return undef unless (exists ($obj->{data})); + + (wantarray) ? @{$obj->{data}} : $obj->{data}; + } + =head2 $csv->add_row (@data) |
|
From: Gerhard G. <go...@us...> - 2017-11-27 12:29:13
|
Update of /cvsroot/aix-pm/modules/util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24397/modules/util Modified Files: csv.pl Log Message: updated comments Index: csv.pl =================================================================== RCS file: /cvsroot/aix-pm/modules/util/csv.pl,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** csv.pl 2 Aug 2017 10:10:50 -0000 1.50 --- csv.pl 27 Nov 2017 12:29:10 -0000 1.51 *************** *** 90,95 **** my $view= 'matrix'; # values: matrix, extended, header, json, dumper my $all= 0; # for extend view, sofar... ! my $find_pattern= undef; ! my $search_string= undef; my $max_items= undef; --- 90,95 ---- my $view= 'matrix'; # values: matrix, extended, header, json, dumper my $all= 0; # for extend view, sofar... ! my $find_pattern= undef; # this is used for a pattern match ! my $search_string= undef; # this is used to select a certain value in a column my $max_items= undef; |
|
From: Gerhard G. <go...@us...> - 2017-11-23 13:25:49
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29777/modules/util/Util Modified Files: Simple_CSV.pm Log Message: added rows() method Index: Simple_CSV.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/Simple_CSV.pm,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Simple_CSV.pm 16 Oct 2016 09:41:47 -0000 1.52 --- Simple_CSV.pm 23 Nov 2017 13:25:47 -0000 1.53 *************** *** 121,124 **** --- 121,133 ---- } + sub rows + { + my $self= shift; + + return undef unless (exists ($self->{data})); + + (wantarray) ? @{$self->{data}} : $self->{data}; + } + =head2 $csv->get_csv_file ($filename) |
|
From: Gerhard G. <go...@us...> - 2017-11-19 13:14:13
|
Update of /cvsroot/aix-pm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12635 Modified Files: .cvsignore .gitignore Added Files: LICENSE Log Message: finishing migration Index: .cvsignore =================================================================== RCS file: /cvsroot/aix-pm/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .cvsignore 23 Oct 2017 17:04:33 -0000 1.3 --- .cvsignore 19 Nov 2017 13:14:11 -0000 1.4 *************** *** 2,3 **** --- 2,4 ---- typescript .git + @* Index: .gitignore =================================================================== RCS file: /cvsroot/aix-pm/.gitignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .gitignore 23 Oct 2017 17:04:33 -0000 1.1 --- .gitignore 19 Nov 2017 13:14:11 -0000 1.2 *************** *** 1,3 **** - .git .project CVSROOT --- 1,2 ---- *************** *** 5,6 **** --- 4,6 ---- tmp typescript + @* --- NEW FILE: LICENSE --- BSD 2-Clause License Copyright (c) 2017, Gerhard Gonter All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
From: Gerhard G. <go...@us...> - 2017-10-23 17:04:35
|
Update of /cvsroot/aix-pm/modules/sw-maint/_bak_ftr.ned In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1824/modules/sw-maint/_bak_ftr.ned Removed Files: Maintenance.ftr Log Message: cleanup for transfer to Github --- Maintenance.ftr DELETED --- |
|
From: Gerhard G. <go...@us...> - 2017-10-23 16:32:21
|
Update of /cvsroot/aix-pm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29312 Added Files: README.textile Log Message: transfering to Github --- NEW FILE: README.textile --- h1. README h2. Location This project migrated on 2017-10-23 from Sourceforge (CVS) to Github (Git). Please use the Github repository from now on. * https://sourceforge.net/projects/aix-pm/ *OBSOLETE REPOSITORY* * https://github.com/gonter/aix-pm h2. License Unless otherwise stated, the code in this repository can be used under terms of the BSD 2-clause license * https://en.wikipedia.org/wiki/BSD_licenses#2-clause_license_.28.22Simplified_BSD_License.22_or_.22FreeBSD_License.22.29 |
|
From: Gerhard G. <go...@us...> - 2017-10-23 16:31:57
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29235/modules/util/Util Modified Files: JSON.pm Log Message: fixed merge conflict Index: JSON.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/JSON.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JSON.pm 23 Aug 2017 13:39:02 -0000 1.6 --- JSON.pm 23 Oct 2017 16:31:55 -0000 1.7 *************** *** 16,21 **** my $json_text = <$fh>; close ($fh); ! ! from_json($json_text); # for some reason, decode_json() barfs when otherwise cleanly read wide characters are present } --- 16,21 ---- my $json_text = <$fh>; close ($fh); ! # decode_json( $json_text ); # for some reason, decode_json() barfs when otherwise cleanly read wide characters are present ! from_json($json_text); } |
|
From: Gerhard G. <go...@us...> - 2017-08-23 13:39:04
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27303/modules/util/Util Modified Files: JSON.pm Log Message: decode_json() can not deal with data coming straigth from an utf8 file, so use from_json() instead Index: JSON.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/JSON.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JSON.pm 26 Aug 2016 21:01:20 -0000 1.5 --- JSON.pm 23 Aug 2017 13:39:02 -0000 1.6 *************** *** 16,20 **** my $json_text = <$fh>; close ($fh); ! decode_json( $json_text ); } --- 16,21 ---- my $json_text = <$fh>; close ($fh); ! ! from_json($json_text); # for some reason, decode_json() barfs when otherwise cleanly read wide characters are present } |
|
From: Gerhard G. <go...@us...> - 2017-08-02 16:42:10
|
Update of /cvsroot/aix-pm/modules/util/Util/XML In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27503/modules/util/Util/XML Modified Files: File.pm Log Message: refactoring note Index: File.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/XML/File.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** File.pm 1 Aug 2017 16:28:41 -0000 1.1 --- File.pm 2 Aug 2017 16:42:07 -0000 1.2 *************** *** 1,3 **** --- 1,5 ---- + # TODO: rename the package! it is very much related to how Aleph works! + package Util::XML::File; *************** *** 38,41 **** --- 40,45 ---- open (FI, '<:utf8', $cache_file); while (<FI>) { $xml .= $_ }; + close (FI); + $xmlref= XMLin($xml, ForceContent => 1, ForceArray => 1); *************** *** 61,65 **** --- 65,72 ---- { print "saving to [$cache_file]\n"; + + # TODO: this is specific to Aleph! $xml=~ s#<session-id>[\w\d]+</session-id>#<session-id>dummy-session-id</session-id>#; + print FO $xml; close (FO); |
|
From: Gerhard G. <go...@us...> - 2017-08-02 10:10:52
|
Update of /cvsroot/aix-pm/modules/util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv610 Modified Files: csv.pl Log Message: allow -tTAB and -TTAB to specifiy the TAB character as input and output field separators Index: csv.pl =================================================================== RCS file: /cvsroot/aix-pm/modules/util/csv.pl,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** csv.pl 2 Feb 2017 11:09:10 -0000 1.49 --- csv.pl 2 Aug 2017 10:10:50 -0000 1.50 *************** *** 135,140 **** else { usage(); } } ! elsif ($arg =~ /^-t(.+)$/) { $CSV_SEP= $1; $CSV_SEP= 'wiki' if ($CSV_SEP eq 'confluence'); } ! elsif ($arg =~ /^-T(.+)$/) { $CSV_OUT_SEP= $1; } elsif ($arg =~ /^-B(.*)$/) { Util::Matrix::set_border_style ($1); } elsif ($arg =~ /^-H(.*)$/) { Util::Matrix::set_header_style ($1); } --- 135,140 ---- else { usage(); } } ! elsif ($arg =~ /^-t(.+)$/) { $CSV_SEP= $1; $CSV_SEP= 'wiki' if ($CSV_SEP eq 'confluence'); $CSV_SEP= "\t" if ($CSV_SEP eq 'TAB'); } ! elsif ($arg =~ /^-T(.+)$/) { $CSV_OUT_SEP= $1; $CSV_OUT_SEP= "\t" if ($CSV_OUT_SEP eq 'TAB'); } elsif ($arg =~ /^-B(.*)$/) { Util::Matrix::set_border_style ($1); } elsif ($arg =~ /^-H(.*)$/) { Util::Matrix::set_header_style ($1); } |
|
From: Gerhard G. <go...@us...> - 2017-08-02 10:05:12
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32246/modules/util/Util Modified Files: MongoDB.pm Log Message: allow empty search filter Index: MongoDB.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/MongoDB.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MongoDB.pm 26 Sep 2016 06:59:09 -0000 1.18 --- MongoDB.pm 2 Aug 2017 10:05:09 -0000 1.19 *************** *** 209,213 **** { my $coll= shift; ! my $search= shift; my $par_wanted_columns= shift; --- 209,213 ---- { my $coll= shift; ! my $search= shift || {}; my $par_wanted_columns= shift; |
|
From: Gerhard G. <go...@us...> - 2017-08-01 16:28:44
|
Update of /cvsroot/aix-pm/modules/util/Util/XML In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23293/modules/util/Util/XML Added Files: File.pm Log Message: file cache for XML items fetched via LWP --- NEW FILE: File.pm --- package Util::XML::File; use strict; # use XML::Simple; use XML::LibXML::Simple; my $DEBUG= 1; sub fetch { my $ua= shift; my $url= shift; my $cache_file= shift; my $max_age= shift; my ($xmlref, $xml); my $use_cache_file= 0; if (defined ($cache_file) && -f $cache_file # TODO: check age too! ) { $use_cache_file= 1; if (defined ($max_age)) { my @st= stat $cache_file; $use_cache_file= 0 if ($st[9] + $max_age <= time ()); print __FILE__, ' ', __LINE__, " cache: mtime=$st[9] max_age=$max_age use=$use_cache_file file=[$cache_file]\n"; } } if ($use_cache_file) { open (FI, '<:utf8', $cache_file); while (<FI>) { $xml .= $_ }; $xmlref= XMLin($xml, ForceContent => 1, ForceArray => 1); # TODO: if the file is not ok, ignore the cached file and refetch return ($xmlref, $xml); } print __LINE__, " fetch_xml_file: url=[$url]\n"; my $res= $ua->get ($url); unless ($res->is_success) { print "ERROR: Aleph-XML-Query (find) failed: ", $res->status_line, "\n"; return undef; } $xml= $res->decoded_content; print __LINE__, " get_aleph_metadata: xml=[$xml]\n" if ($DEBUG >= 0); if (defined ($cache_file)) { if (open (FO, '>:utf8', $cache_file)) { print "saving to [$cache_file]\n"; $xml=~ s#<session-id>[\w\d]+</session-id>#<session-id>dummy-session-id</session-id>#; print FO $xml; close (FO); } # TODO: else report that we can not write to the cache as we should } $xmlref= XMLin ($xml, ForceContent => 1, ForceArray => 1, KeyAttr => [ ] ); print __LINE__, " xmlref: ", main::Dumper ($xmlref) if ($DEBUG >= 0); return ($xmlref, $xml); } 1; |
|
From: Gerhard G. <go...@us...> - 2017-08-01 16:27:33
|
Update of /cvsroot/aix-pm/modules/util/Util/XML In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23098/modules/util/Util/XML Log Message: Directory /cvsroot/aix-pm/modules/util/Util/XML added to the repository |
|
From: Gerhard G. <go...@us...> - 2017-03-26 05:35:51
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18170/modules/util/Util Modified Files: Matrix.pm Log Message: add function to print array of hash refs too Index: Matrix.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/Matrix.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Matrix.pm 19 May 2016 09:24:59 -0000 1.11 --- Matrix.pm 26 Mar 2017 05:35:49 -0000 1.12 *************** *** 19,22 **** --- 19,24 ---- =head2 print ($column_names, $data) + $data = ref to array of arrays + =cut *************** *** 83,86 **** --- 85,110 ---- } + =head2 print_hash ($column_names, $data) + + $data = ref to array of hashes + + =cut + + sub print_hash + { + my $column_names= shift; + my $rows= shift; + my $fh= shift || *STDOUT; + + my @d; + foreach my $row (@$rows) + { + push (@d, [ map { $row->{$_} } @$column_names ]); + } + # print "d: ", main::Dumper (\@d); + + Util::Matrix::print ($column_names, \@d, $fh); + } + sub set_border_style { |
|
From: Gerhard G. <go...@us...> - 2017-02-02 11:09:13
|
Update of /cvsroot/aix-pm/modules/util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18975 Modified Files: csv.pl Log Message: added option -O Index: csv.pl =================================================================== RCS file: /cvsroot/aix-pm/modules/util/csv.pl,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** csv.pl 16 Jan 2017 20:02:11 -0000 1.48 --- csv.pl 2 Feb 2017 11:09:10 -0000 1.49 *************** *** 139,142 **** --- 139,143 ---- elsif ($arg =~ /^-B(.*)$/) { Util::Matrix::set_border_style ($1); } elsif ($arg =~ /^-H(.*)$/) { Util::Matrix::set_header_style ($1); } + elsif ($arg =~ /^-O(.+)$/) { $out_file= $1; } elsif ($arg =~ /^-(.+)/) { |
|
From: Gerhard G. <go...@us...> - 2017-01-16 20:02:13
|
Update of /cvsroot/aix-pm/modules/util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17797/modules/util Modified Files: csv.pl Log Message: avoid noise on stdout Index: csv.pl =================================================================== RCS file: /cvsroot/aix-pm/modules/util/csv.pl,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** csv.pl 10 Oct 2016 00:20:25 -0000 1.47 --- csv.pl 16 Jan 2017 20:02:11 -0000 1.48 *************** *** 304,308 **** $d= $csv->get_columns (@columns); my $lines= Util::Matrix::save_as_csv (\@columns, $d, $out_file, ((defined ($CSV_OUT_SEP)) ? $CSV_OUT_SEP : $CSV_SEP), undef, undef, $UTF8); ! print "$lines saved to $out_file\n"; $out_file= undef; } --- 304,308 ---- $d= $csv->get_columns (@columns); my $lines= Util::Matrix::save_as_csv (\@columns, $d, $out_file, ((defined ($CSV_OUT_SEP)) ? $CSV_OUT_SEP : $CSV_SEP), undef, undef, $UTF8); ! print STDERR "$lines saved to $out_file\n"; $out_file= undef; } |
|
From: Gerhard G. <go...@us...> - 2017-01-05 15:48:09
|
Update of /cvsroot/aix-pm/hacks/linux/lvm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23813 Modified Files: chfs.pl Log Message: deal with lv or vg names with dashes Index: chfs.pl =================================================================== RCS file: /cvsroot/aix-pm/hacks/linux/lvm/chfs.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** chfs.pl 28 Jan 2013 10:26:45 -0000 1.5 --- chfs.pl 5 Jan 2017 15:48:06 -0000 1.6 *************** *** 85,91 **** my $lv_name; ! if ($dv =~ m#/dev/mapper/([\w]+)-([\w]+)$#) { my ($vg, $lv)= ($1, $2); $lv_name= join ('/', '/dev', $vg, $lv); } --- 85,96 ---- my $lv_name; ! print "# dv=[$dv]\n"; ! $dv=~ s/--/=/g; ! if ($dv =~ m#/dev/mapper/([\w=]+)-([\w=]+)$#) { my ($vg, $lv)= ($1, $2); + $vg=~ s/=/-/g; + $lv=~ s/=/-/g; + print "# vg=[$vg] lv=[$lv]\n"; $lv_name= join ('/', '/dev', $vg, $lv); } |
|
From: Gerhard G. <go...@us...> - 2016-12-23 12:05:00
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6390 Modified Files: Monitoring.pm Log Message: this module uses DateTime Index: Monitoring.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/Monitoring.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Monitoring.pm 24 Aug 2016 03:41:27 -0000 1.6 --- Monitoring.pm 23 Dec 2016 12:04:58 -0000 1.7 *************** *** 8,11 **** --- 8,12 ---- use Data::Dumper; + use DateTime; use Util::JSON; |
|
From: Gerhard G. <go...@us...> - 2016-11-18 08:42:32
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29115/modules/util/Util Added Files: JSON_Debug.pm Log Message: variation of JSON module for debugging the json file --- NEW FILE: JSON_Debug.pm --- package Util::JSON_Debug; use strict; use JSON -convert_blessed_universally; use Util::hexdump; sub read_json_file { my $fnm= shift; # BEGIN load JSON data from file content local $/; # print "reading config [$fnm]\n"; open( my $fh, '<:utf8', $fnm ) or return undef; my $json_text = <$fh>; close ($fh); my $json; eval { $json= decode_json( $json_text ); }; if ($@) { my $e= $@; print "Error: [$e]\n"; if ($e =~ m#malformed UTF-8 character in JSON string, at character offset (\d+)#) { my $pos= $1; my $start= 0x100 * int ($pos/0x100); my $off= $pos-$start; printf ("pos=%d 0x%04x start=0x%04x off=0x%04x\n", $pos, $pos, $start, $off); my $data= substr ($json_text, $start, 0x200); hexdump ($data); } } $json; } 1; __END__ =head1 AUTHOR Gerhard Gonter <gg...@cp...> |
|
From: Gerhard G. <go...@us...> - 2016-10-16 09:41:49
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10089/Util Modified Files: Simple_CSV.pm Log Message: disabled debug code Index: Simple_CSV.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/Simple_CSV.pm,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Simple_CSV.pm 10 Oct 2016 00:20:25 -0000 1.51 --- Simple_CSV.pm 16 Oct 2016 09:41:47 -0000 1.52 *************** *** 758,762 **** my $obj= shift; my %par= @_; ! print __LINE__, "par: ", main::Dumper (\%par); my $fnm= $par{'filename'}; --- 758,762 ---- my $obj= shift; my %par= @_; ! # print __LINE__, "par: ", main::Dumper (\%par); my $fnm= $par{'filename'}; *************** *** 791,795 **** my $sep= $par{'separator'} || $obj->{'separator'} || $CSV_SEPARATOR; my $eol= $par{'line_end'} || $obj->{'line_end'} || $CSV_LINE_END; ! print __LINE__, "sep=[$sep]\n"; my @columns= @{$obj->{'columns'}}; --- 791,795 ---- my $sep= $par{'separator'} || $obj->{'separator'} || $CSV_SEPARATOR; my $eol= $par{'line_end'} || $obj->{'line_end'} || $CSV_LINE_END; ! # print __LINE__, "sep=[$sep]\n"; my @columns= @{$obj->{'columns'}}; |
|
From: Gerhard G. <go...@us...> - 2016-10-10 00:20:27
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11343/modules/util/Util Modified Files: Simple_CSV.pm Log Message: CSV Separator Index: Simple_CSV.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/Simple_CSV.pm,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Simple_CSV.pm 26 Aug 2016 21:01:20 -0000 1.50 --- Simple_CSV.pm 10 Oct 2016 00:20:25 -0000 1.51 *************** *** 758,761 **** --- 758,762 ---- my $obj= shift; my %par= @_; + print __LINE__, "par: ", main::Dumper (\%par); my $fnm= $par{'filename'}; *************** *** 790,793 **** --- 791,795 ---- my $sep= $par{'separator'} || $obj->{'separator'} || $CSV_SEPARATOR; my $eol= $par{'line_end'} || $obj->{'line_end'} || $CSV_LINE_END; + print __LINE__, "sep=[$sep]\n"; my @columns= @{$obj->{'columns'}}; |
|
From: Gerhard G. <go...@us...> - 2016-09-26 06:59:11
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21478/modules/util/Util Modified Files: MongoDB.pm Log Message: renamed "connect_mongodb()" to "attach()", hope that is better Index: MongoDB.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/MongoDB.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MongoDB.pm 22 Sep 2016 13:41:29 -0000 1.17 --- MongoDB.pm 26 Sep 2016 06:59:09 -0000 1.18 *************** *** 32,48 **** my $self= shift; my $col_name= shift; my $mdb= $self->{_mdb}; if (defined ($mdb)) { return $mdb unless (defined ($col_name)); ! my $col= $self->{_col}->{$col_name}; return ($mdb, $col) if (defined ($col)); } else { ! $mdb= Util::MongoDB::connect ($self->{MongoDB}); } --- 32,58 ---- my $self= shift; my $col_name= shift; + + print STDERR join (' ', caller()), " using connect_mongodb() is deprecated, uses attach() instead!\n"; + attach ($self, $col_name); + } + + sub attach + { + my $self= shift; + my $col_name= shift; my $mdb= $self->{_mdb}; + my $col; if (defined ($mdb)) { return $mdb unless (defined ($col_name)); ! $col= $self->{_col}->{$col_name}; return ($mdb, $col) if (defined ($col)); } else { ! ($mdb, $col)= Util::MongoDB::connect ($self->{MongoDB}); } *************** *** 65,69 **** else { ! print "ATTN: can not gget collection '$col_name'\n"; } --- 75,79 ---- else { ! print "ATTN: can not get collection '$col_name'\n"; } *************** *** 106,110 **** ['db_name', 'db', 'database'], 'collection') { - if ($k1 eq 'collection') { --- 116,119 ---- |
|
From: Gerhard G. <go...@us...> - 2016-09-22 13:41:31
|
Update of /cvsroot/aix-pm/modules/util/Util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28184/Util Modified Files: MongoDB.pm Log Message: add object code to be able to use this module as a base class for other packages that need MongoDB Index: MongoDB.pm =================================================================== RCS file: /cvsroot/aix-pm/modules/util/Util/MongoDB.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MongoDB.pm 2 Aug 2016 16:51:17 -0000 1.16 --- MongoDB.pm 22 Sep 2016 13:41:29 -0000 1.17 *************** *** 6,9 **** --- 6,84 ---- use MongoDB; + use Data::Dumper; + + sub new + { + my $class= shift; + + my $obj= bless {}, $class; + $obj->set (@_); + $obj; + } + + sub set + { + my $obj= shift; + my %par= @_; + + foreach my $par (keys %par) + { + $obj->{$par}= $par{$par}; + } + } + + sub connect_mongodb + { + my $self= shift; + my $col_name= shift; + + my $mdb= $self->{_mdb}; + + if (defined ($mdb)) + { + return $mdb unless (defined ($col_name)); + + my $col= $self->{_col}->{$col_name}; + return ($mdb, $col) if (defined ($col)); + } + else + { + $mdb= Util::MongoDB::connect ($self->{MongoDB}); + } + + unless (defined ($mdb)) + { + print "ATTN: can not connect to MongoDB: ", Dumper ($mdb); + return undef; + } + + $self->{_mdb}= $mdb; + + return $mdb unless (defined ($col_name)); + + my $col= $mdb->get_collection ($col_name); + + if (defined ($col)) + { + $self->{_col}->{$col_name}= $col; + } + else + { + print "ATTN: can not gget collection '$col_name'\n"; + } + + ($mdb, $col); + } + + sub disconnect_mongodb + { + my $self= shift; + + if (exists ($self->{_mdb})) + { + delete ($self->{_mdb}); + delete ($self->{_col}); + } + } =head2 my ($mongo_db, $mongo_col)= Util::MongoDB::connect ($config, $col_name) *************** *** 78,82 **** { DIE: ! die "could not connect to MongoDB: ", main::Dumper ($mdb); } --- 153,157 ---- { DIE: ! die "could not connect to MongoDB: ", Dumper ($mdb); } *************** *** 90,97 **** if ($r eq 'auth fails') { ! die "auth fails; MongoDB: ", main::Dumper ($mdb); } ! # print "authentication: r=[$r] ", main::Dumper ($r); } --- 165,172 ---- if ($r eq 'auth fails') { ! die "auth fails; MongoDB: ", Dumper ($mdb); } ! # print "authentication: r=[$r] ", Dumper ($r); } *************** *** 101,110 **** my $db= $m->get_database ($c{'db_name'}); goto DIE unless (defined ($db)); ! # print "db=[$db] ", main::Dumper ($db); return $db unless (defined ($col_name)); my $col= $db->get_collection ($col_name); ! # print "col=[$col] ", main::Dumper ($col); return ($db, $col); --- 176,185 ---- my $db= $m->get_database ($c{'db_name'}); goto DIE unless (defined ($db)); ! # print "db=[$db] ", Dumper ($db); return $db unless (defined ($col_name)); my $col= $db->get_collection ($col_name); ! # print "col=[$col] ", Dumper ($col); return ($db, $col); *************** *** 128,132 **** my $par_wanted_columns= shift; ! # print "wanted_columns: ", main::Dumper ($wanted_columns); my $wanted_columns; my $cnt_wanted_columns= 0; --- 203,207 ---- my $par_wanted_columns= shift; ! # print "wanted_columns: ", Dumper ($wanted_columns); my $wanted_columns; my $cnt_wanted_columns= 0; *************** *** 145,149 **** } ! # print "wanted_columns: ", main::Dumper (\%wanted_columns); } --- 220,224 ---- } ! # print "wanted_columns: ", Dumper (\%wanted_columns); } *************** *** 155,159 **** while (my $row= $cursor->next()) { ! # print "row: ", main::Dumper ($row); my %new_row; foreach my $f (keys %$row) --- 230,234 ---- while (my $row= $cursor->next()) { ! # print "row: ", Dumper ($row); my %new_row; foreach my $f (keys %$row) *************** *** 168,172 **** $has_columns{$f}++; } ! # print "new_row: ", main::Dumper (\%new_row); push (@data, \%new_row); } --- 243,247 ---- $has_columns{$f}++; } ! # print "new_row: ", Dumper (\%new_row); push (@data, \%new_row); } *************** *** 238,243 **** my $s= shift; ! # print "array: target:", main::Dumper ($t); ! # print "array: source:", main::Dumper ($s); my $upd= 0; --- 313,318 ---- my $s= shift; ! # print "array: target:", Dumper ($t); ! # print "array: source:", Dumper ($s); my $upd= 0; |
|
From: Gerhard G. <go...@us...> - 2016-09-22 13:39:58
|
Update of /cvsroot/aix-pm/modules/util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28102 Modified Files: csv.pl Log Message: add option 'select' as an alias for 'search' which was not such a good name Index: csv.pl =================================================================== RCS file: /cvsroot/aix-pm/modules/util/csv.pl,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** csv.pl 13 Sep 2016 11:52:19 -0000 1.45 --- csv.pl 22 Sep 2016 13:39:56 -0000 1.46 *************** *** 110,114 **** elsif ($opt eq 'out') { $out_file= $val || shift (@ARGV); } elsif ($opt eq 'find') { $find_pattern= $val || shift (@ARGV); } # TODO: allow multiple patterns! ! elsif ($opt eq 'search') { $search_string= $val || shift (@ARGV); } # TODO: allow multiple searches! elsif ($opt eq 'max') { $max_items= $val || shift (@ARGV); } elsif ($opt eq 'hdr') { $view= 'header'; } --- 110,117 ---- elsif ($opt eq 'out') { $out_file= $val || shift (@ARGV); } elsif ($opt eq 'find') { $find_pattern= $val || shift (@ARGV); } # TODO: allow multiple patterns! ! elsif ($opt eq 'search' || $opt eq 'select') ! { # TODO: allow multiple searches! ! $search_string= $val || shift (@ARGV); ! } elsif ($opt eq 'max') { $max_items= $val || shift (@ARGV); } elsif ($opt eq 'hdr') { $view= 'header'; } |
|
From: Gerhard G. <go...@us...> - 2016-09-13 11:52:21
|
Update of /cvsroot/aix-pm/modules/util In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32330/modules/util Modified Files: csv.pl Log Message: undocumented commandline option "--max" Index: csv.pl =================================================================== RCS file: /cvsroot/aix-pm/modules/util/csv.pl,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** csv.pl 26 Aug 2016 21:01:20 -0000 1.44 --- csv.pl 13 Sep 2016 11:52:19 -0000 1.45 *************** *** 59,62 **** --- 59,66 ---- --TAB .. switch to TSV mode + =head2 --max <num> + + only display this many items + =cut |