Changeset 260 for trunk/soft/ObsData/bin
- Timestamp:
- 10/19/06 17:14:37 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/soft/ObsData/bin/obsdata
r259 r260 34 34 'plugindir=s' => \my $plugindir, 35 35 'noreport' => \my $noreport, 36 'not-done' => \my $not_done, 36 37 ) or pod2usage(); 37 38 … … 49 50 Use this configuration file 50 51 51 =item --check52 53 Only check config file and exit54 55 52 =item -l|--logfile logfile 56 53 57 54 Write all messages into this file 58 55 59 =item - v|--verbose56 =item --not-done 60 57 61 Increase verbosity (this does not affect log output) 58 Replay archives already find but not extracted 59 60 =item --check 61 62 Only check config file and exit 62 63 63 64 =item --dry-run … … 68 69 69 70 Do not send mail report 71 72 =item -v|--verbose 73 74 Increase verbosity (this does not affect log output) 70 75 71 76 =item --debug … … 85 90 =cut 86 91 87 sub sub_interactive { 88 my ($oa, $oe) = @_; 89 for ($oe->id) { 90 /^do_archive$/ and do { 91 if ($onlyold && !$oe->test_result('archive_exists')) { 92 return 0; 93 } 94 if($onlynew && $oe->test_result('archive_exists')) { 95 return 0 96 } 97 }; 98 /^overwrite$/ && !$oe->test_result('dest_exists') and return 1; 92 my $interactive_callback = undef; 93 94 if ($not_done) { 95 $interactive_callback = sub { 96 my ($oa, $oe) = @_; 97 for ($oe->id) { 98 /^do_archive$/ and return $oe->test_result('archive_exists') || 0; 99 /^overwrite$/ and return($oe->test_result('dest_exists') ? 0 : 1); 100 /^do_data$/ && $not_done and return !$oe->test_result('data_extracted') || 0; 101 } 102 0 99 103 } 100 print $oe->message ."\n"; 101 foreach ($oe->list_test) { 102 printf("\t%s\n", $oe->test_message($_)); 104 } 105 106 if ($interactif) { 107 $interactive_callback = sub { 108 my ($oa, $oe) = @_; 109 for ($oe->id) { 110 /^do_archive$/ and do { 111 if ($onlyold && !$oe->test_result('archive_exists')) { 112 return 0; 113 } 114 if($onlynew && $oe->test_result('archive_exists')) { 115 return 0 116 } 117 }; 118 /^overwrite$/ && !$oe->test_result('dest_exists') and return 1; 119 } 120 print $oe->message ."\n"; 121 foreach ($oe->list_test) { 122 printf("\t%s\n", $oe->test_message($_)); 123 } 124 print "Processing ? Y/n: "; 125 my $res = <STDIN>; 126 chomp($res); 127 return($res =~ /^[Yy]$/ ? 1 : 0); 103 128 } 104 print "Processing ? Y/n: ";105 my $res = <STDIN>;106 chomp($res);107 return($res =~ /^[Yy]$/ ? 1 : 0);108 129 } 109 130 … … 118 139 printf("%-9s %s\n", sprintf("[%s]", ObsData::loglevel($_[0])), $_[1]); 119 140 }, 120 interactive_callback => $interacti f ? \&sub_interactive : undef,141 interactive_callback => $interactive_callback, 121 142 ) or do { 122 143 warn "Can't create obsdata object\n";
Note: See TracChangeset
for help on using the changeset viewer.