Don't tolerate '' as value for $target parameter to (un)stow_contents
This commit is contained in:
parent
063331c34d
commit
1d3f45580b
4 changed files with 40 additions and 35 deletions
|
@ -57,7 +57,7 @@ $Option{'verbose'} = 0;
|
|||
make_dir('../stow/pkg2/lib2');
|
||||
make_file('../stow/pkg2/lib2/file2');
|
||||
make_dir('lib2');
|
||||
stow_contents('../stow/pkg2', './', '../stow/pkg2');
|
||||
stow_contents('../stow/pkg2', '.', '../stow/pkg2');
|
||||
process_tasks();
|
||||
is(
|
||||
readlink('lib2/file2'),
|
||||
|
|
|
@ -43,7 +43,7 @@ make_dir('../stow/pkg1/bin1');
|
|||
make_file('../stow/pkg1/bin1/file1');
|
||||
make_link('bin1','../stow/pkg1/bin1');
|
||||
|
||||
unstow_contents('../stow/pkg1','./');
|
||||
unstow_contents('../stow/pkg1','.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -61,7 +61,7 @@ make_dir('lib2');
|
|||
make_dir('../stow/pkg2/lib2');
|
||||
make_file('../stow/pkg2/lib2/file2');
|
||||
make_link('lib2/file2', '../../stow/pkg2/lib2/file2');
|
||||
unstow_contents('../stow/pkg2','./');
|
||||
unstow_contents('../stow/pkg2','.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -84,7 +84,7 @@ make_link('bin3/file3a' => '../../stow/pkg3a/bin3/file3a'); # emulate stow
|
|||
make_dir('../stow/pkg3b/bin3');
|
||||
make_file('../stow/pkg3b/bin3/file3b');
|
||||
make_link('bin3/file3b' => '../../stow/pkg3b/bin3/file3b'); # emulate stow
|
||||
unstow_contents('../stow/pkg3b', './');
|
||||
unstow_contents('../stow/pkg3b', '.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -104,7 +104,7 @@ make_dir('../stow/pkg4/bin4');
|
|||
make_file('../stow/pkg4/bin4/file4');
|
||||
make_link('bin4/file4', '../../stow/pkg4/bin4/does-not-exist');
|
||||
|
||||
unstow_contents('../stow/pkg4', './');
|
||||
unstow_contents('../stow/pkg4', '.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -121,7 +121,7 @@ $Option{'verbose'} = 0;
|
|||
make_dir('../stow/pkg5/bin5');
|
||||
make_link('bin5', '../not-stow');
|
||||
|
||||
unstow_contents('../stow/pkg5', './');
|
||||
unstow_contents('../stow/pkg5', '.');
|
||||
like(
|
||||
$Conflicts[-1], qr(CONFLICT:.*existing target is not owned by stow)
|
||||
=> q(existing link not owned by stow)
|
||||
|
@ -140,7 +140,7 @@ make_link('bin6/file6', '../../stow/pkg6a/bin6/file6');
|
|||
make_dir('../stow/pkg6b/bin6');
|
||||
make_file('../stow/pkg6b/bin6/file6');
|
||||
|
||||
unstow_contents('../stow/pkg6b', './');
|
||||
unstow_contents('../stow/pkg6b', '.');
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
-l 'bin6/file6' &&
|
||||
|
@ -162,7 +162,7 @@ make_dir('stow/pkg7a/stow/pkg7b');
|
|||
make_file('stow/pkg7a/stow/pkg7b/file7b');
|
||||
make_link('stow/pkg7b', '../stow/pkg7a/stow/pkg7b');
|
||||
|
||||
unstow_contents('stow/pkg7b', './');
|
||||
unstow_contents('stow/pkg7b', '.');
|
||||
stderr_like(
|
||||
sub { process_tasks(); },
|
||||
qr/There are no outstanding operations to perform/,
|
||||
|
@ -192,7 +192,7 @@ make_dir('stow/pkg8a/stow2/pkg8b');
|
|||
make_file('stow/pkg8a/stow2/pkg8b/file8b');
|
||||
make_link('stow2/pkg8b', '../stow/pkg8a/stow2/pkg8b');
|
||||
|
||||
unstow_contents('stow/pkg8a', './');
|
||||
unstow_contents('stow/pkg8a', '.');
|
||||
stderr_like(
|
||||
sub { process_tasks(); },
|
||||
qr/There are no outstanding operations to perform/,
|
||||
|
@ -220,7 +220,7 @@ make_link('man9/man1/file9.1' => '../../../stow/pkg9a/man9/man1/file9.1'); # emu
|
|||
|
||||
make_dir('../stow/pkg9b/man9/man1');
|
||||
make_file('../stow/pkg9b/man9/man1/file9.1');
|
||||
unstow_contents('../stow/pkg9b', './');
|
||||
unstow_contents('../stow/pkg9b', '.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -248,7 +248,7 @@ make_link('man10/man1/file10b.1' => '../../../stow/pkg10b/man10/man1/file10b.1'
|
|||
|
||||
make_dir('../stow/pkg10c/man10/man1');
|
||||
make_file('../stow/pkg10c/man10/man1/file10a.1');
|
||||
unstow_contents('../stow/pkg10c', './');
|
||||
unstow_contents('../stow/pkg10c', '.');
|
||||
stderr_like(
|
||||
sub { process_tasks(); },
|
||||
qr/There are no outstanding operations to perform/,
|
||||
|
@ -274,7 +274,7 @@ make_file('../stow/pkg12/man12/man1/.#file12.1');
|
|||
make_dir('man12/man1');
|
||||
make_link('man12/man1/file12.1' => '../../../stow/pkg12/man12/man1/file12.1');
|
||||
|
||||
unstow_contents('../stow/pkg12', './');
|
||||
unstow_contents('../stow/pkg12', '.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
|
|
@ -43,7 +43,7 @@ make_dir('../stow/pkg1/bin1');
|
|||
make_file('../stow/pkg1/bin1/file1');
|
||||
make_link('bin1','../stow/pkg1/bin1');
|
||||
|
||||
unstow_contents_orig('../stow/pkg1','./');
|
||||
unstow_contents_orig('../stow/pkg1','.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -61,7 +61,7 @@ make_dir('lib2');
|
|||
make_dir('../stow/pkg2/lib2');
|
||||
make_file('../stow/pkg2/lib2/file2');
|
||||
make_link('lib2/file2', '../../stow/pkg2/lib2/file2');
|
||||
unstow_contents_orig('../stow/pkg2','./');
|
||||
unstow_contents_orig('../stow/pkg2','.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -84,7 +84,7 @@ make_link('bin3/file3a' => '../../stow/pkg3a/bin3/file3a'); # emulate stow
|
|||
make_dir('../stow/pkg3b/bin3');
|
||||
make_file('../stow/pkg3b/bin3/file3b');
|
||||
make_link('bin3/file3b' => '../../stow/pkg3b/bin3/file3b'); # emulate stow
|
||||
unstow_contents_orig('../stow/pkg3b', './');
|
||||
unstow_contents_orig('../stow/pkg3b', '.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -104,7 +104,7 @@ make_dir('../stow/pkg4/bin4');
|
|||
make_file('../stow/pkg4/bin4/file4');
|
||||
make_link('bin4/file4', '../../stow/pkg4/bin4/does-not-exist');
|
||||
|
||||
unstow_contents_orig('../stow/pkg4', './');
|
||||
unstow_contents_orig('../stow/pkg4', '.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -121,7 +121,7 @@ $Option{'verbose'} = 0;
|
|||
make_dir('../stow/pkg5/bin5');
|
||||
make_link('bin5', '../not-stow');
|
||||
|
||||
unstow_contents_orig('../stow/pkg5', './');
|
||||
unstow_contents_orig('../stow/pkg5', '.');
|
||||
#like(
|
||||
# $Conflicts[-1], qr(CONFLICT:.*can't unlink.*not owned by stow)
|
||||
# => q(existing link not owned by stow)
|
||||
|
@ -144,7 +144,7 @@ make_link('bin6/file6', '../../stow/pkg6a/bin6/file6');
|
|||
make_dir('../stow/pkg6b/bin6');
|
||||
make_file('../stow/pkg6b/bin6/file6');
|
||||
|
||||
unstow_contents_orig('../stow/pkg6b', './');
|
||||
unstow_contents_orig('../stow/pkg6b', '.');
|
||||
ok(
|
||||
-l 'bin6/file6' && readlink('bin6/file6') eq '../../stow/pkg6a/bin6/file6'
|
||||
=> q(existing link owned by stow but points to a different package)
|
||||
|
@ -164,7 +164,7 @@ make_dir('stow/pkg7a/stow/pkg7b');
|
|||
make_file('stow/pkg7a/stow/pkg7b/file7b');
|
||||
make_link('stow/pkg7b', '../stow/pkg7a/stow/pkg7b');
|
||||
|
||||
unstow_contents_orig('stow/pkg7b', './');
|
||||
unstow_contents_orig('stow/pkg7b', '.');
|
||||
stderr_like(
|
||||
sub { process_tasks(); },
|
||||
qr/There are no outstanding operations to perform/,
|
||||
|
@ -194,7 +194,7 @@ make_dir('stow/pkg8a/stow2/pkg8b');
|
|||
make_file('stow/pkg8a/stow2/pkg8b/file8b');
|
||||
make_link('stow2/pkg8b', '../stow/pkg8a/stow2/pkg8b');
|
||||
|
||||
unstow_contents_orig('stow/pkg8a', './');
|
||||
unstow_contents_orig('stow/pkg8a', '.');
|
||||
stderr_like(
|
||||
sub { process_tasks(); },
|
||||
qr/There are no outstanding operations to perform/,
|
||||
|
@ -222,7 +222,7 @@ make_link('man9/man1/file9.1' => '../../../stow/pkg9a/man9/man1/file9.1'); # emu
|
|||
|
||||
make_dir('../stow/pkg9b/man9/man1');
|
||||
make_file('../stow/pkg9b/man9/man1/file9.1');
|
||||
unstow_contents_orig('../stow/pkg9b', './');
|
||||
unstow_contents_orig('../stow/pkg9b', '.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
@ -250,7 +250,7 @@ make_link('man10/man1/file10b.1' => '../../../stow/pkg10b/man10/man1/file10b.1'
|
|||
|
||||
make_dir('../stow/pkg10c/man10/man1');
|
||||
make_file('../stow/pkg10c/man10/man1/file10a.1');
|
||||
unstow_contents_orig('../stow/pkg10c', './');
|
||||
unstow_contents_orig('../stow/pkg10c', '.');
|
||||
stderr_like(
|
||||
sub { process_tasks(); },
|
||||
qr/There are no outstanding operations to perform/,
|
||||
|
@ -276,7 +276,7 @@ make_file('../stow/pkg12/man12/man1/.#file12.1');
|
|||
make_dir('man12/man1');
|
||||
make_link('man12/man1/file12.1' => '../../../stow/pkg12/man12/man1/file12.1');
|
||||
|
||||
unstow_contents_orig('../stow/pkg12', './');
|
||||
unstow_contents_orig('../stow/pkg12', '.');
|
||||
process_tasks();
|
||||
ok(
|
||||
scalar(@Conflicts) == 0 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue