r1929 - in packages/libapache-configfile-perl/trunk: .
debian/patches
Niko Tyni
ntyni-guest at costa.debian.org
Sun Jan 15 20:09:23 UTC 2006
Author: ntyni-guest
Date: 2006-01-15 20:09:22 +0000 (Sun, 15 Jan 2006)
New Revision: 1929
Added:
packages/libapache-configfile-perl/trunk/debian/patches/00list
packages/libapache-configfile-perl/trunk/debian/patches/10dirs.dpatch
packages/libapache-configfile-perl/trunk/debian/patches/20newline.dpatch
Modified:
packages/libapache-configfile-perl/trunk/ConfigFile.pm
Log:
Move old patches under dpatch
Modified: packages/libapache-configfile-perl/trunk/ConfigFile.pm
===================================================================
--- packages/libapache-configfile-perl/trunk/ConfigFile.pm 2006-01-15 20:03:54 UTC (rev 1928)
+++ packages/libapache-configfile-perl/trunk/ConfigFile.pm 2006-01-15 20:09:22 UTC (rev 1929)
@@ -168,19 +168,6 @@
# add the server root unless it's a /full/path/name
$file = "$server_root/$file" if $file !~ m!^/! && $server_root;
- # Handling for directories
- if (-d $file) {
- opendir(DIR, $file)
- || croak("Cannot open directory '$file': $! (do you need to define ServerRoot?)");
- my @conf;
- while (defined(my $entry = readdir(DIR))) {
- next if $entry =~ /^\.\.?$/;
- push @conf, _include($self, $file."/".$entry);
- }
- closedir(DIR);
- return @conf;
- }
-
open(CONF, "<$file")
|| croak("Cannot read '$file': $! (do you need to define ServerRoot?)");
chomp(my @conf = <CONF>);
@@ -212,28 +199,15 @@
my $cmd_context = $conf;
my @parselevel = ();
my $line = 0;
- my $cont_confline = '';
- foreach my $confline (@conf) {
+ foreach (@conf) {
$line++;
- # Handle line continuation when a trailing \ is found
- if ($cont_confline) {
- # This line is a continuation
- $confline = "$cont_confline $confline";
- $cont_confline = '';
- }
- if ($confline =~ /^(.+)\\\s*$/) {
- # This line continues in the next one
- $cont_confline = $1;
- next;
- }
-
# Strip newlines/comments
- $confline =~ s/\s*#.*//;
+ s/\s*#.*//;
# If nothing's left, continue
- next unless $confline;
+ next unless $_;
# This substitutes in re-used variable on the right side of the file
# We have to handle the ignore_case flag hence the expression
@@ -241,17 +215,17 @@
# are visible for re-substitution
if ($self->{expand_vars}) {
local($^W) = 0 ;
- $confline =~ s#\$\{?(\w+)\}?#my $k = $self->_fixcase($1);$conf->{$k}#eg;
+ s#\$\{?(\w+)\}?#my $k = $self->_fixcase($1);$conf->{$k}#eg;
}
# This may be a <stuff> junk </stuff>, in which case we need
# to nest our data struct!
- if ($confline =~ m#^\s*</(\S+)\s*>\s*$#) {
+ if (m#^\s*</(\S+)\s*>\s*$#) {
# match </close> - walk up
$cmd_context = pop @parselevel;
$self->_error("$file line $line: Mismatched closing tag '$1'") unless $cmd_context;
next;
- } elsif ($confline =~ m#^\s*<(\S+)\s*(["']*)(.*)\2>\s*$#) {
+ } elsif (m#^\s*<(\S+)\s*(["']*)(.*)\2>\s*$#) {
# create new sublevel in parsing
my $k = $self->_fixcase($1);
push @parselevel, $cmd_context;
@@ -274,8 +248,8 @@
# Split up the key and the value. The @val regexp code dynamically
# differentiates between "space strings" and array, values.
- my($key, $r) = $confline =~ m!^\s*\s*(\w+)\s*(?=\s+)(.*)!; # split up key
- my(@val) = $r =~ m!\s+(?:\"([^\"]*[^\\])\"|([^\s,]+))\n?!g; # split up val
+ my($key, $r) = m!^\s*\s*(\w+)\s*(?=\s+)(.*)!; # split up key
+ my(@val) = $r =~ m!\s+(?:"([^"]*[^\\])"|([^\s,]+))\n?!g; # split up val
@val = grep { defined } @val; # lose undef values
# Check for "on/off" or "true/false" or "yes/no"
Added: packages/libapache-configfile-perl/trunk/debian/patches/00list
===================================================================
--- packages/libapache-configfile-perl/trunk/debian/patches/00list 2006-01-15 20:03:54 UTC (rev 1928)
+++ packages/libapache-configfile-perl/trunk/debian/patches/00list 2006-01-15 20:09:22 UTC (rev 1929)
@@ -0,0 +1,2 @@
+10dirs.dpatch
+20newline.dpatch
Added: packages/libapache-configfile-perl/trunk/debian/patches/10dirs.dpatch
===================================================================
--- packages/libapache-configfile-perl/trunk/debian/patches/10dirs.dpatch 2006-01-15 20:03:54 UTC (rev 1928)
+++ packages/libapache-configfile-perl/trunk/debian/patches/10dirs.dpatch 2006-01-15 20:09:22 UTC (rev 1929)
@@ -0,0 +1,31 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10dirs.dpatch by Niko Tyni <ntyni at iki.fi>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Support for including whole directories.
+## DP: (#204841, patch by Tobias Gruetzmacher)
+
+ at DPATCH@
+diff -urNad trunk~/ConfigFile.pm trunk/ConfigFile.pm
+--- trunk~/ConfigFile.pm 2006-01-15 22:04:48.000000000 +0200
++++ trunk/ConfigFile.pm 2006-01-15 22:04:57.976816196 +0200
+@@ -168,6 +168,19 @@
+ # add the server root unless it's a /full/path/name
+ $file = "$server_root/$file" if $file !~ m!^/! && $server_root;
+
++ # Handling for directories
++ if (-d $file) {
++ opendir(DIR, $file)
++ || croak("Cannot open directory '$file': $! (do you need to define ServerRoot?)");
++ my @conf;
++ while (defined(my $entry = readdir(DIR))) {
++ next if $entry =~ /^\.\.?$/;
++ push @conf, _include($self, $file."/".$entry);
++ }
++ closedir(DIR);
++ return @conf;
++ }
++
+ open(CONF, "<$file")
+ || croak("Cannot read '$file': $! (do you need to define ServerRoot?)");
+ chomp(my @conf = <CONF>);
Property changes on: packages/libapache-configfile-perl/trunk/debian/patches/10dirs.dpatch
___________________________________________________________________
Name: svn:executable
+ *
Added: packages/libapache-configfile-perl/trunk/debian/patches/20newline.dpatch
===================================================================
--- packages/libapache-configfile-perl/trunk/debian/patches/20newline.dpatch 2006-01-15 20:03:54 UTC (rev 1928)
+++ packages/libapache-configfile-perl/trunk/debian/patches/20newline.dpatch 2006-01-15 20:09:22 UTC (rev 1929)
@@ -0,0 +1,75 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20newline.dpatch by Niko Tyni <ntyni at iki.fi>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Support for parsing line continuations.
+## DP: (#309721, patch by Gunnar Wolf)
+
+ at DPATCH@
+diff -urNad trunk~/ConfigFile.pm trunk/ConfigFile.pm
+--- trunk~/ConfigFile.pm 2006-01-15 22:07:07.619556157 +0200
++++ trunk/ConfigFile.pm 2006-01-15 22:07:13.602528843 +0200
+@@ -212,15 +212,28 @@
+ my $cmd_context = $conf;
+ my @parselevel = ();
+ my $line = 0;
++ my $cont_confline = '';
+
+- foreach (@conf) {
++ foreach my $confline (@conf) {
+ $line++;
+
++ # Handle line continuation when a trailing \ is found
++ if ($cont_confline) {
++ # This line is a continuation
++ $confline = "$cont_confline $confline";
++ $cont_confline = '';
++ }
++ if ($confline =~ /^(.+)\\\s*$/) {
++ # This line continues in the next one
++ $cont_confline = $1;
++ next;
++ }
++
+ # Strip newlines/comments
+- s/\s*#.*//;
++ $confline =~ s/\s*#.*//;
+
+ # If nothing's left, continue
+- next unless $_;
++ next unless $confline;
+
+ # This substitutes in re-used variable on the right side of the file
+ # We have to handle the ignore_case flag hence the expression
+@@ -228,17 +241,17 @@
+ # are visible for re-substitution
+ if ($self->{expand_vars}) {
+ local($^W) = 0 ;
+- s#\$\{?(\w+)\}?#my $k = $self->_fixcase($1);$conf->{$k}#eg;
++ $confline =~ s#\$\{?(\w+)\}?#my $k = $self->_fixcase($1);$conf->{$k}#eg;
+ }
+
+ # This may be a <stuff> junk </stuff>, in which case we need
+ # to nest our data struct!
+- if (m#^\s*</(\S+)\s*>\s*$#) {
++ if ($confline =~ m#^\s*</(\S+)\s*>\s*$#) {
+ # match </close> - walk up
+ $cmd_context = pop @parselevel;
+ $self->_error("$file line $line: Mismatched closing tag '$1'") unless $cmd_context;
+ next;
+- } elsif (m#^\s*<(\S+)\s*(["']*)(.*)\2>\s*$#) {
++ } elsif ($confline =~ m#^\s*<(\S+)\s*(["']*)(.*)\2>\s*$#) {
+ # create new sublevel in parsing
+ my $k = $self->_fixcase($1);
+ push @parselevel, $cmd_context;
+@@ -261,8 +274,8 @@
+
+ # Split up the key and the value. The @val regexp code dynamically
+ # differentiates between "space strings" and array, values.
+- my($key, $r) = m!^\s*\s*(\w+)\s*(?=\s+)(.*)!; # split up key
+- my(@val) = $r =~ m!\s+(?:"([^"]*[^\\])"|([^\s,]+))\n?!g; # split up val
++ my($key, $r) = $confline =~ m!^\s*\s*(\w+)\s*(?=\s+)(.*)!; # split up key
++ my(@val) = $r =~ m!\s+(?:\"([^\"]*[^\\])\"|([^\s,]+))\n?!g; # split up val
+ @val = grep { defined } @val; # lose undef values
+
+ # Check for "on/off" or "true/false" or "yes/no"
Property changes on: packages/libapache-configfile-perl/trunk/debian/patches/20newline.dpatch
___________________________________________________________________
Name: svn:executable
+ *
More information about the Pkg-perl-cvs-commits
mailing list