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.
* Changes in version 2.1.4
** Remove "There are no outstanding operations to perform" warning.
* Changes in version 2.1.3
** 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>
Adam Spiers <stow@adamspiers.org>
Stefano Lattarini
Adam Sampson

View file

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

View file

@ -161,8 +161,7 @@ make_file('../stow/pkg4c/bin4c/file4c', "bin4c/file4c - version originally in st
$stow->plan_stow('pkg4c');
is($stow->get_conflict_count, 0 => 'no conflicts with --adopt');
my @tasks = $stow->get_tasks;
is(@tasks, 4 => 'two tasks per file');
is($stow->get_tasks, 4 => 'two tasks per file');
$stow->process_tasks();
for my $file ('file4c', 'bin4c/file4c') {
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');
$stow->plan_stow('pkg10b');
stderr_like(
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process'
);
is($stow->get_tasks, 0, 'no tasks to process');
ok(
$stow->get_conflict_count == 0 &&
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');
$stow->plan_stow('pkg14');
stderr_like(
sub { $stow->process_tasks(); },
qr/There are no outstanding operations to perform/,
'no tasks to process'
);
is($stow->get_tasks, 0, 'no tasks to process');
ok(
$stow->get_conflict_count == 0 &&
! -l 'stow/pkg15'

View file

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