aboutsummaryrefslogtreecommitdiffstats
path: root/bin/youri-submit.in
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-12-21 14:37:04 +0000
committerOlivier Blin <oblin@mandriva.com>2007-12-21 14:37:04 +0000
commitd17e089365b8a06b9545e4c3ca8c90a189aae127 (patch)
treed02acadeae9681f10df40ba2a17961d4f3db8f1f /bin/youri-submit.in
parent90e70ce4127024dcf51094d74d4d06b3239f3333 (diff)
downloadmga-youri-submit-d17e089365b8a06b9545e4c3ca8c90a189aae127.tar
mga-youri-submit-d17e089365b8a06b9545e4c3ca8c90a189aae127.tar.gz
mga-youri-submit-d17e089365b8a06b9545e4c3ca8c90a189aae127.tar.bz2
mga-youri-submit-d17e089365b8a06b9545e4c3ca8c90a189aae127.tar.xz
mga-youri-submit-d17e089365b8a06b9545e4c3ca8c90a189aae127.zip
merge youri-submit into youri-submit.in
Diffstat (limited to 'bin/youri-submit.in')
-rwxr-xr-xbin/youri-submit.in40
1 files changed, 25 insertions, 15 deletions
diff --git a/bin/youri-submit.in b/bin/youri-submit.in
index 002849a..48dd277 100755
--- a/bin/youri-submit.in
+++ b/bin/youri-submit.in
@@ -255,7 +255,7 @@ if ($config->get_arg('help')) {
pod2usage(-verbose => 0, -message => "No target specified, aborting\n")
unless @ARGV > 0;
pod2usage(-verbose => 0, -message => "No packages specified, aborting\n")
- unless @ARGV > 1;
+ unless @ARGV > 1 || $config->get_param('allow_omitting_packages');
# convenient global flags
my $test = $config->get_arg('test');
@@ -284,7 +284,7 @@ eval {
die "Failed to create repository: $@\n" if $@;
# perfrom pre action
-my $ok = 1;
+my @errors;
my $pre_packages = [];
my $skip_pres = $config->get_arg('skip-pre');
my %skip_pres = $skip_pres ? map { $_ => 1 } @{$skip_pres} : ();
@@ -313,21 +313,32 @@ foreach my $id (@{$target_conf->{pres}}) {
print STDERR "Failed to create pre $id: $@\n";
} else {
print "running pre $id\n" if $verbose;
- unless ($pre->run($pre_packages, $repository, $target, $config->get_param('define'))) {
- print STDERR "Error: " . $pre->get_error() . "\n";
- $ok = 0;
- }
+ my @err = $pre->run(
+ $pre_packages,
+ $repository,
+ $target,
+ $config->get_arg('define')
+ );
+ push(@errors, @err) if $err[0];
+ }
+}
+
+if (@errors) {
+ print "Pre-submission errors, aborting:\n";
+ foreach my $error (@errors) {
+ print " - $error\n";
}
+ exit(1)
}
-exit(1) unless $ok;
# create packages group
-my @packages_group;
my $group_error;
-foreach my $group ((map { [ { section => "", file => $_ } ] } @ARGV), @$pre_packages) {
+my @packages_group;
+foreach my $group ([ map { { section => "", file => $_ } } @ARGV ], @$pre_packages) {
my @packages;
foreach my $opt (@$group) {
- print "Preparing upload for $opt->{file}\n" if $verbose;
+ print "Preparing upload for $opt->{file} in $opt->{section}\n" if $verbose;
+ $repository->{packages}{$opt->{file}}{section} = $opt->{section};
push(
@packages,
create_instance(
@@ -423,7 +434,7 @@ foreach my $group ((map { [ { section => "", file => $_ } ] } @ARGV), @$pre_pac
foreach my $package (@packages) {
print "running reject $id on package $package\n" if $verbose;
eval {
- $reject->run($package, \%errors, $repository, $target, $config->get('define'));
+ $reject->run($package, \%errors, $repository, $target, $config->get_arg('define'));
};
if ($@) {
print STDERR "Failed to run action $id on package $package: $@\n";
@@ -490,7 +501,7 @@ foreach my $group ((map { [ { section => "", file => $_ } ] } @ARGV), @$pre_pac
# perfrom post action
my $skip_post = $config->get_arg('skip-post');
my %skip_post = $skip_post ? map { $_ => 1 } @{$skip_post} : ();
-foreach my $id (@{$target_conf->{post}}) {
+foreach my $id (@{$target_conf->{posts}}) {
next if $skip_post{$id};
print "Creating post $id\n" if $verbose;
my $post;
@@ -515,9 +526,8 @@ foreach my $id (@{$target_conf->{post}}) {
print STDERR "Failed to create post $id: $@\n";
} else {
print "running post $id\n" if $verbose;
- unless ($post->run($repository, $target, $config->get('define'))) {
- print STDERR "Error: " . $post->get_error() . "\n";
- }
+ my @err = $post->run($repository, $target, $config->get_arg('define'));
+ print STDERR "Error $id: @err\n" if @err
}
}