]> git.donarmstrong.com Git - debhelper.git/blob - t/dh_install
37aff7b229d33b141690433b0befaf0cb0689d1c
[debhelper.git] / t / dh_install
1 #!/usr/bin/perl
2 use Test;
3 plan(tests => 13);
4
5 system("rm -rf debian/debhelper debian/tmp");
6
7 # #537140: debian/tmp is explcitly specified despite being searched by
8 # default in v7+
9 system("mkdir -p debian/tmp/usr/bin; touch debian/tmp/usr/bin/foo; touch debian/tmp/usr/bin/bar");
10 system("./dh_install", "debian/tmp/usr/bin/foo");
11 ok(-e "debian/debhelper/usr/bin/foo");
12 ok(! -e "debian/debhelper/usr/bin/bar");
13 system("rm -rf debian/debhelper debian/tmp");
14
15 # #537017: --sourcedir=debian/tmp/foo is used
16 system("mkdir -p debian/tmp/foo/usr/bin; touch debian/tmp/foo/usr/bin/foo; touch debian/tmp/foo/usr/bin/bar");
17 system("./dh_install", "--sourcedir=debian/tmp/foo", "usr/bin/bar");
18 ok(-e "debian/debhelper/usr/bin/bar");
19 ok(! -e "debian/debhelper/usr/bin/foo");
20 system("rm -rf debian/debhelper debian/tmp");
21
22 # #535367: installation of entire top-level directory from debian/tmp
23 system("mkdir -p debian/tmp/usr/bin; touch debian/tmp/usr/bin/foo; touch debian/tmp/usr/bin/bar");
24 system("./dh_install", "usr");
25 ok(-e "debian/debhelper/usr/bin/foo");
26 ok(-e "debian/debhelper/usr/bin/bar");
27 system("rm -rf debian/debhelper debian/tmp");
28
29 # #534565: fallback use of debian/tmp in v7+
30 system("mkdir -p debian/tmp/usr/bin; touch debian/tmp/usr/bin/foo; touch debian/tmp/usr/bin/bar");
31 system("./dh_install", "usr/bin");
32 ok(-e "debian/debhelper/usr/bin/foo");
33 ok(-e "debian/debhelper/usr/bin/bar");
34 system("rm -rf debian/debhelper debian/tmp");
35
36 # #534565: glob expands to dangling symlink -> should install the dangling link
37 system("mkdir -p debian/tmp/usr/bin; ln -s broken debian/tmp/usr/bin/foo; touch debian/tmp/usr/bin/bar");
38 system("./dh_install", "usr/bin/*");
39 ok(-l "debian/debhelper/usr/bin/foo");
40 ok(! -e "debian/debhelper/usr/bin/foo");
41 ok(-e "debian/debhelper/usr/bin/bar");
42 ok(! -l "debian/debhelper/usr/bin/bar");
43 system("rm -rf debian/debhelper debian/tmp");
44
45 # regular specification of file not in debian/tmp
46 system("./dh_install", "dh_install", "usr/bin");
47 ok(-e "debian/debhelper/usr/bin/dh_install");
48 system("rm -rf debian/debhelper debian/tmp");