Author: timbo
Date: Wed Feb 7 03:36:40 2007
New Revision: 8812
Modified:
dbi/trunk/Makefile.PL (contents, props changed)
dbi/trunk/dbiprof.PL (contents, props changed)
dbi/trunk/dbiproxy.PL (contents, props changed)
dbi/trunk/dumpmethods.pl (props changed)
dbi/trunk/ex/perl_dbi_nulls_test.pl (props changed)
dbi/trunk/ex/profile.pl (props changed)
dbi/trunk/lib/DBD/Gofer/Transport/stream.pm (contents, props changed)
dbi/trunk/lib/DBI/Gofer/Transport/stream.pm (contents, props changed)
dbi/trunk/lib/DBI/Util/_accessor.pm (contents, props changed)
dbi/trunk/test.pl (props changed)
Log:
Add usage info to dbiprof
Add svn:keywords to more files.
Modified: dbi/trunk/Makefile.PL
==============================================================================
--- dbi/trunk/Makefile.PL (original)
+++ dbi/trunk/Makefile.PL Wed Feb 7 03:36:40 2007
@@ -305,7 +305,9 @@
$(CP) Roadmap.pod $(roadmap_pm)
checkkeywords:
- find lib -type f -name .svn -prune -o -name \*.pm -exec bash -c '[ -z
"$$(svn pg svn:keywords {})" ] && echo svn propset svn:keywords \"Id Revision\"
{}' \;
+ $(RM_F) blib
+ find . -type f \( -name .svn -prune -o -name \*.pm -o -name \*.PL -o
-name \*.pl \) \
+ -exec bash -c '[ -z "$$(svn pg svn:keywords {})" ] && echo svn
propset svn:keywords \"Id Revision\" {}' \;
};
return $xst;
Modified: dbi/trunk/dbiprof.PL
==============================================================================
--- dbi/trunk/dbiprof.PL (original)
+++ dbi/trunk/dbiprof.PL Wed Feb 7 03:36:40 2007
@@ -7,7 +7,7 @@
use strict;
-my $VERSION = "1.0";
+my $VERSION = sprintf("1.%06d", q$Revision$ =~ /(\d+)/o);
use DBI::ProfileData;
use Getopt::Long;
@@ -22,14 +22,38 @@
# get options from command line
GetOptions(
- 'version' => sub { die "dbiprof $VERSION\n"; },
+ 'version' => sub { die "dbiprof $VERSION\n" },
+ 'help' => sub { exit usage() },
'number=i' => \$number,
'sort=s' => \$sort,
'reverse' => \$reverse,
'match=s' => \%match,
'exclude=s' => \%exclude,
'case-sensitive' => \$case_sensitive,
- );
+) or exit usage();
+
+sub usage {
+ print <<EOS;
+dbiprof [options] [files]
+
+Merges DBI profile data contain in files and prints a summary.
+
+files: defaults to $filename
+
+options:
+
+ -number=N show top N, defaults to $number
+ -sort=S sort by S, defaults to $sort
+ -reverse reverse the sort
+ -match=K=V for filtering, see docs
+ -exclude=K=V for filtering, see docs
+ -case_sensitive for -match and -exclude
+ -version print version number and exit
+ -help print this help
+
+EOS
+ return 1;
+}
# list of files defaults to dbi.prof
my @files = @ARGV ? @ARGV : ('dbi.prof');
@@ -40,20 +64,22 @@
eval { $prof = DBI::ProfileData->new(Files => [EMAIL PROTECTED]) };
die "Unable to load profile data: [EMAIL PROTECTED]" if $@;
-# handle matches
-while (my ($key, $val) = each %match) {
- if ($val =~ m!^/(.+)/$!) {
- $val = $case_sensitive ? qr/$1/ : qr/$1/i;
- }
- $prof->match($key, $val, case_sensitive => $case_sensitive);
+if (%match) { # handle matches
+ while (my ($key, $val) = each %match) {
+ if ($val =~ m!^/(.+)/$!) {
+ $val = $case_sensitive ? qr/$1/ : qr/$1/i;
+ }
+ $prof->match($key, $val, case_sensitive => $case_sensitive);
+ }
}
-# handle excludes
-while (my ($key, $val) = each %exclude) {
- if ($val =~ m!^/(.+)/$!) {
- $val = $case_sensitive ? qr/$1/ : qr/$1/i;
- }
- $prof->exclude($key, $val, case_sensitive => $case_sensitive);
+if (%exclude) { # handle excludes
+ while (my ($key, $val) = each %exclude) {
+ if ($val =~ m!^/(.+)/$!) {
+ $val = $case_sensitive ? qr/$1/ : qr/$1/i;
+ }
+ $prof->exclude($key, $val, case_sensitive => $case_sensitive);
+ }
}
# sort the data
Modified: dbi/trunk/dbiproxy.PL
==============================================================================
--- dbi/trunk/dbiproxy.PL (original)
+++ dbi/trunk/dbiproxy.PL Wed Feb 7 03:36:40 2007
@@ -7,6 +7,8 @@
use strict;
+my $VERSION = sprintf("1.%06d", q$Revision$ =~ /(\d+)/o);
+
my $arg_test = shift(@ARGV) if $ARGV[0] eq '--test';
$ENV{DBI_TRACE} = shift(@ARGV) || 2 if $ARGV[0] =~ s/^--dbitrace=?//;
Modified: dbi/trunk/lib/DBD/Gofer/Transport/stream.pm
==============================================================================
--- dbi/trunk/lib/DBD/Gofer/Transport/stream.pm (original)
+++ dbi/trunk/lib/DBD/Gofer/Transport/stream.pm Wed Feb 7 03:36:40 2007
@@ -1,6 +1,6 @@
package DBD::Gofer::Transport::stream;
-# $Id: pipeone.pm 8748 2007-01-29 22:49:42Z timbo $
+# $Id$
#
# Copyright (c) 2007, Tim Bunce, Ireland
#
@@ -15,7 +15,7 @@
use base qw(DBD::Gofer::Transport::pipeone);
-our $VERSION = sprintf("0.%06d", q$Revision: 8748 $ =~ /(\d+)/o);
+our $VERSION = sprintf("0.%06d", q$Revision$ =~ /(\d+)/o);
__PACKAGE__->mk_accessors(qw(
));
Modified: dbi/trunk/lib/DBI/Gofer/Transport/stream.pm
==============================================================================
--- dbi/trunk/lib/DBI/Gofer/Transport/stream.pm (original)
+++ dbi/trunk/lib/DBI/Gofer/Transport/stream.pm Wed Feb 7 03:36:40 2007
@@ -1,6 +1,6 @@
package DBI::Gofer::Transport::stream;
-# $Id: stream.pm 8748 2007-01-29 22:49:42Z timbo $
+# $Id$
#
# Copyright (c) 2007, Tim Bunce, Ireland
#
@@ -14,7 +14,7 @@
use base qw(DBI::Gofer::Transport::pipeone Exporter);
-our $VERSION = sprintf("0.%06d", q$Revision: 8748 $ =~ /(\d+)/o);
+our $VERSION = sprintf("0.%06d", q$Revision$ =~ /(\d+)/o);
our @EXPORT = qw(run_stdio_hex);
Modified: dbi/trunk/lib/DBI/Util/_accessor.pm
==============================================================================
--- dbi/trunk/lib/DBI/Util/_accessor.pm (original)
+++ dbi/trunk/lib/DBI/Util/_accessor.pm Wed Feb 7 03:36:40 2007
@@ -1,6 +1,6 @@
package DBI::Util::_accessor;
use strict;
-our $VERSION = sprintf("0.%06d", q$Revision: 8696 $ =~ /(\d+)/);
+our $VERSION = sprintf("0.%06d", q$Revision$ =~ /(\d+)/);
# heavily cut-down (but compatible) version of Class::Accessor::Fast to avoid
the dependency