From 7a1d9a7c37ef815939ca59b84c874186c6c0aacd Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 25 Oct 2011 19:30:11 -0400 Subject: [PATCH] Fix encode script to work with Perl 5.12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit While we’re at it, turn on strict and warnings. Signed-off-by: Anders Kaseorg --- debian/changelog | 4 +++- decode | 4 ++++ encode | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 60283e0..9ac2424 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ config-package-dev (4.13) UNRELEASED; urgency=low * Fix DEB_CHECK_FILES and DEB_TRANSFORM_FILES with non-conffiles in Multi-Arch: same packages. + * Fix encode script to work with Perl 5.12. While we’re at it, turn on + strict and warnings. - -- Anders Kaseorg Sun, 21 Aug 2011 22:41:41 -0400 + -- Anders Kaseorg Tue, 25 Oct 2011 19:27:00 -0400 config-package-dev (4.12) unstable; urgency=low diff --git a/decode b/decode index 73a216a..ac2c2b9 100755 --- a/decode +++ b/decode @@ -1,4 +1,8 @@ #!/usr/bin/perl + +use strict; +use warnings; + $ARGV[0] =~ s/\+([^+]*)\+/unparse($1)/eg; print $ARGV[0]; sub unparse { diff --git a/encode b/encode index 48ba732..8153ca3 100755 --- a/encode +++ b/encode @@ -10,10 +10,12 @@ # This encoding is intended to be human-readable, so that users can # determine the cause of conflicts between different configuration # packages. + +use strict; +use warnings; $ARGV[0] =~ s,^/,,; -split('', $ARGV[0]); -foreach (@_){ +foreach (split('', $ARGV[0])) { if (m/[a-z0-9.-]/) { print "$_"; } elsif (m/[A-Z]/) { -- 2.45.0