aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgirgen <girgen@FreeBSD.org>2013-01-10 00:01:54 +0800
committergirgen <girgen@FreeBSD.org>2013-01-10 00:01:54 +0800
commitb9c2a2b38fa91b2bc8e94e167e2e15440e4c2872 (patch)
treee224c804e872f8a15d6687161f121b1488166900
parent6578093fbcace44f0c50a44932172e7f9f173533 (diff)
downloadfreebsd-ports-gnome-b9c2a2b38fa91b2bc8e94e167e2e15440e4c2872.tar.gz
freebsd-ports-gnome-b9c2a2b38fa91b2bc8e94e167e2e15440e4c2872.tar.zst
freebsd-ports-gnome-b9c2a2b38fa91b2bc8e94e167e2e15440e4c2872.zip
add patch to accept bzip2 log files
-rw-r--r--databases/pgbadger/Makefile1
-rw-r--r--databases/pgbadger/files/patch-bzip-size49
2 files changed, 50 insertions, 0 deletions
diff --git a/databases/pgbadger/Makefile b/databases/pgbadger/Makefile
index eeaaebe63ac3..ca0f8256e85b 100644
--- a/databases/pgbadger/Makefile
+++ b/databases/pgbadger/Makefile
@@ -3,6 +3,7 @@
PORTNAME= pgbadger
PORTVERSION= 2.2
+PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= http://cloud.github.com/downloads/dalibo/pgbadger/
DISTFILES= ${DISTNAME}-1${EXTRACT_SUFX}
diff --git a/databases/pgbadger/files/patch-bzip-size b/databases/pgbadger/files/patch-bzip-size
new file mode 100644
index 000000000000..99b0ed4a32bc
--- /dev/null
+++ b/databases/pgbadger/files/patch-bzip-size
@@ -0,0 +1,49 @@
+--- /usr/local/bin/pgbadger 2013-01-09 16:38:48.000000000 +0100
++++ pgbadger 2013-01-09 16:42:11.000000000 +0100
+@@ -51,6 +51,7 @@
+ my $bzcat = 'bunzip2 -c';
+ my $ucat = 'unzip -p';
+ my $uncompress_size = "gunzip -l %f | grep -E '^\\s*[0-9]+' | awk '{print \$2}'";
++my $uncompress_size_bz2 = "$bzcat %f | wc -c";
+ my $format = '';
+ my $outfile = '';
+ my $outdir = '';
+@@ -536,8 +537,10 @@
+ open($io, "<", $logfile) or die "FATAL: cannot read csvlog file $logfile. $!\n";
+ } else {
+ my $uncompress = $zcat;
++ my $cmd_file_size = $uncompress_size;
+ if (($logfile =~ /\.bz2/i) && ($zcat =~ /^zcat$/)) {
+ $uncompress = $bzcat;
++ $cmd_file_size = $uncompress_size_bz2;
+ } elsif (($logfile =~ /\.zip/i) && ($zcat =~ /^zcat$/)) {
+ $uncompress = $ucat;
+ }
+@@ -545,7 +548,7 @@
+ open($io, "$uncompress $logfile |") or die "FATAL: cannot open pipe to $uncompress $logfile. $!\n";
+
+ # Real size of the file is unknow, try to find it
+- my $cmd_file_size = $uncompress_size;
++ &logmsg("INFO", "$cmd_file_size");
+ $cmd_file_size =~ s/\%f/$logfile/g;
+ $totalsize = `$cmd_file_size`;
+ chomp($totalsize);
+@@ -646,8 +649,10 @@
+ } else {
+
+ my $uncompress = $zcat;
++ my $cmd_file_size = $uncompress_size;
+ if (($logfile =~ /\.bz2/i) && ($zcat =~ /^zcat$/)) {
+ $uncompress = $bzcat;
++ $cmd_file_size = $uncompress_size_bz2;
+ } elsif (($logfile =~ /\.zip/i) && ($zcat =~ /^zcat$/)) {
+ $uncompress = $ucat;
+ }
+@@ -657,7 +662,6 @@
+ $lfile->open("$uncompress $logfile |") || die "FATAL: cannot read from pipe to $uncompress $logfile. $!\n";
+
+ # Real size of the file is unknow, try to find it
+- my $cmd_file_size = $uncompress_size;
+ $cmd_file_size =~ s/\%f/$logfile/g;
+ $totalsize = `$cmd_file_size`;
+ chomp($totalsize);