chiark / gitweb /
dgit: --clean=dpkg-source: Check for untracked unignored files
[dgit.git] / tests / tests / dpkgsourceignores-docs
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-restrict x-dgit-intree-only
6 # we need the .pod source, which is not shipped
7
8 cd $tmp
9
10 : ----- extract args from document -----
11
12 perl -ne '
13         BEGIN { print "\n=head1 dgit-test-title\n\n"; }
14         next unless
15                 m/^=for dgit-test dpkg-source-ignores begin/..
16                 m/^=for dgit-test dpkg-source-ignores end/;
17         next unless m/dpkg-buildpackage.*-i.*-I/;
18         s/\s*dpkg-buildpackage\s+//;
19         s/\s+-S\s*//;
20         print;
21 ' $root/dgit-maint-merge.7.pod >doc.pod
22
23 pod2text doc.pod >doc.txt
24
25 perl -ne '
26         next unless m/\S/;
27         next if m/dgit-test-title/;
28         print "for arg in ";
29         print;
30         print " do\n";
31 ' doc.txt >doc.sh
32
33 cat >>doc.sh <<'END'
34         printf "%s\n" "$arg"
35 done
36 END
37
38 chmod +x doc.sh
39 ./doc.sh >doc.args
40
41 : ----- extract args from dgit -----
42
43 args=$( t-dgit print-dpkg-source-ignores )
44
45 >dgit.args
46 for arg in $args; do
47         printf >>dgit.args "%s\n" "$arg"
48 done
49
50 : ----- compare -----
51
52 diff -u dgit.args doc.args
53
54 t-ok