aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-09-26 09:58:44 +0000
committerOlivier Blin <oblin@mandriva.com>2007-09-26 09:58:44 +0000
commitf3b27dc1b28fd869d41152a838aa0ee59cb4d672 (patch)
tree662b5dc3c6de5fd692d693540b96e0a8d1bb16ec
parent273309435f1deba09bd79d5b8110c7f539d59ee0 (diff)
downloadmga-youri-submit-f3b27dc1b28fd869d41152a838aa0ee59cb4d672.tar
mga-youri-submit-f3b27dc1b28fd869d41152a838aa0ee59cb4d672.tar.gz
mga-youri-submit-f3b27dc1b28fd869d41152a838aa0ee59cb4d672.tar.bz2
mga-youri-submit-f3b27dc1b28fd869d41152a838aa0ee59cb4d672.tar.xz
mga-youri-submit-f3b27dc1b28fd869d41152a838aa0ee59cb4d672.zip
throw exception on failure, not to delete files that can be copied because of lack of space (upstream commit 1398)
-rw-r--r--lib/Youri/Submit/Action/Install.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Youri/Submit/Action/Install.pm b/lib/Youri/Submit/Action/Install.pm
index c6ce573..c26ec47 100644
--- a/lib/Youri/Submit/Action/Install.pm
+++ b/lib/Youri/Submit/Action/Install.pm
@@ -43,11 +43,17 @@ sub run {
unless ($self->{_test}) {
# create destination dir if needed
- system("install -d -m " . ($self->{_perms} + 111) . " $dest")
- unless -d $dest;
+ if (! -d $dest) {
+ my $status =
+ system("install -d -m " . ($self->{_perms} + 111) . " $dest");
+ croak "Unable to create directory $dest: $?" if $status;
+ }
# install file to new location
- system("install -m $self->{_perms} $file $dest/$rpm");
+ my $status =
+ system("install -m $self->{_perms} $file $dest");
+ croak "Unable to install file $file to $dest: $?" if $status;
+
my $arch = $package->get_arch();
$repository->set_arch_changed($target, $arch);
$repository->set_install_dir_changed($dest);