From 8357dca6451729f05eb0d2018ff014c3fa63c883 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Wed, 11 Jan 2012 14:01:40 +0000 Subject: [PATCH] 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. --- NEWS | 4 ++++ THANKS | 1 + lib/Stow.pm.in | 1 - t/stow.t | 15 +++------------ t/unstow.t | 36 ++++++------------------------------ t/unstow_orig.t | 36 ++++++------------------------------ 6 files changed, 20 insertions(+), 73 deletions(-) diff --git a/NEWS b/NEWS index 17cbf15..0b8e2e6 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/THANKS b/THANKS index cc2f3d7..191e0ba 100644 --- a/THANKS +++ b/THANKS @@ -22,3 +22,4 @@ Austin Wood Christopher Hoobin Adam Spiers Stefano Lattarini +Adam Sampson diff --git a/lib/Stow.pm.in b/lib/Stow.pm.in index 47a863d..3565e3f 100755 --- a/lib/Stow.pm.in +++ b/lib/Stow.pm.in @@ -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; } diff --git a/t/stow.t b/t/stow.t index 395201f..ef32b78 100755 --- a/t/stow.t +++ b/t/stow.t @@ -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' diff --git a/t/unstow.t b/t/unstow.t index a666662..23f42e7 100755 --- a/t/unstow.t +++ b/t/unstow.t @@ -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 && diff --git a/t/unstow_orig.t b/t/unstow_orig.t index 79465ee..ef04459 100755 --- a/t/unstow_orig.t +++ b/t/unstow_orig.t @@ -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 &&