r2404 - in packages/libpdf-report-perl/trunk: . debian
debian/patches examples
Niko Tyni
ntyni-guest at costa.debian.org
Fri Mar 17 20:25:53 UTC 2006
Author: ntyni-guest
Date: 2006-03-17 20:25:52 +0000 (Fri, 17 Mar 2006)
New Revision: 2404
Added:
packages/libpdf-report-perl/trunk/debian/patches/
packages/libpdf-report-perl/trunk/debian/patches/00list
packages/libpdf-report-perl/trunk/debian/patches/10scale.dpatch
packages/libpdf-report-perl/trunk/debian/patches/20pod.dpatch
packages/libpdf-report-perl/trunk/debian/patches/30examples.dpatch
packages/libpdf-report-perl/trunk/debian/patches/40warnings.dpatch
Modified:
packages/libpdf-report-perl/trunk/Report.pm
packages/libpdf-report-perl/trunk/debian/changelog
packages/libpdf-report-perl/trunk/debian/control
packages/libpdf-report-perl/trunk/debian/rules
packages/libpdf-report-perl/trunk/examples/barcode
packages/libpdf-report-perl/trunk/examples/footer
packages/libpdf-report-perl/trunk/examples/openpdf
packages/libpdf-report-perl/trunk/examples/paragraph
packages/libpdf-report-perl/trunk/examples/piegraph
packages/libpdf-report-perl/trunk/examples/rotate
Log:
* migrate to dpatch
* fix 'uninitialized value' warnings
Modified: packages/libpdf-report-perl/trunk/Report.pm
===================================================================
--- packages/libpdf-report-perl/trunk/Report.pm 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/Report.pm 2006-03-17 20:25:52 UTC (rev 2404)
@@ -67,8 +67,6 @@
=head1 METHODS
-=over 4
-
=item my $pdf = new PDF::Report(%opts);
Creates a new pdf report object.
@@ -272,32 +270,30 @@
}
-=pod
-
-PDF::API2 Removes all space between every word in the string you pass
+=item PDF::API2 Removes all space between every word in the string you pass
and then rejoins each word with one space. If you want to use a string with
more than one space between words for formatting purposes, you can either use
the hack below or change PDF::API2 (that's what I did ;). The code below may
or may not work according to what font you are using. I used 2 \xA0 per space
because that worked for the Helvetica font I was using.
-B<To use a fixed width string with more than one space between words, you can do something like:>
+=item B<To use a fixed width string with more than one space between words, you can do something like:>
- sub replaceSpace {
- my $text = shift;
- my $nbsp = "\xA0";
- my $new = '';
- my @words = split(/ /, $text);
- foreach my $word (@words) {
- if (length($word)) {
- $new.=$word . ' ';
- } else {
- $new.=$nbsp . $nbsp;
- }
- }
- chop($new);
- return $new;
+sub replaceSpace {
+ my $text = shift;
+ my $nbsp = "\xA0";
+ my $new = '';
+ my @words = split(/ /, $text);
+ foreach my $word (@words) {
+ if (length($word)) {
+ $new.=$word . ' ';
+ } else {
+ $new.=$nbsp . $nbsp;
}
+ }
+ chop($new);
+ return $new;
+}
=cut
@@ -922,7 +918,7 @@
$gfx->fillcolor('#ffffff');
$gfx->linewidth(0.1);
$gfx->fill;
- $gfx->formimage($bar,0,0,$scale);
+ $gfx->formimage($bar,0,0);
$gfx->restore;
}
@@ -1074,10 +1070,6 @@
}
### END GLOBAL SUBS ###########################################################
-=back
-
-=cut
-
### PRIVATE SUBS ##############################################################
sub gen_page_footer {
my $self = shift;
Modified: packages/libpdf-report-perl/trunk/debian/changelog
===================================================================
--- packages/libpdf-report-perl/trunk/debian/changelog 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/debian/changelog 2006-03-17 20:25:52 UTC (rev 2404)
@@ -1,3 +1,12 @@
+libpdf-report-perl (1.30-4) unstable; urgency=low
+
+ * Migrate to dpatch.
+ * debian/patches/40warnings:
+ + fix several 'Use of uninitialized value' warnings. (Closes: #354679)
+ * Move debhelper to Build-Depends, since it's required for 'clean'.
+
+ -- Niko Tyni <ntyni at iki.fi> Fri, 17 Mar 2006 22:21:12 +0200
+
libpdf-report-perl (1.30-3) unstable; urgency=low
* Scale barcodes correctly. Thanks, jim at short.circuit.com.
Modified: packages/libpdf-report-perl/trunk/debian/control
===================================================================
--- packages/libpdf-report-perl/trunk/debian/control 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/debian/control 2006-03-17 20:25:52 UTC (rev 2404)
@@ -1,7 +1,8 @@
Source: libpdf-report-perl
Section: perl
Priority: optional
-Build-Depends-Indep: debhelper (>= 4.0.0), perl (>= 5.8.0), libpdf-api2-perl (>=0.2.3.8)
+Build-Depends: debhelper (>= 4.0.0), dpatch (>= 2.0.9)
+Build-Depends-Indep: perl (>= 5.8.0), libpdf-api2-perl (>=0.2.3.8)
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Gunnar Wolf <gwolf at debian.org>, Allard Hoeve <allard at byte.nl>, Niko Tyni <ntyni at iki.fi>, Russ Allbery <rra at debian.org>
Standards-Version: 3.6.2
Added: packages/libpdf-report-perl/trunk/debian/patches/00list
===================================================================
--- packages/libpdf-report-perl/trunk/debian/patches/00list 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/debian/patches/00list 2006-03-17 20:25:52 UTC (rev 2404)
@@ -0,0 +1,4 @@
+10scale
+20pod
+30examples
+40warnings
Added: packages/libpdf-report-perl/trunk/debian/patches/10scale.dpatch
===================================================================
--- packages/libpdf-report-perl/trunk/debian/patches/10scale.dpatch 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/debian/patches/10scale.dpatch 2006-03-17 20:25:52 UTC (rev 2404)
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10scale.dpatch by Niko Tyni <ntyni at iki.fi>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Scale barcodes correctly. (#343937)
+## DP: Originally by <jim at short.circuit.com>.
+
+ at DPATCH@
+diff -urNad libpdf-report-perl-1.30-4~/Report.pm libpdf-report-perl-1.30-4/Report.pm
+--- libpdf-report-perl-1.30-4~/Report.pm 2006-03-17 22:10:27.000000000 +0200
++++ libpdf-report-perl-1.30-4/Report.pm 2006-03-17 22:15:50.634471069 +0200
+@@ -918,7 +918,7 @@
+ $gfx->fillcolor('#ffffff');
+ $gfx->linewidth(0.1);
+ $gfx->fill;
+- $gfx->formimage($bar,0,0);
++ $gfx->formimage($bar,0,0,$scale);
+ $gfx->restore;
+ }
+
Property changes on: packages/libpdf-report-perl/trunk/debian/patches/10scale.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Added: packages/libpdf-report-perl/trunk/debian/patches/20pod.dpatch
===================================================================
--- packages/libpdf-report-perl/trunk/debian/patches/20pod.dpatch 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/debian/patches/20pod.dpatch 2006-03-17 20:25:52 UTC (rev 2404)
@@ -0,0 +1,80 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20pod.dpatch by Niko Tyni <ntyni at iki.fi>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix some POD errors in the PDF::Report documentation.
+## DP: Originally by Russ Allbery <rra at debian.org>
+
+ at DPATCH@
+diff -urNad libpdf-report-perl-1.30-4~/Report.pm libpdf-report-perl-1.30-4/Report.pm
+--- libpdf-report-perl-1.30-4~/Report.pm 2006-03-17 22:14:21.946729018 +0200
++++ libpdf-report-perl-1.30-4/Report.pm 2006-03-17 22:14:22.025715428 +0200
+@@ -67,6 +67,8 @@
+
+ =head1 METHODS
+
++=over 4
++
+ =item my $pdf = new PDF::Report(%opts);
+
+ Creates a new pdf report object.
+@@ -270,30 +272,32 @@
+
+ }
+
+-=item PDF::API2 Removes all space between every word in the string you pass
++=pod
++
++PDF::API2 Removes all space between every word in the string you pass
+ and then rejoins each word with one space. If you want to use a string with
+ more than one space between words for formatting purposes, you can either use
+ the hack below or change PDF::API2 (that's what I did ;). The code below may
+ or may not work according to what font you are using. I used 2 \xA0 per space
+ because that worked for the Helvetica font I was using.
+
+-=item B<To use a fixed width string with more than one space between words, you can do something like:>
++B<To use a fixed width string with more than one space between words, you can do something like:>
+
+-sub replaceSpace {
+- my $text = shift;
+- my $nbsp = "\xA0";
+- my $new = '';
+- my @words = split(/ /, $text);
+- foreach my $word (@words) {
+- if (length($word)) {
+- $new.=$word . ' ';
+- } else {
+- $new.=$nbsp . $nbsp;
++ sub replaceSpace {
++ my $text = shift;
++ my $nbsp = "\xA0";
++ my $new = '';
++ my @words = split(/ /, $text);
++ foreach my $word (@words) {
++ if (length($word)) {
++ $new.=$word . ' ';
++ } else {
++ $new.=$nbsp . $nbsp;
++ }
++ }
++ chop($new);
++ return $new;
+ }
+- }
+- chop($new);
+- return $new;
+-}
+
+ =cut
+
+@@ -1070,6 +1074,10 @@
+ }
+ ### END GLOBAL SUBS ###########################################################
+
++=back
++
++=cut
++
+ ### PRIVATE SUBS ##############################################################
+ sub gen_page_footer {
+ my $self = shift;
Property changes on: packages/libpdf-report-perl/trunk/debian/patches/20pod.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Added: packages/libpdf-report-perl/trunk/debian/patches/30examples.dpatch
===================================================================
--- packages/libpdf-report-perl/trunk/debian/patches/30examples.dpatch 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/debian/patches/30examples.dpatch 2006-03-17 20:25:52 UTC (rev 2404)
@@ -0,0 +1,68 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 30examples.dpatch by Niko Tyni <ntyni at iki.fi>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix examples module paths for installation.
+## DP: Originally by Gunnar Wolf <gwolf at debian.org>
+
+ at DPATCH@
+diff -urNad libpdf-report-perl-1.30-4~/examples/barcode libpdf-report-perl-1.30-4/examples/barcode
+--- libpdf-report-perl-1.30-4~/examples/barcode 2006-03-17 22:10:27.000000000 +0200
++++ libpdf-report-perl-1.30-4/examples/barcode 2006-03-17 22:11:36.922106815 +0200
+@@ -1,4 +1,5 @@
+-require "../Report.pm";
++#!/usr/bin/perl
++use PDF::Report;
+
+ my $pdf = new PDF::Report(
+ PageSize => letter,
+diff -urNad libpdf-report-perl-1.30-4~/examples/footer libpdf-report-perl-1.30-4/examples/footer
+--- libpdf-report-perl-1.30-4~/examples/footer 2006-03-17 22:10:27.000000000 +0200
++++ libpdf-report-perl-1.30-4/examples/footer 2006-03-17 22:11:36.922106815 +0200
+@@ -1,4 +1,5 @@
+-require "../Report.pm";
++#!/usr/bin/perl
++use PDF::Report;
+
+ my $pdf = new PDF::Report(
+ PageSize => LETTER,
+diff -urNad libpdf-report-perl-1.30-4~/examples/openpdf libpdf-report-perl-1.30-4/examples/openpdf
+--- libpdf-report-perl-1.30-4~/examples/openpdf 2006-03-17 22:10:27.000000000 +0200
++++ libpdf-report-perl-1.30-4/examples/openpdf 2006-03-17 22:11:36.922106815 +0200
+@@ -1,4 +1,5 @@
+-require "../Report.pm";
++#!/usr/bin/perl
++use PDF::Report;
+
+ my $file = $ARGV[0];
+ print "Pass me a PDF file." if ! -e $file;
+diff -urNad libpdf-report-perl-1.30-4~/examples/paragraph libpdf-report-perl-1.30-4/examples/paragraph
+--- libpdf-report-perl-1.30-4~/examples/paragraph 2006-03-17 22:10:27.000000000 +0200
++++ libpdf-report-perl-1.30-4/examples/paragraph 2006-03-17 22:11:36.921106987 +0200
+@@ -1,4 +1,5 @@
+-require "../Report.pm";
++#!/usr/bin/perl
++use PDF::Report;
+
+ my $pdf = new PDF::Report(
+ PageSize => letter,
+diff -urNad libpdf-report-perl-1.30-4~/examples/piegraph libpdf-report-perl-1.30-4/examples/piegraph
+--- libpdf-report-perl-1.30-4~/examples/piegraph 2006-03-17 22:10:27.000000000 +0200
++++ libpdf-report-perl-1.30-4/examples/piegraph 2006-03-17 22:11:36.921106987 +0200
+@@ -1,4 +1,5 @@
+-require "../Report.pm";
++#!/usr/bin/perl
++use PDF::Report;
+
+ my $pdf = new PDF::Report(
+ PageSize => letter,
+diff -urNad libpdf-report-perl-1.30-4~/examples/rotate libpdf-report-perl-1.30-4/examples/rotate
+--- libpdf-report-perl-1.30-4~/examples/rotate 2006-03-17 22:10:27.000000000 +0200
++++ libpdf-report-perl-1.30-4/examples/rotate 2006-03-17 22:11:36.921106987 +0200
+@@ -1,4 +1,5 @@
+-require "../Report.pm";
++#!/usr/bin/perl
++use PDF::Report;
+
+ my $pdf = new PDF::Report(
+ PageSize => LETTER,
Property changes on: packages/libpdf-report-perl/trunk/debian/patches/30examples.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Added: packages/libpdf-report-perl/trunk/debian/patches/40warnings.dpatch
===================================================================
--- packages/libpdf-report-perl/trunk/debian/patches/40warnings.dpatch 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/debian/patches/40warnings.dpatch 2006-03-17 20:25:52 UTC (rev 2404)
@@ -0,0 +1,50 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40warnings.dpatch by Niko Tyni <ntyni at iki.fi>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix several 'use of uninitialized value' warnings. (#354679)
+
+ at DPATCH@
+diff -urNad libpdf-report-perl-1.30-4~/Report.pm libpdf-report-perl-1.30-4/Report.pm
+--- libpdf-report-perl-1.30-4~/Report.pm 2006-03-17 22:11:02.073099583 +0200
++++ libpdf-report-perl-1.30-4/Report.pm 2006-03-17 22:11:02.169083078 +0200
+@@ -149,7 +149,7 @@
+ __font_cache => {},
+ };
+
+- if (length($defaults{File})) {
++ if (defined $defaults{File} && length($defaults{File})) {
+ $self->{pdf} = PDF::API2->open($defaults{File})
+ or die "$defaults{File} not found: $!\n";
+
+@@ -256,9 +256,9 @@
+ sub addRawText {
+ my ( $self, $text, $x, $y, $color, $underline, $indent, $rotate ) = @_;
+
+- $color = undef if !length($color);
+- $underline = undef if !length($underline);
+- $indent = undef if !length($indent);
++ $color = undef if defined $color && !length($color);
++ $underline = undef if defined $underline && !length($underline);
++ $indent = undef if defined $indent && !length($indent);
+
+ my $txt = $self->{page}->text;
+ # $txt->font($self->{font}, $self->{size});
+@@ -440,7 +440,7 @@
+ }
+
+ # If $self->{vPos} is not set calculate it (on first text add)
+- if ( ($self->{vPos} == undef) || ($self->{vPos} == 0) ) {
++ if ( (!defined $self->{vPos} ) || ($self->{vPos} == 0) ) {
+ $self->{vPos} = $self->{PageHeight} - $self->{Ymargin} - $self->{size};
+ }
+
+@@ -1063,7 +1063,7 @@
+ &$callback($self, $total);
+ # This will print a footer if no $callback is passed for backwards
+ # compatibility
+- } elsif ($callback !~ /none/i) {
++ } elsif (defined $callback && $callback !~ /none/i) {
+ &gen_page_footer($self, $total, $callback);
+ }
+
Property changes on: packages/libpdf-report-perl/trunk/debian/patches/40warnings.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Modified: packages/libpdf-report-perl/trunk/debian/rules
===================================================================
--- packages/libpdf-report-perl/trunk/debian/rules 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/debian/rules 2006-03-17 20:25:52 UTC (rev 2404)
@@ -7,6 +7,8 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+include /usr/share/dpatch/dpatch.make
+
PACKAGE=$(shell dh_listpackages)
ifndef PERL
@@ -18,7 +20,7 @@
endif
TMP =`pwd`/debian/$(PACKAGE)
-build: build-stamp
+build: patch build-stamp
build-stamp:
dh_testdir
@@ -29,7 +31,8 @@
touch build-stamp
-clean:
+clean: clean-patched unpatch
+clean-patched:
dh_testdir
dh_testroot
rm -f build-stamp
Modified: packages/libpdf-report-perl/trunk/examples/barcode
===================================================================
--- packages/libpdf-report-perl/trunk/examples/barcode 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/examples/barcode 2006-03-17 20:25:52 UTC (rev 2404)
@@ -1,5 +1,4 @@
-#!/usr/bin/perl
-use PDF::Report;
+require "../Report.pm";
my $pdf = new PDF::Report(
PageSize => letter,
Modified: packages/libpdf-report-perl/trunk/examples/footer
===================================================================
--- packages/libpdf-report-perl/trunk/examples/footer 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/examples/footer 2006-03-17 20:25:52 UTC (rev 2404)
@@ -1,5 +1,4 @@
-#!/usr/bin/perl
-use PDF::Report;
+require "../Report.pm";
my $pdf = new PDF::Report(
PageSize => LETTER,
Modified: packages/libpdf-report-perl/trunk/examples/openpdf
===================================================================
--- packages/libpdf-report-perl/trunk/examples/openpdf 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/examples/openpdf 2006-03-17 20:25:52 UTC (rev 2404)
@@ -1,5 +1,4 @@
-#!/usr/bin/perl
-use PDF::Report;
+require "../Report.pm";
my $file = $ARGV[0];
print "Pass me a PDF file." if ! -e $file;
Modified: packages/libpdf-report-perl/trunk/examples/paragraph
===================================================================
--- packages/libpdf-report-perl/trunk/examples/paragraph 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/examples/paragraph 2006-03-17 20:25:52 UTC (rev 2404)
@@ -1,5 +1,4 @@
-#!/usr/bin/perl
-use PDF::Report;
+require "../Report.pm";
my $pdf = new PDF::Report(
PageSize => letter,
Modified: packages/libpdf-report-perl/trunk/examples/piegraph
===================================================================
--- packages/libpdf-report-perl/trunk/examples/piegraph 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/examples/piegraph 2006-03-17 20:25:52 UTC (rev 2404)
@@ -1,5 +1,4 @@
-#!/usr/bin/perl
-use PDF::Report;
+require "../Report.pm";
my $pdf = new PDF::Report(
PageSize => letter,
Modified: packages/libpdf-report-perl/trunk/examples/rotate
===================================================================
--- packages/libpdf-report-perl/trunk/examples/rotate 2006-03-17 19:33:00 UTC (rev 2403)
+++ packages/libpdf-report-perl/trunk/examples/rotate 2006-03-17 20:25:52 UTC (rev 2404)
@@ -1,5 +1,4 @@
-#!/usr/bin/perl
-use PDF::Report;
+require "../Report.pm";
my $pdf = new PDF::Report(
PageSize => LETTER,
More information about the Pkg-perl-cvs-commits
mailing list