summaryrefslogtreecommitdiff
path: root/tests/tests/dpkgsourceignores-docs
blob: 397b7834e5fa10651986f7d01917b406aaa4e94e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
set -e
. tests/lib

t-restriction-x-dgit-intree-only
# we need the .pod source, which is not shipped

cd $tmp

: ----- extract args from document -----

perl -ne '
	BEGIN { print "\n=head1 dgit-test-title\n\n"; }
	next unless
		m/^=for dgit-test dpkg-source-ignores begin/..
		m/^=for dgit-test dpkg-source-ignores end/;
	next unless m/dpkg-buildpackage.*-i.*-I/;
	s/\s*dpkg-buildpackage\s+//;
	s/\s+-S\s*//;
	print;
' $root/dgit-maint-merge.7.pod >doc.pod

pod2text doc.pod >doc.txt

perl -ne '
	next unless m/\S/;
	next if m/dgit-test-title/;
	print "for arg in ";
	print;
	print " do\n";
' doc.txt >doc.sh

cat >>doc.sh <<'END'
	printf "%s\n" "$arg"
done
END

chmod +x doc.sh
./doc.sh >doc.args

: ----- extract args from dgit -----

perl -ne '
	next unless m/^\s*our\s+\@dpkg_source_ignores\s*=/;
	print;
' $root/dgit >dgit.pl

cat >>dgit.pl <<'END'
	foreach my $arg (@dpkg_source_ignores) {
		print $arg, "\n" or die $!;
	}
END

perl dgit.pl >dgit.args

: ----- compare -----

diff -u dgit.args doc.args

t-ok