]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
option parser: fix import and export options
[wannabuild.git] / bin / wanna-build
index 9ef78632054ead7ea732c9e12e7faa3e4bdcf61e..ba9af8499d90b2cc00e53de16d07e79c66ef629b 100755 (executable)
@@ -64,7 +64,7 @@ use Dpkg::Deps; # TODO: same
 
 our ($verbose, $mail_logs, $list_order, $list_state,
     $curr_date, $op_mode, $user, $real_user, $distribution,
-    $fail_reason, $opt_override, $import_from, $export_to, $opt_create_db,
+    $fail_reason, $opt_override, $import_from, $export_to,
     %prioval, %sectval,
     $info_all_dists, $arch,
     $short_date, $list_min_age, $list_max_age, $dbbase, @curr_time,
@@ -106,7 +106,6 @@ GetOptions(
     },
     'verbose|v'       => \$verbose,
     'override|o'      => \$opt_override,
-    'create-db'       => \$opt_create_db,
     'correct-compare' => \$WannaBuild::opt_correct_version_cmp,
 
     # TODO: remove after buildds no longer pass to wanna-build
@@ -151,6 +150,7 @@ GetOptions(
                   reupload-wait bd-uninstallable ) ];
     },
     'dist|d=s' => sub {
+        $distribution = $_[1];
         given ( $_[1] ) {
             when ( [qw< a all >] ) {
                 $info_all_dists = 1;
@@ -183,13 +183,15 @@ GetOptions(
     'extra-conflicts=s' => \$extra_conflicts,
 
     # special actions
-    'export' => sub { _set_mode(@_); $export_to   = $_[1]; },
-    'import' => sub { _set_mode(@_); $import_from = $_[1]; },
+    'export=s' => sub { _set_mode(@_); $export_to   = $_[1]; },
+    'import=s' => sub { _set_mode(@_); $import_from = $_[1]; },
     'manual-edit'                => \&_set_mode,
     'distribution-architectures' => \&_set_mode,
     'distribution-aliases'       => \&_set_mode,
 ) or usage();
 $list_min_age = -1 * $list_max_age if $list_max_age;
+print "export: $export_to\n";
+print "mode: $op_mode\n";
 
 my $dbh;
 
@@ -1280,7 +1282,7 @@ sub sort_list_func {
 sub calculate_prio {
        my $priomap = $yamlmap->{priority};
        my $pkg = shift;
-        my @s=split("/", $pkg->{'section'});
+        my @s=split("/", $pkg->{'section'}//"");
         $pkg->{'component'} = $s[0] if $s[1];
         $pkg->{'component'} ||= 'main';
        $pkg->{'calprio'} = 0;
@@ -1564,6 +1566,7 @@ sub info_packages {
 }
 
 sub forget_packages {
+        no warnings;
        my( $name, $pkg, $key, $data );
        
        foreach $name (@_) {