summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorAdam Spiers <stow@adamspiers.org>2015-01-01 19:02:46 +0000
committerAdam Spiers <stow@adamspiers.org>2015-01-01 19:02:46 +0000
commit7b43622dd9ff7b8793d1c08727f84ac5069d3fb4 (patch)
treea19760b9facaaa7ad29f604913b9bfd11adfe641 /t
parent5be496a795eae8a139105d57fa98a9fcb172a122 (diff)
downloadstow-7b43622dd9ff7b8793d1c08727f84ac5069d3fb4.tar.gz
fix stowing of relative links when --no-folding is used
With a tree like this: . |-- stow | `-- pkg | `-- lib | |-- itk-current -> itk4.0.0 | `-- itk4.0.0 | `-- libitk4.0.0.so `-- target `-- lib |-- itk4.0.0 -> ../../stow/pkg/lib/itk4.0.0 `-- libfoo-1.2.3.so stowing pkg with the --no-folding option resulted in itk-current being "unpacked": . `-- target `-- lib |-- itk-current | `-- libitk4.0.0.so -> ../../../stow/pkg/lib/itk-current/libitk4.0.0.so |-- itk4.0.0 | `-- libitk4.0.0.so -> ../../../stow/pkg/lib/itk4.0.0/libitk4.0.0.so `-- libfoo-1.2.3.so This commit fixes it so that it gets stowed as a symlink: . `-- target `-- lib ... |-- itk-current -> ../../stow/pkg/lib/itk-current ... Thanks to Gabriele Balducci for reporting this problem: http://thread.gmane.org/gmane.comp.gnu.stow.general/6676
Diffstat (limited to 't')
-rwxr-xr-xt/stow.t9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/stow.t b/t/stow.t
index 793e14e..92141fc 100755
--- a/t/stow.t
+++ b/t/stow.t
@@ -7,7 +7,7 @@
use strict;
use warnings;
-use Test::More tests => 112;
+use Test::More tests => 118;
use Test::Output;
use English qw(-no_match_vars);
@@ -461,6 +461,7 @@ sub create_pkg {
# yet stowed
make_dir ("$stow_pkg/$id-$pkg-only-new2/subdir");
make_file("$stow_pkg/$id-$pkg-only-new2/subdir/$id-file-$pkg");
+ make_link("$stow_pkg/$id-$pkg-only-new2/current", "subdir");
# create a hierarchy specific to this package which is already
# stowed via a folded tree
@@ -487,7 +488,7 @@ $stow->plan_stow('no-folding-a');
is_deeply([ $stow->get_conflicts ], [] => 'no conflicts with --no-folding');
my @tasks = $stow->get_tasks;
use Data::Dumper;
-is(scalar(@tasks), 12 => "6 dirs, 6 links") || warn Dumper(\@tasks);
+is(scalar(@tasks), 13 => "6 dirs, 7 links") || warn Dumper(\@tasks);
$stow->process_tasks();
sub check_no_folding {
@@ -508,6 +509,8 @@ sub check_no_folding {
is_dir_not_symlink("no-folding-$pkg-only-new2/subdir");
is_link("no-folding-$pkg-only-new2/subdir/no-folding-file-$pkg",
"../../$stow_pkg/no-folding-$pkg-only-new2/subdir/no-folding-file-$pkg");
+ is_link("no-folding-$pkg-only-new2/current",
+ "../$stow_pkg/no-folding-$pkg-only-new2/current");
# check shared tree is not folded. first time round this will be
# newly stowed.
@@ -530,7 +533,7 @@ $stow = new_Stow('no-folding' => 1);
$stow->plan_stow('no-folding-b');
is_deeply([ $stow->get_conflicts ], [] => 'no conflicts with --no-folding');
@tasks = $stow->get_tasks;
-is(scalar(@tasks), 10 => '4 dirs, 6 links') || warn Dumper(\@tasks);
+is(scalar(@tasks), 11 => '4 dirs, 7 links') || warn Dumper(\@tasks);
$stow->process_tasks();
check_no_folding('a');