diff options
Diffstat (limited to 'lib/Youri/Submit/Pre')
-rw-r--r-- | lib/Youri/Submit/Pre/Rsync.pm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Youri/Submit/Pre/Rsync.pm b/lib/Youri/Submit/Pre/Rsync.pm index 2867b22..7dd7487 100644 --- a/lib/Youri/Submit/Pre/Rsync.pm +++ b/lib/Youri/Submit/Pre/Rsync.pm @@ -43,26 +43,28 @@ sub run { $self->{_error} = "Reading queue directory failed"; # now get the packages downloaded my %packages; - opendir my $queuedh, "$self->{_destination}/$target/" or return; - opendir my $targetdh, $queue or return; + opendir my $queuedh, "$self->{_destination}/$target/" or return "Could not open $self->{_destination}/$target"; + opendir my $targetdh, $queue or return "Could not open $queue"; my $idx; foreach my $media (readdir $targetdh) { $media =~ /^\.{1,2}$/ and next; print "$target - $media\n"; if (-d "$queue/$media") { - opendir my $submediadh, "$queue/$media" or return; + opendir my $submediadh, "$queue/$media" or return "Could not open $queue/$media"; foreach my $submedia (readdir $submediadh) { $submedia =~ /^\.{1,2}$/ and next; print "$target - $media - $submedia\n"; - opendir my $rpmdh, "$queue/$media/$submedia" or return; + opendir my $rpmdh, "$queue/$media/$submedia" or return "Could not open $queue/$media/$submedia"; foreach my $rpm (readdir $rpmdh) { $rpm =~ /^\.{1,2}$/ and next; print "$target - $media - $submedia : $rpm\n"; - if ($rpm =~ /^(\d{14}\.\w+\.\w+\.\d+)_.*\.\.rpm$/) { - push @{$packages{$1}{rpms}}, { section => "$media/$submedia", file => "$queue/$media/$submedia/$rpm" }; + my $file = "$queue/$media/$submedia/$rpm"; + $file =~ s/\/+/\//g; + if ($rpm =~ /^(\d{14}\.\w+\.\w+\.\d+)_.*\.rpm$/) { + push @{$packages{$1}{rpms}}, { section => "$media/$submedia", file => $file }; } elsif ($rpm =~ /\.rpm$/) { $idx++; - push @{$packages{"independant_$idx"}{rpms}}, { section => "$media/$submedia", file => "$queue/$media/$submedia/$rpm" } + push @{$packages{"independant_$idx"}{rpms}}, { section => "$media/$submedia", file => $file } } } } @@ -71,7 +73,7 @@ sub run { foreach my $key (keys %packages) { push @$pre_packages, $packages{$key}{rpms} } - 1 + return } =head1 COPYRIGHT AND LICENSE |