summaryrefslogtreecommitdiff
path: root/scripts/Test
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-08-05 22:08:12 +0200
committerGuillem Jover <guillem@debian.org>2016-10-30 04:45:32 +0100
commit1d8f6e1fa32cedd33788991d9301899fc6f2dcfb (patch)
tree7034c741e74e7d17629b6090236b55e2bd7dd082 /scripts/Test
parent6c32c76ba20b641e14fc1533cecb3ca674850a90 (diff)
downloaddpkg-1d8f6e1fa32cedd33788991d9301899fc6f2dcfb.tar.gz
scripts/t: Add dpkg-source functional tests
Diffstat (limited to 'scripts/Test')
-rw-r--r--scripts/Test/Dpkg.pm18
1 files changed, 18 insertions, 0 deletions
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;