Remove "There are no outstanding operations to perform" warning.

This is more in keeping with the UNIX convention of no output on success,
and is also the way Stow v1.x behaved.  Thanks to Adam Sampson for the suggestion.
This commit is contained in:
Adam Spiers 2012-01-11 14:01:40 +00:00
parent d51ff055c2
commit 8357dca645
6 changed files with 20 additions and 73 deletions

4
NEWS
View file

@ -1,5 +1,9 @@
News file for Stow. News file for Stow.
* Changes in version 2.1.4
** Remove "There are no outstanding operations to perform" warning.
* Changes in version 2.1.3 * Changes in version 2.1.3
** New --adopt / -a option ** New --adopt / -a option

1
THANKS
View file

@ -22,3 +22,4 @@ Austin Wood <austin.wood@rmit.edu.au>
Christopher Hoobin <christopher.hoobin.edu.au> Christopher Hoobin <christopher.hoobin.edu.au>
Adam Spiers <stow@adamspiers.org> Adam Spiers <stow@adamspiers.org>
Stefano Lattarini Stefano Lattarini
Adam Sampson

View file

@ -1391,7 +1391,6 @@ sub process_tasks {
$self->{tasks} = [ grep { $_->{action} ne 'skip' } @{ $self->{tasks} } ]; $self->{tasks} = [ grep { $_->{action} ne 'skip' } @{ $self->{tasks} } ];
if (not @{ $self->{tasks} }) { if (not @{ $self->{tasks} }) {
warn "There are no outstanding operations to perform.\n";
return; return;
} }

View file

@ -161,8 +161,7 @@ make_file('../stow/pkg4c/bin4c/file4c', "bin4c/file4c - version originally in st
$stow->plan_stow('pkg4c'); $stow->plan_stow('pkg4c');
is($stow->get_conflict_count, 0 => 'no conflicts with --adopt'); is($stow->get_conflict_count, 0 => 'no conflicts with --adopt');
my @tasks = $stow->get_tasks; is($stow->get_tasks, 4 => 'two tasks per file');
is(@tasks, 4 => 'two tasks per file');
$stow->process_tasks(); $stow->process_tasks();
for my $file ('file4c', 'bin4c/file4c') { for my $file ('file4c', 'bin4c/file4c') {
ok(-l $file, "$file turned into a symlink"); ok(-l $file, "$file turned into a symlink");
@ -287,11 +286,7 @@ make_dir('../stow/pkg10b/man10/man1');
make_file('../stow/pkg10b/man10/man1/file10.1'); make_file('../stow/pkg10b/man10/man1/file10.1');
$stow->plan_stow('pkg10b'); $stow->plan_stow('pkg10b');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process'
);
ok( ok(
$stow->get_conflict_count == 0 && $stow->get_conflict_count == 0 &&
readlink('man10/man1/file10.1') eq '../../../stow/pkg10a/man10/man1/file10.1' readlink('man10/man1/file10.1') eq '../../../stow/pkg10a/man10/man1/file10.1'
@ -371,11 +366,7 @@ make_dir('stow/pkg14/stow/pkg15');
make_file('stow/pkg14/stow/pkg15/node15'); make_file('stow/pkg14/stow/pkg15/node15');
$stow->plan_stow('pkg14'); $stow->plan_stow('pkg14');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process'
);
ok( ok(
$stow->get_conflict_count == 0 && $stow->get_conflict_count == 0 &&
! -l 'stow/pkg15' ! -l 'stow/pkg15'

View file

@ -146,11 +146,7 @@ make_file('stow/pkg7a/stow/pkg7b/file7b');
make_link('stow/pkg7b', '../stow/pkg7a/stow/pkg7b'); make_link('stow/pkg7b', '../stow/pkg7a/stow/pkg7b');
$stow->plan_unstow('pkg7b'); $stow->plan_unstow('pkg7b');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg7b');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg7b'
);
ok( ok(
$stow->get_conflict_count == 0 && $stow->get_conflict_count == 0 &&
-l 'stow/pkg7b' && -l 'stow/pkg7b' &&
@ -172,11 +168,7 @@ make_file('stow/pkg8a/stow2/pkg8b/file8b');
make_link('stow2/pkg8b', '../stow/pkg8a/stow2/pkg8b'); make_link('stow2/pkg8b', '../stow/pkg8a/stow2/pkg8b');
$stow->plan_unstow('pkg8a'); $stow->plan_unstow('pkg8a');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg8a');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg8a'
);
ok( ok(
$stow->get_conflict_count == 0 && $stow->get_conflict_count == 0 &&
-l 'stow2/pkg8b' && -l 'stow2/pkg8b' &&
@ -224,11 +216,7 @@ make_link('man10/man1/file10b.1' => '../../../stow/pkg10b/man10/man1/file10b.1'
make_dir('../stow/pkg10c/man10/man1'); make_dir('../stow/pkg10c/man10/man1');
make_file('../stow/pkg10c/man10/man1/file10a.1'); make_file('../stow/pkg10c/man10/man1/file10a.1');
$stow->plan_unstow('pkg10c'); $stow->plan_unstow('pkg10c');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg10c');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg10c'
);
ok( ok(
$stow->get_conflict_count == 0 && $stow->get_conflict_count == 0 &&
readlink('man10/man1/file10a.1') eq '../../../stow/pkg10a/man10/man1/file10a.1' readlink('man10/man1/file10a.1') eq '../../../stow/pkg10a/man10/man1/file10a.1'
@ -260,11 +248,7 @@ ok(
# #
$stow = new_Stow(); $stow = new_Stow();
$stow->plan_unstow('pkg12'); $stow->plan_unstow('pkg12');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg12');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg12'
);
ok( ok(
$stow->get_conflict_count == 0 $stow->get_conflict_count == 0
=> 'unstow already unstowed package pkg12' => 'unstow already unstowed package pkg12'
@ -279,11 +263,7 @@ mkdir("$OUT_DIR/target");
$stow = new_Stow(); $stow = new_Stow();
$stow->plan_unstow('pkg12'); $stow->plan_unstow('pkg12');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg12 which was never stowed');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg12 which was never stowed'
);
ok( ok(
$stow->get_conflict_count == 0 $stow->get_conflict_count == 0
=> 'unstow never stowed package pkg12' => 'unstow never stowed package pkg12'
@ -296,11 +276,7 @@ make_file('man12/man1/file12.1');
$stow = new_Stow(); $stow = new_Stow();
$stow->plan_unstow('pkg12'); $stow->plan_unstow('pkg12');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg12 for third time');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg12 for third time'
);
%conflicts = $stow->get_conflicts; %conflicts = $stow->get_conflicts;
ok( ok(
$stow->get_conflict_count == 1 && $stow->get_conflict_count == 1 &&

View file

@ -152,11 +152,7 @@ make_file('stow/pkg7a/stow/pkg7b/file7b');
make_link('stow/pkg7b', '../stow/pkg7a/stow/pkg7b'); make_link('stow/pkg7b', '../stow/pkg7a/stow/pkg7b');
$stow->plan_unstow('pkg7b'); $stow->plan_unstow('pkg7b');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg7b');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg7b'
);
ok( ok(
$stow->get_conflict_count == 0 && $stow->get_conflict_count == 0 &&
-l 'stow/pkg7b' && -l 'stow/pkg7b' &&
@ -178,11 +174,7 @@ make_file('stow/pkg8a/stow2/pkg8b/file8b');
make_link('stow2/pkg8b', '../stow/pkg8a/stow2/pkg8b'); make_link('stow2/pkg8b', '../stow/pkg8a/stow2/pkg8b');
$stow->plan_unstow('pkg8a'); $stow->plan_unstow('pkg8a');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg8a');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg8a'
);
ok( ok(
$stow->get_conflict_count == 0 && $stow->get_conflict_count == 0 &&
-l 'stow2/pkg8b' && -l 'stow2/pkg8b' &&
@ -230,11 +222,7 @@ make_link('man10/man1/file10b.1' => '../../../stow/pkg10b/man10/man1/file10b.1'
make_dir('../stow/pkg10c/man10/man1'); make_dir('../stow/pkg10c/man10/man1');
make_file('../stow/pkg10c/man10/man1/file10a.1'); make_file('../stow/pkg10c/man10/man1/file10a.1');
$stow->plan_unstow('pkg10c'); $stow->plan_unstow('pkg10c');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg10c');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg10c'
);
ok( ok(
$stow->get_conflict_count == 0 && $stow->get_conflict_count == 0 &&
readlink('man10/man1/file10a.1') eq '../../../stow/pkg10a/man10/man1/file10a.1' readlink('man10/man1/file10a.1') eq '../../../stow/pkg10a/man10/man1/file10a.1'
@ -266,11 +254,7 @@ ok(
# #
$stow = new_compat_Stow(); $stow = new_compat_Stow();
$stow->plan_unstow('pkg12'); $stow->plan_unstow('pkg12');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg12');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg12'
);
ok( ok(
$stow->get_conflict_count == 0 $stow->get_conflict_count == 0
=> 'unstow already unstowed package pkg12' => 'unstow already unstowed package pkg12'
@ -285,11 +269,7 @@ mkdir("$OUT_DIR/target");
$stow = new_compat_Stow(); $stow = new_compat_Stow();
$stow->plan_unstow('pkg12'); $stow->plan_unstow('pkg12');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg12 which was never stowed');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg12 which was never stowed'
);
ok( ok(
$stow->get_conflict_count == 0 $stow->get_conflict_count == 0
=> 'unstow never stowed package pkg12' => 'unstow never stowed package pkg12'
@ -302,11 +282,7 @@ make_file('man12/man1/file12.1');
$stow = new_compat_Stow(); $stow = new_compat_Stow();
$stow->plan_unstow('pkg12'); $stow->plan_unstow('pkg12');
stderr_like( is($stow->get_tasks, 0, 'no tasks to process when unstowing pkg12 for third time');
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process when unstowing pkg12 for third time'
);
%conflicts = $stow->get_conflicts; %conflicts = $stow->get_conflicts;
ok( ok(
$stow->get_conflict_count == 1 && $stow->get_conflict_count == 1 &&