aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2006-08-13 14:23:36 +0000
committerFlorent Villard <warly@mandriva.com>2006-08-13 14:23:36 +0000
commitc61b40ec8a61b54a5df408b7e965afc74d461766 (patch)
tree71879733b6f900ccdf53095e408d21c8a13f31e9
parent8ecb068666e7b0b35841e1d24b189287eaa8b5e6 (diff)
downloadmga-youri-core-c61b40ec8a61b54a5df408b7e965afc74d461766.tar
mga-youri-core-c61b40ec8a61b54a5df408b7e965afc74d461766.tar.gz
mga-youri-core-c61b40ec8a61b54a5df408b7e965afc74d461766.tar.bz2
mga-youri-core-c61b40ec8a61b54a5df408b7e965afc74d461766.tar.xz
mga-youri-core-c61b40ec8a61b54a5df408b7e965afc74d461766.zip
add a keep_svn_release to use this action both at maintainer upload and final upload
-rw-r--r--lib/Youri/Upload/Action/Send.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/Youri/Upload/Action/Send.pm b/lib/Youri/Upload/Action/Send.pm
index 77c3b2a..0f18766 100644
--- a/lib/Youri/Upload/Action/Send.pm
+++ b/lib/Youri/Upload/Action/Send.pm
@@ -14,6 +14,7 @@ This action plugin ensures installation of new package revisions.
use warnings;
use strict;
use Carp;
+use File::Basename;
use base qw/Youri::Upload::Action/;
sub _init {
@@ -24,16 +25,15 @@ sub _init {
user => '',
ssh_key => '',
verbose => '',
+ keep_svn_release => '',
@_
);
croak "undefined upload host" unless $options{uphost};
croak "undefined ssh key" unless $options{ssh_key};
- $self->{_perms} = $options{perms};
- $self->{_user} = $options{user};
- $self->{_uphost} = $options{uphost};
- $self->{_ssh_key} = $options{ssh_key};
- $self->{_verbose} = $options{verbose};
+ foreach my $var ('perms', 'user', 'uphost', 'ssh_key', 'verbose', 'keep_svn_release') {
+ $self->{"_$var"} = $options{$var};
+ }
return $self;
}
@@ -46,7 +46,12 @@ sub run {
my $dest = $repository->get_upload_dir($package, $target, $define);
print "Sending file $file to $dest\n" if $self->{_verbose};
- my ($base) = $file =~ /.*\/(?:@\d+:)?([^\/]*)/;
+ my $base;
+ if ($self->{_keep_svn_release}) {
+ $base = basename($file)
+ } else {
+ ($base) = $file =~ /.*\/(?:@\d+:)?([^\/]*)/
+ }
my $cmd = "scp -i $self->{_ssh_key} $file $self->{_user}\@$self->{_uphost}:/$dest$base.new";
my $cmd2 = "ssh -i $self->{_ssh_key} $self->{_user}\@$self->{_uphost} \"mv /$dest$base.new /$dest$base\"";