diff options
Diffstat (limited to 'lib/Youri/Submit/Action/Link.pm')
-rw-r--r-- | lib/Youri/Submit/Action/Link.pm | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/lib/Youri/Submit/Action/Link.pm b/lib/Youri/Submit/Action/Link.pm index eaadec1..b80d7e8 100644 --- a/lib/Youri/Submit/Action/Link.pm +++ b/lib/Youri/Submit/Action/Link.pm @@ -1,9 +1,9 @@ # $Id: /local/youri/soft/trunk/lib/Youri/Upload/Action/Sign.pm 1543 2006-03-21T20:22:54.334939Z guillaume $ -package Youri::Upload::Action::Link; +package Youri::Submit::Action::Link; =head1 NAME -Youri::Upload::Action::Link - Noarch packages linking +Youri::Submit::Action::Link - Noarch packages linking =head1 DESCRIPTION @@ -15,8 +15,9 @@ directories. use warnings; use strict; use Carp; +use Cwd; use File::Spec; -use base qw/Youri::Upload::Action/; +use base qw/Youri::Submit::Action/; sub _init { my $self = shift; @@ -35,20 +36,29 @@ sub run { # only needed for noarch packages return unless $package->get_arch() eq 'noarch'; - my $dest_dir = $repository->get_install_dir($package, $target, $define); - my (undef, $parent_dir, $relative_dir) = File::Spec->splitpath($dest_dir); + my $default_dir = $repository->get_install_dir($package, $target, $define); my $file = $package->get_file_name(); - foreach my $other_dir (grep { -d } <$parent_dir/*>) { - next if $other_dir eq $dest_dir; - chdir $other_dir; - my $source_file = "../$relative_dir/$file"; - if ($self->{_symbolic}) { - symlink $source_file, $file unless $self->{_test}; - } else { - link $source_file, $file unless $self->{_test}; + foreach my $arch ($repository->get_extra_arches()) { + # compute installation target, forcing arch + my $other_dir = $repository->get_install_dir( + $package, + $target, + $define, + { arch => $arch } + ); + + if (! $self->{_test}) { + my $current_dir = cwd(); + cd $other_dir; + my $default_file = File::Spec->abs2rel($default_dir) . '/' . $file; + if ($self->{_symbolic}) { + symlink $default_file, $file; + } else { + link $default_file, $file; + } + cd $current_dir; } - chdir '..'; } } |