Changeset 24125
- Timestamp:
- May 9, 2009, 2:19:48 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
-
dbconfig/changes.txt (modified) (1 diff)
-
dbconfig/receive.md (modified) (1 diff)
-
ippScripts/scripts/dist_advancerun.pl (modified) (5 diffs)
-
ippScripts/scripts/dist_make_fileset.pl (modified) (2 diffs)
-
ippScripts/scripts/receive_file.pl (modified) (9 diffs)
-
ippScripts/scripts/receive_fileset.pl (modified) (1 diff)
-
ippTasks/dist.pro (modified) (1 diff)
-
ippTasks/receive.pro (modified) (4 diffs)
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 diff)
-
ippTools/share/receivetool_pendingfile.sql (modified) (2 diffs)
-
ippTools/share/receivetool_revert.sql (modified) (1 diff)
-
ippTools/share/receivetool_toadvance.sql (modified) (1 diff)
-
ippTools/src/disttool.c (modified) (1 diff)
-
ippTools/src/receivetool.c (modified) (4 diffs)
-
ippTools/src/receivetoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/changes.txt
r24108 r24125 1102 1102 ALTER TABLE receiveFile ADD COLUMN component VARCHAR(64); 1103 1103 1104 ALTER TABLE receiveFileset CHANGE COLUMN dbinfo_uri dbinfo VARCHAR(255); 1105 ALTER TABLE receiveFileset ADD COLUMN dirinfo VARCHAR(255) AFTER state; 1106 -
trunk/dbconfig/receive.md
r24108 r24125 18 18 fileset STR 128 19 19 state STR 64 20 dbinfo_uri STR 255 20 dirinfo STR 255 21 dbinfo STR 255 21 22 fault S16 0 # Key 22 23 END -
trunk/ippScripts/scripts/dist_advancerun.pl
r23874 r24125 16 16 use IPC::Cmd 0.36 qw( can_run run ); 17 17 use File::Temp qw( tempfile ); 18 use File::Basename qw( basename);18 use File::Basename qw( dirname); 19 19 use PS::IPP::Metadata::Config; 20 20 use PS::IPP::Metadata::List qw( parse_md_list ); … … 72 72 73 73 my $tool_cmd; 74 my $list_mode; 75 my $component_key; 74 76 if ($stage eq "raw") { 75 77 $tool_cmd = "$regtool -exp_id"; 78 $list_mode = "-processedimfile"; 79 $component_key = "class_id"; 76 80 } elsif ($stage eq "chip") { 77 81 $tool_cmd = "$chiptool -chip_id"; 82 $list_mode = "-processedimfile"; 83 $component_key = "class_id"; 78 84 } elsif ($stage eq "camera") { 79 85 $tool_cmd = "$camtool -cam_id"; 86 $list_mode = "-processedexp"; 87 $component_key = ""; 80 88 } elsif ($stage eq "fake") { 81 89 $tool_cmd = "$faketool -fake_id"; 90 $list_mode = "-processedimfile"; 91 $component_key = "class_id"; 82 92 } elsif ($stage eq "warp") { 83 93 $tool_cmd = "$warptool -warp_id"; 94 $list_mode = "-warped"; 95 $component_key = "skycell_id"; 84 96 } elsif ($stage eq "stack") { 85 97 $tool_cmd = "$stacktool -stack_id"; 98 $list_mode = "-sumskyfile"; 99 $component_key = "skycell_id"; 86 100 } elsif ($stage eq "diff") { 87 101 $tool_cmd = "$difftool -diff_id"; 102 $list_mode = "-diffskyfile"; 103 $component_key = "skycell_id"; 88 104 } else { 89 105 &my_die("Unexpected stage: $stage", $dist_id, $PS_EXIT_CONFIG_ERROR); 90 106 } 91 107 108 $tool_cmd .= " $stage_id"; 109 92 110 # XXX should we create a file rule for this? 93 my $ outfile = "$outdir/dbinfo.$stage.$stage_id.mdc";94 95 { 96 my $command = "$tool_cmd $stage_id -exportrun -outfile $outfile";111 my $dbinfo_file = "$outdir/dbinfo.$stage.$stage_id.mdc"; 112 113 { 114 my $command = "$tool_cmd -exportrun -outfile $dbinfo_file"; 97 115 $command .= " -clean" if defined $clean; 98 116 $command .= " -dbname $dbname" if defined $dbname; … … 105 123 } 106 124 } 107 108 # set distRun.stage = 'full' 109 { 110 my $command = "$disttool -updaterun -dist_id $dist_id -set_state full"; 125 my $dirinfo = "$outdir/dirinfo.$stage.$stage_id.mdc"; 126 { 127 my $command = "$tool_cmd $list_mode"; 111 128 $command .= " -dbname $dbname" if defined $dbname; 112 129 … … 117 134 &my_die("Unable to perform $command: $error_code", $dist_id, $error_code); 118 135 } 136 if (@$stdout_buf == 0) { 137 &my_die("Unable to perform $command: $error_code", $dist_id, $error_code); 138 } 139 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 140 &my_die("Unable to parse metadata config doc", $dist_id, $PS_EXIT_UNKNOWN_ERROR); 141 my $components = parse_md_list($metadata) or 142 &my_die("Unable to parse metadata list", $dist_id, $PS_EXIT_UNKNOWN_ERROR); 143 144 open MANIFEST, ">$dirinfo" or 145 &my_die("Unable to open dirinfo file $dirinfo", $dist_id, $PS_EXIT_UNKNOWN_ERROR); 146 147 my $destdir; 148 foreach my $c (@$components) { 149 if (!$destdir) { 150 my $workdir = $c->{workdir}; 151 if ($workdir) { 152 $destdir = stripvolume($workdir, $stage); 153 } elsif ($stage eq 'raw') { 154 $destdir = 'none'; 155 } else { 156 &my_die("workdir not found for open dirinfo file $dirinfo", $dist_id, $PS_EXIT_UNKNOWN_ERROR); 157 } 158 print MANIFEST "destdir METADATA\n"; 159 print MANIFEST "\t" , "destdir", "\tSTR\t", $destdir, "\n"; 160 print MANIFEST "END\n\n"; 161 print MANIFEST "components METADATA\n"; 162 } 163 my $component = $c->{$component_key} ? $c->{$component_key} : "exposure"; 164 my $path; 165 if ($stage eq 'raw') { 166 $path = $c->{uri}; 167 } else { 168 $path = $c->{path_base}; 169 } 170 &my_die("unable to find path", $dist_id, $PS_EXIT_UNKNOWN_ERROR) if !$path; 171 my $component_dir = find_componentdir($destdir, $path); 172 # print MANIFEST "$component METADATA\n"; 173 print MANIFEST "\t" , "$component", "\tSTR\t", $component_dir, "\n"; 174 } 175 print MANIFEST "END\n\n"; 176 close MANIFEST or 177 &my_die("Unable to close dirinfo file $dirinfo", $dist_id, $PS_EXIT_UNKNOWN_ERROR); 178 } 179 180 { 181 my $command = "$disttool -updaterun -dist_id $dist_id -set_state full"; 182 $command .= " -dbname $dbname" if defined $dbname; 183 184 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 185 run(command => $command, verbose => $verbose); 186 unless ($success) { 187 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 188 &my_die("Unable to perform $command: $error_code", $dist_id, $error_code); 189 } 119 190 } 120 191 … … 124 195 ### Pau. 125 196 197 sub stripvolume 198 { 199 my $path = shift; 200 my $stage = shift; 201 my @segments; 202 203 # workdir isn't what we want for raw stage 204 return "none" if ($stage and ($stage eq 'raw')); 205 206 my $scheme = file_scheme($path); 207 my $tail; 208 if ($scheme) { 209 # strip off scheme:// 210 $tail = substr($path, length($scheme) + 3); 211 } elsif (substr($path, 0, 1) eq '/') { 212 $tail = substr($path, 1); 213 $scheme = ""; 214 } 215 # remove any leading / that are left 216 while ((substr($tail, 0, 1) eq '/')) { 217 $tail = substr($tail, 1); 218 } 219 220 if (($scheme eq 'neb') or ($scheme eq 'path')) { 221 my $volume; 222 ($volume, @segments) = split '/', $tail; 223 224 } elsif (!$scheme or ($scheme eq 'file')) { 225 226 # XXX Here we're assuming the /data/ipp??? structure. This won't be true when data is forwarded 227 # by remote sites. We need a way to configure this 228 my $volume; 229 230 # data/ippxxx/dirs 231 (undef, $volume, @segments) = split '/', $tail; 232 } else { 233 die( "unexpected workdir value: $path\n"); 234 } 235 236 return caturi(@segments); 237 } 238 239 sub find_componentdir 240 { 241 my $destdir = shift; 242 my $path = shift; 243 244 my $result; 245 if ($destdir eq 'none') { 246 $result = stripvolume($path); 247 } else { 248 # find location of destdir in the path 249 my $i = index($path, $destdir); 250 251 $result = substr($path, $i + length($destdir) + 1); 252 253 while (substr($result, 0, 1) eq '/') { 254 $result = substr($result, 1); 255 } 256 } 257 return dirname($result); 258 } 126 259 127 260 sub my_die -
trunk/ippScripts/scripts/dist_make_fileset.pl
r24104 r24125 91 91 &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR); 92 92 } 93 print "dbinfo file $dbinfo_file exists\n"; 93 print "dbinfo file $dbinfo_file exists\n" if $verbose; 94 95 # make sure that the dirinfo file for this run exists 96 my $dirinfo_file = "dirinfo.$stage.$stage_id.mdc"; 97 if (! -e "$dist_dir/$dirinfo_file" ) { 98 &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR); 99 } 100 print "dirinfo file $dirinfo_file exists\n" if $verbose; 94 101 95 102 # open the dsreg file list … … 97 104 98 105 # add the dbinfo file to the list 99 # XXX: change type from text to dbinfo once we descide ontypes106 # XXX: change type from text to dbinfo and dirinfo once we define the types 100 107 print $listFile "$dbinfo_file|||text|dbinfo|\n"; 108 print $listFile "$dirinfo_file|||text|dirinfo|\n"; 101 109 102 110 my $components; -
trunk/ippScripts/scripts/receive_file.pl
r24102 r24125 17 17 use IPC::Cmd 0.36 qw( can_run run ); 18 18 use PS::IPP::Metadata::Config; 19 use PS::IPP::Metadata::List qw( parse_md_list ); 19 20 use PS::IPP::Config 1.01 qw( :standard ); 20 21 use File::Temp qw( tempfile ); 22 use File::Basename qw( basename ); 21 23 use Carp; 22 24 … … 36 38 37 39 # Parse the command-line arguments 38 my ( $file_id, $source, $product, $fileset, $fileset_id, $file, $component, $bytes, $md5sum, $workdir, $d bname, $verbose, $no_update, $save_temps );40 my ( $file_id, $source, $product, $fileset, $fileset_id, $file, $component, $bytes, $md5sum, $workdir, $dirinfo_uri, $dbname, $verbose, $no_update, $save_temps ); 39 41 40 42 GetOptions( … … 49 51 'md5sum=s' => \$md5sum, # md5sum for file from data store 50 52 'workdir=s' => \$workdir, # Working directory for output 53 'dirinfo=s' => \$dirinfo_uri, # file containing the destination directories for this component 51 54 'dbname=s' => \$dbname, # Database name 52 55 'verbose' => \$verbose, # Print to stdout … … 56 59 57 60 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 58 pod2usage( -msg => "Required options: --file_id --source --product --fileset --file -- workdir",61 pod2usage( -msg => "Required options: --file_id --source --product --fileset --file --component --workdir --bytes --md5sum --dirinfo", 59 62 -exitval => $PS_EXIT_CONFIG_ERROR) unless 60 63 defined $file_id and … … 66 69 defined $bytes and 67 70 defined $md5sum and 71 defined $dirinfo_uri and 68 72 defined $workdir; 69 73 70 74 $tempdir .= "/$file_id"; 75 76 &my_die( "dirinfo is NULL for $component", $file_id, $PS_EXIT_CONFIG_ERROR ) 77 if (($dirinfo_uri eq "NULL") and ($component ne "dirinfo")); 71 78 72 79 my $ipprc = PS::IPP::Config->new() or 73 80 &my_die( "Unable to set up", $file_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 81 82 my $mdcParser = PS::IPP::Metadata::Config->new; 83 84 74 85 75 86 # Retrieve file … … 87 98 my $mjd_copy = DateTime->now->mjd; # MJD of finishing copy 88 99 100 # figure out which dirinfo file to read 101 my $dirinfo_file_to_read = $component eq "dirinfo" ? $filename : $dirinfo_uri; 102 103 # process it 104 my ($destdir, $components, $dirinfo_lines) = read_dirinfo_file($dirinfo_file_to_read, $file_id); 105 106 # select a directory for the dirinfo and dbinfo files 107 # XXX: perhaps this directory should be set by the script and passed in 108 # rather than computed here. 109 110 my ($day, $month, $year) = (localtime)[3,4,5]; 111 my $datestr = sprintf "%04d%02d%02d", $year+1900, $month + 1, $day; 112 my $dir_for_info_files = caturi($workdir, $datestr, $fileset); 113 89 114 # Deal with file 90 if ($file =~ m|^dbinfo\.\S+\.mdc$|) { 91 # Load into database 92 93 my $target = "$workdir/$file"; # Target destination for file 94 my $fixName = $ipprc->file_create( $target ); # Target for move 95 my $fixFile; 96 97 open $fixFile, ">$fixName" or &my_die( "can't open $fixName\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 98 99 # Need to fix paths to point to new workdir 100 open my $inFile, $filename or &my_die( "Can't open $filename\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); # Input file 101 my $workdir_old; # Old workdir 102 while (<$inFile>) { 103 # XXX This is a global approach to fixing the path: it should fix anything and everything, but won't 104 # work if there are multiple workdirs in a file and the bits are all mixed up. To cover that case, 105 # we should fix each of the elements (workdir, uri, path_base) separately. 106 if (m|^\s*workdir\s+STR\s+(\S+)|) { 107 $workdir_old = $1; 108 $workdir_old =~ s|\@HOST\@|\\S+|; 109 } 110 if (defined $workdir_old) { 111 s|$workdir_old|$workdir|; 112 } 113 print $fixFile $_; 114 } 115 close($inFile); 116 close($fixFile); 117 #{ 118 my $command = "$receivetool -updatefileset -fileset_id $fileset_id -dbinfo_uri $fixName"; # Command to execute 115 if ($component eq 'dirinfo') { 116 # save the dirinfo file contents into the $workdir 117 118 $dirinfo_uri = caturi($dir_for_info_files, basename($filename)); 119 print "dirinfo_uri: $dirinfo_uri\n" if $verbose; 120 121 my $resolved = $ipprc->file_resolve($dirinfo_uri, 'create'); 122 &my_die( "failed to resolve $dirinfo_uri\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) if !$resolved; 123 124 open OUT, ">$resolved" 125 or &my_die( "failed to open $resolved\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 126 print OUT @$dirinfo_lines 127 or &my_die( "failed to write $resolved\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 128 close OUT 129 or &my_die( "failed to close $resolved\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 130 131 # update the fileset to allow processing of other files 132 my $command = "$receivetool -updatefileset -fileset_id $fileset_id"; 133 $command .= " -set_state new -dirinfo $dirinfo_uri"; 119 134 $command .= " -dbname $dbname" if defined $dbname; 135 120 136 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 121 137 run(command => $command, verbose => $verbose); 122 &my_die( "Unable to set dbinfo_uri for $fileset_id to $fixName\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) unless $success; 123 #} 124 125 } elsif ($file =~ m|.*\.tgz$|) { 138 &my_die( "Unable to update fileset $fileset_id to\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) unless $success; 139 140 } elsif ($component eq "dbinfo") { 141 142 open INFILE, $filename or &my_die( "Can't open $filename\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 143 144 my @lines = (<INFILE>); 145 146 my $dbinfo = join "", @lines; 147 148 close INFILE; 149 150 my $dbinfo_uri = caturi($dir_for_info_files, basename($filename)); 151 print "dbinfo_uri: $dbinfo_uri\n" if $verbose; 152 153 my $resolved = $ipprc->file_resolve($dbinfo_uri, 'create'); 154 &my_die( "failed to resolve $dbinfo_uri\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) if !$resolved; 155 156 open OUT, ">$resolved" 157 or &my_die( "failed to open $resolved\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 158 159 # We process the dbinfo file (the exported run from the distribution) line by line 160 # Rather than read it as an mdc and interptet it, we do our substitutions directly 161 # This is much faster. Parsing a mdc file for a chip run takes several seconds. 162 # we are very strict on the formatting 163 164 # first line tells us the run type. From this we get the stage 165 # 166 my $line = $lines[0]; 167 my ($runType, $multi) = split " ", $line; 168 &my_die( "unexpected first line found in $filename: $line\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) 169 if !$runType or ($multi ne 'MULTI'); 170 my $stage; 171 my $comp_name; 172 my $current_component; 173 if ($runType eq 'rawExp') { 174 $stage = 'raw'; 175 $comp_name = 'class_id'; 176 } elsif ($runType eq 'chipRun') { 177 $stage = 'chip'; 178 $comp_name = 'class_id'; 179 } elsif ($runType eq 'camRun') { 180 $stage = 'camera'; 181 $comp_name = 'exposure'; 182 $current_component = $comp_name; 183 } elsif ($runType eq 'fakeRun') { 184 $stage = 'fake'; 185 $comp_name = 'class_id'; 186 } elsif ($runType eq 'warpRun') { 187 $stage = 'warp'; 188 $comp_name = 'skycell_id'; 189 } elsif ($runType eq 'diffRun') { 190 $stage = 'diff'; 191 $comp_name = 'skycell_id'; 192 } elsif ($runType eq 'stackRun') { 193 $stage = 'stack'; 194 $comp_name = 'skycell_id'; 195 } else { 196 &my_die( "unexpected run type line found in $filename: $runType\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 197 } 198 199 my $new_workdir_value; 200 if ($destdir eq 'none') { 201 $new_workdir_value = "$workdir"; 202 } else { 203 $new_workdir_value = "$workdir/$destdir"; 204 } 205 my $component_dir; 206 if ($current_component) { 207 $component_dir = $components->{$current_component}; 208 } 209 foreach $line (@lines) { 210 my $out_line = $line; 211 212 my ($name, $type, $value) = split " ", $line; 213 # we only edit complete lines 214 if ($name and $type and $value) { 215 my $new_value; 216 if ($name eq $comp_name) { 217 $current_component = $value; 218 $component_dir = $components->{$current_component}; 219 &my_die( "$component_dir is null for $value in $filename: $runType\n", 220 $file_id, $PS_EXIT_UNKNOWN_ERROR) if !$component_dir; 221 } elsif ($name eq 'workdir') { 222 $new_value = $new_workdir_value; 223 } elsif ($name eq 'tess_id') { 224 # for tess_id strip off any directories just keep the basename. 225 # The site configuration will need to map this to a proper location 226 # XXX: Document this 227 $new_value = basename($value); 228 } elsif ((($name eq 'uri') or ($name eq 'path_base')) and ($value ne 'NULL')) { 229 &my_die( "$component_dir is null and we need it for $name", 230 $file_id, $PS_EXIT_PROG_ERROR) if !$component_dir; 231 232 $new_value = caturi($new_workdir_value, $component_dir, basename($value)); 233 } 234 235 if ($new_value) { 236 $out_line = " " . $name . "\t\t" . $type . "\t" . $new_value . "\n"; 237 } 238 } 239 240 print OUT $out_line or &my_die( "failed to write to $resolved\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 241 } 242 243 close OUT 244 or &my_die( "failed to close $resolved\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 245 246 # update the fileset to allow processing of other files 247 my $command = "$receivetool -updatefileset -fileset_id $fileset_id"; 248 $command .= " -dbinfo $dbinfo_uri"; 249 $command .= " -dbname $dbname" if defined $dbname; 250 251 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 252 run(command => $command, verbose => $verbose); 253 &my_die( "Unable to update fileset $fileset_id to\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) unless $success; 254 255 256 } elsif ($file =~ m|.*\.tgz$|) { # XXX: perhaps get this off of file type ? 126 257 # Get contents of tarball 127 258 my @files = (); … … 151 282 } 152 283 284 my $component_dir = $components->{$component}; 285 &my_die( "Unable to find component_dir for $component $filename\n", $file_id, $PS_EXIT_UNKNOWN_ERROR) unless $component_dir; 286 287 my $target_dir; 288 if ($destdir eq 'none') { 289 $target_dir = "$workdir"; 290 } else { 291 $target_dir = "$workdir/$destdir"; 292 } 293 $target_dir .= "/$component_dir"; 294 153 295 # Move files into filesystem of choice 154 296 foreach my $file ( @files ) { 155 297 my $from = "$tempdir/$file"; # Source for file 156 my $target = "$ workdir/$file"; # Target destination for file298 my $target = "$target_dir/$file"; # Target destination for file 157 299 my $to = $ipprc->file_create( $target ); # Target for move 158 300 system("mv $from $to") == 0 or &my_die( "Unable to move $file into workdir $workdir: $!\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); … … 162 304 } 163 305 164 unlink $filename or &my_die( "Unable to unlink $filename\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 306 if (!$save_temps) { 307 unlink $filename or &my_die( "Unable to unlink $filename\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 308 } 165 309 my $mjd_extract = DateTime->now->mjd; # MJD of finishing extract 166 310 … … 186 330 # Pau. 187 331 332 sub read_dirinfo_file 333 { 334 my $filename = shift; 335 my $file_id = shift; 336 337 open INFILE, $filename or &my_die( "Can't open $filename\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); 338 339 my @lines = (<INFILE>); 340 341 my $dirinfo = join "", @lines; 342 343 close INFILE; 344 345 my $metadata = $mdcParser->parse($dirinfo) or 346 &my_die("Unable to parse metadata config doc", $file_id, $PS_EXIT_UNKNOWN_ERROR); 347 348 my $array = parse_md_list($metadata) or 349 &my_die("Unable to parse metadata list", $file_id, $PS_EXIT_UNKNOWN_ERROR); 350 351 my $dest_hash = $array->[0]; 352 353 my $destdir = $dest_hash->{destdir}; 354 &my_die("destdir not found in $filename", $file_id, $PS_EXIT_UNKNOWN_ERROR) if !$destdir; 355 356 my $components = $array->[1]; 357 358 return ($destdir, $components, \@lines); 359 } 188 360 189 361 sub my_die -
trunk/ippScripts/scripts/receive_fileset.pl
r24103 r24125 92 92 my $new_state; 93 93 if ($numFiles > 0) { 94 $new_state = " new";94 $new_state = "listed"; 95 95 my $command = "receivetool -addfile"; # Command to execute 96 96 $command .= " -fileset_id $fileset_id"; -
trunk/ippTasks/dist.pro
r24098 r24125 266 266 book getword distToAdvance $pageName outdir -var OUTDIR 267 267 book getword distToAdvance $pageName clean -var CLEAN 268 book getword distToAdvance $pageName dbname -var DBNAME 268 269 $EXTRA_ARGS = "" 269 270 if ("$CLEAN" == "T") -
trunk/ippTasks/receive.pro
r24109 r24125 405 405 book getword receiveFile $pageName component -var COMPONENT 406 406 book getword receiveFile $pageName workdir -var WORKDIR 407 book getword receiveFile $pageName dirinfo -var DIRINFO 407 408 book getword receiveFile $pageName dbname -var DBNAME 408 409 book getword receiveFile $pageName state -var RUN_STATE … … 411 412 stderr $LOGDIR/receive.file.log 412 413 413 $run = receive_file.pl --file_id $FILE_ID --source $SOURCE --product $PRODUCT --fileset $FILESET --fileset_id $FILESET_ID --file $FILE --component $COMPONENT --bytes $BYTES --md5 $MD5SUM --workdir $WORKDIR 414 $run = receive_file.pl --file_id $FILE_ID --source $SOURCE --product $PRODUCT --fileset $FILESET --fileset_id $FILESET_ID --file $FILE --component $COMPONENT --bytes $BYTES --md5 $MD5SUM --workdir $WORKDIR --dirinfo $DIRINFO 414 415 add_standard_args run 415 416 … … 512 513 book getword receiveAdvance $pageName fileset_id -var FILESET_ID 513 514 book getword receiveAdvance $pageName fileset -var FILESET 514 book getword receiveAdvance $pageName dbinfo _uri -var DBINFO_URI515 book getword receiveAdvance $pageName dbinfo -var DBINFO 515 516 book getword receiveAdvance $pageName status_product -var STATUS_PRODUCT 516 517 book getword receiveAdvance $pageName ds_dbname -var DS_DBNAME … … 521 522 stderr $LOGDIR/receive.advance.log 522 523 523 $run = receive_advance.pl --fileset_id $FILESET_ID --fileset $FILESET --dbinfo _uri $DBINFO_URI--status_product $STATUS_PRODUCT --ds_dbname $DS_DBNAME --ds_dbhost $DS_DBHOST524 $run = receive_advance.pl --fileset_id $FILESET_ID --fileset $FILESET --dbinfo $DBINFO --status_product $STATUS_PRODUCT --ds_dbname $DS_DBNAME --ds_dbhost $DS_DBHOST 524 525 add_standard_args run 525 526 -
trunk/ippTools/share/pxadmin_create_tables.sql
r24105 r24125 1330 1330 fileset VARCHAR(128) NOT NULL, -- fileset to receive 1331 1331 state VARCHAR(64), -- new or full 1332 dbinfo_uri VARCHAR(255), -- uri for database dump for this fileset's run 1332 dirinfo VARCHAR(255), -- uri for directory info file for this run 1333 dbinfo VARCHAR(255), -- uri for database dump file for this run 1333 1334 fault SMALLINT NOT NULL DEFAULT 0, -- Fault code 1334 1335 PRIMARY KEY(fileset_id), -
trunk/ippTools/share/receivetool_pendingfile.sql
r24112 r24125 4 4 product, 5 5 workdir, 6 d estdir,6 dirinfo, 7 7 fileset, 8 8 fileset_id, … … 18 18 ON receiveResult.file_id = receiveFile.file_id 19 19 WHERE 20 ((receiveFileset.state = 'new') OR (receiveFileset.state = 'listed' AND receiveFile.component = 'd binfo'))20 ((receiveFileset.state = 'new') OR (receiveFileset.state = 'listed' AND receiveFile.component = 'dirinfo')) 21 21 AND receiveFileset.fault = 0 22 22 AND receiveResult.file_id IS NULL -
trunk/ippTools/share/receivetool_revert.sql
r23885 r24125 4 4 AND receiveFile.fileset_id = receiveFileset.fileset_id 5 5 AND receiveFileset.source_id = receiveSource.source_id 6 AND fault != 06 AND receiveResult.fault != 0 -
trunk/ippTools/share/receivetool_toadvance.sql
r24106 r24125 2 2 receiveFileset.fileset_id, 3 3 receiveFileset.fileset, 4 receiveFileset.dbinfo _uri,4 receiveFileset.dbinfo, 5 5 receiveSource.status_product, 6 6 receiveSource.ds_dbname, -
trunk/ippTools/src/disttool.c
r24001 r24125 488 488 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 489 489 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 490 PXOPT_COPY_S16(config->args, where, "-fault", " distComponent.fault", "==");490 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 491 491 492 492 // It might be useful to be able to query by the parameters of the underlying runs -
trunk/ippTools/src/receivetool.c
r24109 r24125 238 238 psFree(output); 239 239 240 if (!receiveFilesetInsert(config->dbh, 0, source_id, fileset, "reg", NULL, 0)) {240 if (!receiveFilesetInsert(config->dbh, 0, source_id, fileset, "reg", NULL, NULL, 0)) { 241 241 psError(PS_ERR_UNKNOWN, false, "Unable to add fileset"); 242 242 psFree(source_id_str); … … 512 512 if (psListLength(where->list)) { 513 513 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 514 psStringAppend(&query, " WHERE%s", whereClause);514 psStringAppend(&query, " AND %s", whereClause); 515 515 psFree(whereClause); 516 516 } … … 592 592 // to chanage 593 593 PXOPT_LOOKUP_S32(fault, config->args, "-fault", false, false); 594 PXOPT_LOOKUP_STR(dbinfo_uri, config->args, "-dbinfo_uri", false, false); 594 PXOPT_LOOKUP_STR(destdir, config->args, "-destdir", false, false); 595 PXOPT_LOOKUP_STR(dirinfo, config->args, "-dirinfo", false, false); 596 PXOPT_LOOKUP_STR(dbinfo, config->args, "-dbinfo", false, false); 595 597 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 596 598 597 if (!fault && !d binfo_uri&& !state) {598 psError(PS_ERR_UNKNOWN, true, " one of -fault, -dbinfo_uri, -set_state are required");599 if (!fault && !dirinfo &&!dbinfo && !state) { 600 psError(PS_ERR_UNKNOWN, true, "at least one of -fault, -dirinfo, -dbinfo, -set_state are required"); 599 601 return false; 600 602 } … … 608 610 sep = ","; 609 611 } 610 if (dbinfo_uri) { 611 psStringAppend(&query, "%s dbinfo_uri = '%s'", sep, dbinfo_uri); 612 if (dirinfo) { 613 psStringAppend(&query, "%s dirinfo = '%s'", sep, dirinfo); 614 sep = ","; 615 } 616 if (dbinfo) { 617 psStringAppend(&query, "%s dbinfo = '%s'", sep, dbinfo); 612 618 sep = ","; 613 619 } -
trunk/ippTools/src/receivetoolConfig.c
r24109 r24125 85 85 psMetadataAddS64(updatefilesetArgs, PS_LIST_TAIL, "-fileset_id", 0, "define fileset_id (required)", 0); 86 86 psMetadataAddStr(updatefilesetArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL); 87 psMetadataAddStr(updatefilesetArgs, PS_LIST_TAIL, "-dbinfo_uri", 0, "define dbinfo_uri", NULL); 87 psMetadataAddStr(updatefilesetArgs, PS_LIST_TAIL, "-destdir", 0, "define destdir", NULL); 88 psMetadataAddStr(updatefilesetArgs, PS_LIST_TAIL, "-dirinfo", 0, "define dirinfo", NULL); 89 psMetadataAddStr(updatefilesetArgs, PS_LIST_TAIL, "-dbinfo", 0, "define dbinfo", NULL); 88 90 psMetadataAddS32(updatefilesetArgs, PS_LIST_TAIL, "-fault", 0, "define fault code", 0); 89 91 … … 107 109 psMetadata *addresultArgs = psMetadataAlloc(); 108 110 psMetadataAddS64(addresultArgs, PS_LIST_TAIL, "-file_id", 0, "define receive_id (required)", 0); 111 psMetadataAddStr(addresultArgs, PS_LIST_TAIL, "-path_base", 0, "path_base for component", NULL); 109 112 psMetadataAddF32(addresultArgs, PS_LIST_TAIL, "-dtime_copy", 0, "define time to copy", NAN); 110 113 psMetadataAddF32(addresultArgs, PS_LIST_TAIL, "-dtime_extract", 0, "define time to extract", NAN);
Note:
See TracChangeset
for help on using the changeset viewer.
