r47924 - in /trunk/libparse-debcontrol-perl/debian: changelog patches/strict_parse.diff

azatoth-guest at users.alioth.debian.org azatoth-guest at users.alioth.debian.org
Sun Nov 29 18:52:10 UTC 2009


Author: azatoth-guest
Date: Sun Nov 29 18:51:55 2009
New Revision: 47924

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47924
Log:
Adding specific class for DEP3 patch metadata files (needs unconventional
parsing)

Modified:
    trunk/libparse-debcontrol-perl/debian/changelog
    trunk/libparse-debcontrol-perl/debian/patches/strict_parse.diff

Modified: trunk/libparse-debcontrol-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-debcontrol-perl/debian/changelog?rev=47924&op=diff
==============================================================================
--- trunk/libparse-debcontrol-perl/debian/changelog (original)
+++ trunk/libparse-debcontrol-perl/debian/changelog Sun Nov 29 18:51:55 2009
@@ -13,8 +13,10 @@
     (Closes: #535958)
   * changed to _dowarn sub to using Error instead so we actually can use 
     strict in production code
+  * Adding specific class for DEP3 patch metadata files (needs unconventional
+    parsing)
 
- -- Carl Fürstenberg <carl at excito.com>  Sat, 28 Nov 2009 18:24:11 +0100
+ -- Carl Fürstenberg <carl at excito.com>  Sun, 29 Nov 2009 19:51:05 +0100
 
 libparse-debcontrol-perl (2.005-2) unstable; urgency=low
 

Modified: trunk/libparse-debcontrol-perl/debian/patches/strict_parse.diff
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libparse-debcontrol-perl/debian/patches/strict_parse.diff?rev=47924&op=diff
==============================================================================
--- trunk/libparse-debcontrol-perl/debian/patches/strict_parse.diff (original)
+++ trunk/libparse-debcontrol-perl/debian/patches/strict_parse.diff Sun Nov 29 18:51:55 2009
@@ -1,7 +1,7 @@
 Index: libparse-debcontrol-perl/lib/Parse/DebControl.pm
 ===================================================================
---- libparse-debcontrol-perl.orig/lib/Parse/DebControl.pm	2009-11-28 23:27:32.000000000 +0100
-+++ libparse-debcontrol-perl/lib/Parse/DebControl.pm	2009-11-28 23:27:44.000000000 +0100
+--- libparse-debcontrol-perl.orig/lib/Parse/DebControl.pm	2009-11-29 19:21:59.000000000 +0100
++++ libparse-debcontrol-perl/lib/Parse/DebControl.pm	2009-11-29 19:22:09.000000000 +0100
 @@ -13,10 +13,111 @@
  use IO::Scalar;
  use Compress::Zlib;
@@ -402,7 +402,7 @@
 Index: libparse-debcontrol-perl/t/34strict.t
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ libparse-debcontrol-perl/t/34strict.t	2009-11-28 23:27:44.000000000 +0100
++++ libparse-debcontrol-perl/t/34strict.t	2009-11-29 19:22:09.000000000 +0100
 @@ -0,0 +1,47 @@
 +#
 +#===============================================================================
@@ -453,8 +453,8 @@
 +} 'Parse::DebControl::Error::Parse', "Error thrown";
 Index: libparse-debcontrol-perl/t/30parse.t
 ===================================================================
---- libparse-debcontrol-perl.orig/t/30parse.t	2009-11-28 23:27:32.000000000 +0100
-+++ libparse-debcontrol-perl/t/30parse.t	2009-11-28 23:27:44.000000000 +0100
+--- libparse-debcontrol-perl.orig/t/30parse.t	2009-11-29 19:21:59.000000000 +0100
++++ libparse-debcontrol-perl/t/30parse.t	2009-11-29 19:22:09.000000000 +0100
 @@ -1,6 +1,7 @@
  #!/usr/bin/perl -w
  
@@ -476,8 +476,8 @@
  
 Index: libparse-debcontrol-perl/t/40write.t
 ===================================================================
---- libparse-debcontrol-perl.orig/t/40write.t	2009-11-28 23:27:32.000000000 +0100
-+++ libparse-debcontrol-perl/t/40write.t	2009-11-28 23:27:44.000000000 +0100
+--- libparse-debcontrol-perl.orig/t/40write.t	2009-11-29 19:21:59.000000000 +0100
++++ libparse-debcontrol-perl/t/40write.t	2009-11-29 19:22:09.000000000 +0100
 @@ -1,7 +1,8 @@
  #!/usr/bin/perl -w
  
@@ -512,7 +512,7 @@
 Index: libparse-debcontrol-perl/lib/Parse/DebControl/Error.pm
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ libparse-debcontrol-perl/lib/Parse/DebControl/Error.pm	2009-11-28 23:28:10.000000000 +0100
++++ libparse-debcontrol-perl/lib/Parse/DebControl/Error.pm	2009-11-29 19:22:09.000000000 +0100
 @@ -0,0 +1,75 @@
 +use strict;
 +use warnings;
@@ -589,3 +589,224 @@
 +}
 +
 +1;
+Index: libparse-debcontrol-perl/lib/Parse/DebControl/Patch.pm
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libparse-debcontrol-perl/lib/Parse/DebControl/Patch.pm	2009-11-29 19:46:09.000000000 +0100
+@@ -0,0 +1,135 @@
++package Parse::DebControl::Patch;
++use strict;
++use warnings;
++
++use base 'Parse::DebControl';
++
++our $VERSION = '0.1';
++
++sub _parseDataHandle
++{
++	my ($this, $handle, $options) = @_;
++
++	unless($handle)
++	{
++		throw Parse::DebControl::Error("_parseDataHandle failed because no handle was given. This is likely a bug in the module");
++	}
++
++	if($options->{tryGzip})
++	{
++		if(my $gunzipped = $this->_tryGzipInflate($handle))
++		{
++			$handle = new IO::Scalar \$gunzipped
++		}
++	}
++
++	my $data = $this->_getReadyHash($options);
++
++	my $linenum = 0;
++	my $lastfield = "";
++    my $begun = 0;
++    my $dpatch = 0;
++    my $freeform = "";
++    my $in_freeform = 0;
++    my $freeform_fields = [];
++
++	foreach my $line (<$handle>)
++	{
++        next if $line =~ /^\s*$/ and not $begun;
++
++        if( $line =~ /^#\s*$/ and not $begun ) {
++            $dpatch = 1;
++            next;
++        }
++        if( $line =~ /^#\s$/ and not $begun ) {
++            $dpatch = 1;
++        }
++        $begun = 1;
++        if( $dpatch ) {
++            unless( $line =~ s/^# // ) {
++                throw Parse::DebControl::Error::Parse("We are in dpatch mode, and a non-shell-comment line found", $linenum, $line);
++            }
++        }
++
++		chomp $line;
++
++
++		$linenum++;
++        if( $in_freeform ) {
++            if( $line =~ /^---/ ) {
++                # we need to prohibit --- lines in freeform
++                last;
++            }
++            if( $line =~ /^$/ ) {
++                chomp $freeform;
++                push @$freeform_fields, $freeform;
++                $freeform = "";
++                $in_freeform = 0;
++            } else {
++                $freeform .= "$line\n";
++            }
++            next;
++        } else {
++            if( $line =~ /^$/ ) {
++                $in_freeform = 1;
++                $freeform = "";
++                next;
++            }
++        }
++
++        if( $line =~ /^---/ ) {
++            last;
++        } elsif($line =~ /^[^\t\s]/) {
++			#we have a valid key-value pair
++			if($line =~ /(.*?)\s*\:\s*(.*)$/)
++			{
++				my $key = $1;
++				my $value = $2;
++
++				if($options->{discardCase})
++				{
++					$key = lc($key);
++				}
++
++				push @{$data->{$key}}, $value;
++
++				$lastfield = $key;
++			}else{
++				throw Parse::DebControl::Error::Parse('invalid key/value stansa', $linenum, $line);
++			}
++
++		} elsif($line =~ /^([\t\s])(.*)/) {
++            #appends to previous line
++
++            unless($lastfield)
++            {
++                throw Parse::DebControl::Error::Parse('indented entry without previous line', $linenum, $line);
++            }
++			if($2 eq "." ){
++				$data->{$lastfield}->[scalar @{$data->{$lastfield}}] .= "\n";
++			}else{
++				my $val = $2;
++				$val =~ s/[\s\t]+$//;
++				$data->{$lastfield}->[scalar @{$data->{$lastfield}}] .= "\n$val";
++			}
++        }else{
++            # we'll ignore if junk comes after the metadata usually
++            last;
++        }
++
++	}
++
++    if( scalar @$freeform_fields ) {
++        if( exists $data->{'Description'} ) {
++            push @{$data->{'Description'}}, @$freeform_fields;
++        } elsif( exists $data->{'Subject'} ) {
++            push @{$data->{'Subject'}}, @$freeform_fields;
++        } else {
++                throw Parse::DebControl::Error::Parse('Freeform field found without any Subject or Description fields');
++        }
++    }
++
++	return $data;
++}
++
++1;
+Index: libparse-debcontrol-perl/t/35patch.t
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libparse-debcontrol-perl/t/35patch.t	2009-11-29 19:30:27.000000000 +0100
+@@ -0,0 +1,44 @@
++#
++#===============================================================================
++#
++#         FILE:  35patch.t
++#
++#  DESCRIPTION:
++#
++#        FILES:  ---
++#         BUGS:  ---
++#        NOTES:  ---
++#       AUTHOR:   (), <>
++#      COMPANY:
++#      VERSION:  1.0
++#      CREATED:  2009-11-29 19.13.10 CET
++#     REVISION:  ---
++#===============================================================================
++
++use strict;
++use warnings;
++
++use Test::More tests => 3;                      # last test to print
++use Test::Exception;
++
++BEGIN {
++    chdir 't' if -d 't';
++    use lib '../blib/lib', 'lib/', '..';
++}
++
++
++my $mod = "Parse::DebControl::Patch";
++my $pdc;
++my $data;
++
++#Object initialization - 2 tests
++
++use_ok($mod);
++ok($pdc = new Parse::DebControl::Patch(), "Parser object creation works fine");
++
++$pdc = new Parse::DebControl::Patch(1);
++
++ok($data = $pdc->parse_file( 'testfiles/patch1.diff' ), "Parsed patch ok");
++use Data::Dumper;
++print Dumper( $data );
++
+Index: libparse-debcontrol-perl/t/testfiles/patch1.diff
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libparse-debcontrol-perl/t/testfiles/patch1.diff	2009-11-29 19:27:00.000000000 +0100
+@@ -0,0 +1,27 @@
++From: Ulrich Drepper <drepper at redhat.com>
++Subject: Fix regex problems with some multi-bytes characters
++
++* posix/bug-regex17.c: Add testcases.
++* posix/regcomp.c (re_compile_fastmap_iter): Rewrite COMPLEX_BRACKET
++  handling.
++
++Origin: upstream, http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdb56bac
++Bug: http://sourceware.org/bugzilla/show_bug.cgi?id=9697
++Bug-Debian: http://bugs.debian.org/510219
++
++diff --git a/ChangeLog b/ChangeLog
++index 182bd26..8829b44 100644
++--- a/ChangeLog
+++++ b/ChangeLog
++@@ -1,3 +1,10 @@
+++2009-01-04  Paolo Bonzini  <bonzini at gnu.org>
+++
+++	[BZ 9697]
+++	* posix/bug-regex17.c: Add testcases.
+++	* posix/regcomp.c (re_compile_fastmap_iter): Rewrite COMPLEX_BRACKET
+++	handling.
+++
++ 2009-01-05  Martin Schwidefsky  <schwidefsky at de.ibm.com>
++
++ 	* sysdeps/unix/sysv/linux/s390/bits/libc-vdso.h: New file.
++




More information about the Pkg-perl-cvs-commits mailing list