diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 14:22:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 14:22:53 +0000 |
commit | f4b22a2f215f6f80558d9e4075c9de306c8b9953 (patch) | |
tree | 05142dd668b11fc304d1c15faa52dee3784f8fa0 /debian/template-md5sum | |
parent | Adding upstream version 1.5.2. (diff) | |
download | pam-f4b22a2f215f6f80558d9e4075c9de306c8b9953.tar.xz pam-f4b22a2f215f6f80558d9e4075c9de306c8b9953.zip |
Adding debian version 1.5.2-6+deb12u1.debian/1.5.2-6+deb12u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | debian/template-md5sum | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/debian/template-md5sum b/debian/template-md5sum new file mode 100755 index 0000000..e043a82 --- /dev/null +++ b/debian/template-md5sum @@ -0,0 +1,51 @@ +#!/usr/bin/perl +use IPC::Open2; + + + my($template) = @ARGV; + my $state = 0; + + open(INPUT,$template) || return ''; + my($md5sum_fd,$output_fd); + my $pid = open2($md5sum_fd, $output_fd, 'md5sum'); + return '' if (!$pid); + + while (<INPUT>) { + if ($state == 1) { + if (/^# here's the fallback if no module succeeds/) { + print $output_fd $_; + $state++; + } + next; + } + if ($state == 3) { + if (/^# end of pam-auth-update config/) { + print $output_fd $_; + $state++; + } + next; + } + + print $output_fd $_; + + my ($pattern,$val); + if ($state == 0) { + $pattern = '^# here are the per-package modules \(the "Primary" block\)'; + } elsif ($state == 2) { + $pattern = '^# and here are more per-package modules \(the "Additional" block\)'; + } else { + next; + } + + if (/$pattern/) { + $state++; + } + } + close(INPUT); + close($output_fd); + my $md5sum = <$md5sum_fd>; + close($md5sum_fd); + waitpid $pid, 0; + + $md5sum = (split(/\s+/,$md5sum))[0]; + print $md5sum; |