From 7439fb1b11e78750a092a8ce2218a0aa8d6e7176 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 22 May 2011 21:06:16 +0000 Subject: Update bin/youri-submit which for some unknown reason is in svn --- bin/youri-submit | 74 ++++++-------------------------------------------------- 1 file changed, 8 insertions(+), 66 deletions(-) diff --git a/bin/youri-submit b/bin/youri-submit index 2cec209..2edd6e4 100755 --- a/bin/youri-submit +++ b/bin/youri-submit @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: youri-submit 232579 2007-12-17 19:45:47Z blino $ +# $Id: youri-submit.in 232668 2007-12-21 14:37:04Z blino $ =head1 NAME @@ -20,7 +20,6 @@ youri-submit --help [category] [item] Options: --config use file as config file - --skip-pre
       skip pre 
     --skip-check    skip check 
     --skip-action  skip action 
     --skip-post      skip post 
@@ -48,10 +47,6 @@ passed to a list of action plugins, depending also on given upload target.
 
 Use given file as configuration, instead of normal one.
 
-=item B<--skip-pre> I
-
-Skip pre transaction plugin with given identity
-
 =item B<--skip-check> I
 
 Skip check plugin with given identity.
@@ -84,10 +79,11 @@ Produce more verbose output (can be used more than once)
 
 Don't perform any modification.
 
-=item B<--list> I
+=item B<--list> I I[target]
  
 List available items from given category and exits. Category must be either
-B, B or B. A target is needed for the two last ones.
+B, B, B, B or B.
+A target is needed except for B.
  
 =item B<--help> I
  
@@ -178,7 +174,6 @@ my $config = Youri::Config->new(
         'test'        => '|t!',
         'list'        => '|l!',
         'config'      => '=s',
-        'skip-prei'   => '=s@',
         'skip-post'   => '=s@',
         'skip-reject' => '=s@',
     },
@@ -192,17 +187,12 @@ if ($config->get_arg('list')) {
         unless $category;
     if ($category eq 'targets') { 
         print join(' ', keys %{$config->get_param('targets')});
-    } elsif ($category eq 'checks' || $category eq 'actions') {
+    } elsif ($category =~ /^(actions|checks|posts|rejects)$/) {
         my $target = $ARGV[1];
         pod2usage(-verbose => 0, -message => "No target specified, aborting\n")
             unless $target;
-        if ($category eq 'checks') {
-            my $checks = $config->get_param('targets')->{$target}->{checks};
-            print join(' ', @{$checks}) if $checks;
-        } else {
-            my $actions = $config->get_param('targets')->{$target}->{actions};
-            print join(' ', @{$actions}) if $actions;
-        }
+        my $items = $config->get_param('targets')->{$target}->{$category};
+        print join(' ', @{$items}) if $items;
     } else {
         pod2usage(-verbose => 0, -message => "Invalid category $category, aborting\n")
     }
@@ -283,58 +273,10 @@ eval {
 };
 die "Failed to create repository: $@\n" if $@;
 
-# perfrom pre action
-my @errors;
-my $pre_packages = [];
-my $skip_pres = $config->get_arg('skip-pre');
-my %skip_pres = $skip_pres ?  map { $_ => 1 } @{$skip_pres} : ();
-foreach my $id (@{$target_conf->{pres}}) { 
-    next if $skip_pres{$id};
-    print "Creating pre $id\n" if $verbose;
-    my $pre;
-    my $pre_conf = $config->get_param('pres')->{$id};
-
-    if (!$pre_conf) {
-	print STDERR "No such pre $id, skipping\n";
-	next;
-    }
-    eval {
-	$pre = create_instance(
-	    'Youri::Submit::Pre',
-	    $pre_conf,
-	    {
-		id       => $id,
-		test     => $test,
-		verbose  => $verbose > 0 ? $verbose - 1 : 0,
-	    }
-	);
-    };
-    if ($@) {
-	print STDERR "Failed to create pre $id: $@\n";
-    } else {
-	print "running pre $id\n" if $verbose;
-	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)
-}
-
 # create packages group
 my $group_error;
 my @packages_group;
-foreach my $group ([ map { { section => "", file => $_ } } @ARGV ], @$pre_packages) {
+foreach my $group ([ map { { section => "", file => $_ } } @ARGV ]) {
     my @packages;
     foreach my $opt (@$group) {
 	print "Preparing upload for $opt->{file} in $opt->{section}\n" if $verbose;
-- 
cgit v1.2.1