void-packages/srcpkgs/lcov/patches/fix-undef-behaviour.patch
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

37 lines
1 KiB
Diff

Author: Alastair McKinstry <mckinstry@debian.org>
Description: Fix for undefined behavior in perl5.20
Origin: http://bugs.debian.org/761308
Forwarded: no
Last-Updated: 2014-09-13
Index: lcov-1.12/bin/lcov
===================================================================
--- a/bin/lcov
+++ b/bin/lcov
@@ -224,7 +224,9 @@ Getopt::Long::Configure("default");
# Remove spaces around rc options
my %new_opt_rc;
- while (my ($key, $value) = each(%opt_rc)) {
+ my @keys = keys %opt_rc;
+ for my $key (@keys) {
+ my $value = $opt_rc{$key};
$key =~ s/^\s+|\s+$//g;
$value =~ s/^\s+|\s+$//g;
Index: lcov-1.12/bin/geninfo
===================================================================
--- a/bin/geninfo
+++ b/bin/geninfo
@@ -284,8 +284,9 @@ Getopt::Long::Configure("default");
{
# Remove spaces around rc options
my %new_opt_rc;
-
- while (my ($key, $value) = each(%opt_rc)) {
+ my @keys = keys %opt_rc;
+ for my $key (@keys) {
+ my $value = $opt_rc{$key};
$key =~ s/^\s+|\s+$//g;
$value =~ s/^\s+|\s+$//g;