From 1d8f6e1fa32cedd33788991d9301899fc6f2dcfb Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 5 Aug 2014 22:08:12 +0200 Subject: scripts/t: Add dpkg-source functional tests --- scripts/Test/Dpkg.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'scripts/Test') diff --git a/scripts/Test/Dpkg.pm b/scripts/Test/Dpkg.pm index 5aa8d44c4..e0395dec6 100644 --- a/scripts/Test/Dpkg.pm +++ b/scripts/Test/Dpkg.pm @@ -26,6 +26,7 @@ our @EXPORT_OK = qw( test_needs_module test_needs_command test_needs_srcdir_switch + test_neutralize_checksums ); our %EXPORT_TAGS = ( needs => [ qw( @@ -101,4 +102,21 @@ sub test_needs_srcdir_switch } } +sub test_neutralize_checksums +{ + my $filename = shift; + my $filenamenew = "$filename.new"; + + open my $fhnew, '>', $filenamenew or die; + open my $fh, '<', $filename or die; + while (<$fh>) { + s/^ ([0-9a-f]{32,}) [1-9][0-9]* /q{ } . $1 =~ tr{0-9a-f}{0}r . q{ 0 }/e; + print { $fhnew } $_; + } + close $fh or die; + close $fhnew or die; + + rename $filenamenew, $filename or die; +} + 1; -- cgit v1.2.3