File: consumer_newline.dpatch

package info (click to toggle)
libxml-sax-writer-perl 0.44-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 124 kB
  • ctags: 65
  • sloc: perl: 483; sh: 146; makefile: 54
file content (58 lines) | stat: -rw-r--r-- 2,094 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /bin/sh /usr/share/dpatch/dpatch-run
## consumer_newline.dpatch by Florian Ragwitz <rafl@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: trailing newline for HandleConsumer and FileConsumer

@DPATCH@

--- libxml-sax-writer-perl-0.44.orig/t/10consumers.t
+++ libxml-sax-writer-perl-0.44/t/10consumers.t
@@ -71,8 +71,8 @@
 my $cnt2 = <FH2>;
 close FH2;
 
-ok($cnt1 eq 'FILE ONE FILE ONE', 'file content (1)');
-ok($cnt2 eq 'FILE TWO FILE TWO', 'file content (2)');
+ok($cnt1 eq "FILE ONE FILE ONE\n", 'file content (1)');
+ok($cnt2 eq "FILE TWO FILE TWO\n", 'file content (2)');
 
 
 ##
--- libxml-sax-writer-perl-0.44.orig/Writer.pm	2006-06-15 18:30:08.211015856 +0200
+++ libxml-sax-writer-perl-0.44/Writer.pm	2006-06-15 18:32:38.669142744 +0200
@@ -98,7 +98,7 @@
             $ref eq 'GLOB'                                or
             UNIVERSAL::isa(\$self->{Output}, 'GLOB')      or
             UNIVERSAL::isa($self->{Output}, 'IO::Handle')) {
-        $self->{Consumer} = XML::SAX::Writer::HandleConsumer->new($self->{Output});
+        $self->{Consumer} = XML::SAX::Writer::HandleConsumer->new($self->{Output}, $self);
     }
     elsif (not $ref) {
         $self->{Consumer} = XML::SAX::Writer::FileConsumer->new($self->{Output});
@@ -297,7 +297,11 @@
 #-------------------------------------------------------------------#
 # finalize
 #-------------------------------------------------------------------#
-sub finalize { return 0 }
+sub finalize {
+    my $fh = ${$_[0]};
+    print $fh, "\n";
+    return 0
+}
 #-------------------------------------------------------------------#
 
 
--- libxml-sax-writer-perl-0.44.orig/Writer.pm	2006-06-15 18:44:37.685835592 +0200
+++ libxml-sax-writer-perl-0.44/Writer.pm	2006-06-15 18:45:43.197876248 +0200
@@ -340,7 +340,9 @@
 # finalize
 #-------------------------------------------------------------------#
 sub finalize {
-    close ${$_[0]};
+    my $fh = ${$_[0]};
+    print $fh "\n";
+    close $fh;
     return 0;
 }
 #-------------------------------------------------------------------#