Changeset 24565
- Timestamp:
- Jun 25, 2009, 3:08:22 PM (17 years ago)
- Location:
- branches/eam_branches/20090522
- Files:
-
- 21 edited
-
. (modified) (1 prop)
-
Nebulous-Server (modified) (1 prop)
-
Nebulous-Server/Changes (modified) (1 diff)
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (2 diffs)
-
Nebulous-Server/lib/Nebulous/Server/SQL.pm (modified) (1 diff)
-
Nebulous-Server/t/13_server_find_objects.t (modified) (6 diffs)
-
Nebulous/bin (modified) (1 prop)
-
Nebulous/t/70_neb-ls.t (modified) (5 diffs)
-
ippTools/share/chiptool_export_imfile.sql (modified) (1 prop)
-
ippTools/share/chiptool_export_processed_imfile.sql (modified) (1 prop)
-
ippTools/share/warptool_revertoverlap.sql (modified) (1 prop)
-
ippTools/src/camtool.c (modified) (1 diff)
-
ippTools/src/camtoolConfig.c (modified) (1 diff)
-
ippTools/src/chiptool.c (modified) (1 diff)
-
ippTools/src/chiptoolConfig.c (modified) (1 diff)
-
ippTools/src/faketool.c (modified) (1 diff)
-
ippTools/src/faketoolConfig.c (modified) (1 diff)
-
ippTools/src/warptool.c (modified) (2 diffs)
-
ippTools/src/warptoolConfig.c (modified) (2 diffs)
-
ppImage/src/ppImageReplaceBackground.c (modified) (1 diff)
-
psLib/src/mathtypes/psVector.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090522
- Property svn:mergeinfo changed
/trunk merged: 24558,24560-24564
- Property svn:mergeinfo changed
-
branches/eam_branches/20090522/Nebulous-Server
- Property svn:mergeinfo changed
/trunk/Nebulous-Server merged: 24558,24561
- Property svn:mergeinfo changed
-
branches/eam_branches/20090522/Nebulous-Server/Changes
r24557 r24565 29 29 - infinitely try to get a db handle if the connection fails 30 30 - add --mountpoint param to neb-voladd 31 - change Nebulous::Server->find_objects() to return dirs and to sort it's 32 output 31 33 32 34 0.16 -
branches/eam_branches/20090522/Nebulous-Server/lib/Nebulous/Server.pm
r24557 r24565 1449 1449 } 1450 1450 1451 eval { 1452 $log->debug("trying for a directory match under dir: $dir_id"); 1451 # find dirs under dir 1452 my @dir_keys; 1453 eval { 1454 $log->debug("looking for directories under dir: $dir_id"); 1455 my $query = $db->prepare_cached( $sql->find_dir_by_parent_id); 1456 $query->execute( $dir_id ); 1457 1458 while ( my $row = $query->fetchrow_hashref ) { 1459 next if $row->{'dir_id'} == 1; 1460 my $dir = $row->{'dirname'}; 1461 if ($dir_id == 1) { 1462 push @dir_keys, $dir . '/' if $dir; 1463 } else { 1464 push @dir_keys, $key->path . '/' . $dir . '/' if $dir; 1465 } 1466 $log->debug( "matched $dir" ) if $dir; 1467 } 1468 }; 1469 $log->logdie("database error: $@") if $@; 1470 1471 # find files under dir 1472 eval { 1473 $log->debug("looking for objects under dir: $dir_id"); 1453 1474 my $query = $db->prepare_cached( $sql->find_object_by_dir_id ); 1454 1475 $query->execute( $dir_id ); … … 1463 1484 1464 1485 $log->debug( "leaving" ); 1465 1466 return \@keys;1486 1487 return [sort(@dir_keys), sort(@keys)]; 1467 1488 } 1468 1489 -
branches/eam_branches/20090522/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r24557 r24565 317 317 FROM storage_object 318 318 WHERE dir_id = ? 319 }, 320 find_dir_by_parent_id => qq{ 321 SELECT dir_id, dirname 322 FROM directory 323 WHERE parent_id = ? 319 324 }, 320 325 rename_object => qq{ -
branches/eam_branches/20090522/Nebulous-Server/t/13_server_find_objects.t
r24557 r24565 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 28;10 use Test::More tests => 36; 11 11 12 12 use lib qw( ./t ./lib ); … … 100 100 my $keys = $neb->find_objects("a"); 101 101 102 is(scalar @$keys, 1, 'number of keys found'); 103 is($keys->[0], "a/foo", "key name"); 102 is(scalar @$keys, 2, 'number of keys found'); 103 is($keys->[0], "a/b/", "key name"); 104 is($keys->[1], "a/foo", "key name"); 104 105 } 105 106 … … 113 114 114 115 is(scalar @$keys, 2, 'number of keys found'); 115 is($keys->[0], "a/ foo", "key name");116 is($keys->[1], "a/ bar", "key name");116 is($keys->[0], "a/bar", "key name"); 117 is($keys->[1], "a/foo", "key name"); 117 118 } 118 119 … … 138 139 my $keys = $neb->find_objects("/"); 139 140 140 is(scalar @$keys, 2, 'number of keys found');141 is($keys->[0], " foo", "key name");141 is(scalar @$keys, 3, 'number of keys found'); 142 is($keys->[0], "a/", "key name"); 142 143 is($keys->[1], "bar", "key name"); 144 is($keys->[2], "foo", "key name"); 143 145 } 144 146 … … 152 154 my $keys = $neb->find_objects("."); 153 155 154 is(scalar @$keys, 2, 'number of keys found');155 is($keys->[0], " foo", "key name");156 is(scalar @$keys, 3, 'number of keys found'); 157 is($keys->[0], "a/", "key name"); 156 158 is($keys->[1], "bar", "key name"); 159 is($keys->[2], "foo", "key name"); 157 160 } 158 161 … … 166 169 my $keys = $neb->find_objects(".."); 167 170 168 is(scalar @$keys, 2, 'number of keys found');169 is($keys->[0], " foo", "key name");171 is(scalar @$keys, 3, 'number of keys found'); 172 is($keys->[0], "a/", "key name"); 170 173 is($keys->[1], "bar", "key name"); 174 is($keys->[2], "foo", "key name"); 175 } 176 177 Test::Nebulous->setup; 178 179 { 180 $neb->create_object("a/bar"); 181 $neb->create_object("b/foo"); 182 $neb->create_object("foo"); 183 184 my $keys = $neb->find_objects("/"); 185 186 is(scalar @$keys, 3, 'number of keys found'); 187 is($keys->[0], "a/", "key name"); 188 is($keys->[1], "b/", "key name"); 189 is($keys->[2], "foo", "key name"); 171 190 } 172 191 -
branches/eam_branches/20090522/Nebulous/bin
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/Nebulous/t/70_neb-ls.t
r24557 r24565 83 83 84 84 is($? >> 8, 0, "exit code"); 85 like($test->stdout, qr/^ foo\nbar$/, "stdout");85 like($test->stdout, qr/^bar\nfoo$/, "stdout"); 86 86 like($test->stderr, qr/^$/, "stderr"); 87 87 } … … 99 99 100 100 is($? >> 8, 0, "exit code"); 101 like($test->stdout, qr/^ foo\nbar\n$/, "stdout");101 like($test->stdout, qr/^bar\nfoo\n$/, "stdout"); 102 102 like($test->stderr, qr/^$/, "stderr"); 103 103 } … … 115 115 116 116 is($? >> 8, 0, "exit code"); 117 like($test->stdout, qr/^ foo\nbar\n$/, "stdout");117 like($test->stdout, qr/^bar\nfoo\n$/, "stdout"); 118 118 like($test->stderr, qr/^$/, "stderr"); 119 119 } … … 161 161 162 162 is($? >> 8, 0, "exit code"); 163 like($test->stdout, qr|^a/ foo\na/bar$|, "stdout");163 like($test->stdout, qr|^a/bar\na/foo$|, "stdout"); 164 164 like($test->stderr, qr/^$/, "stderr"); 165 165 } … … 193 193 194 194 is($? >> 8, 0, "exit code"); 195 like($test->stdout, qr|^a/ foo$|, "stdout");195 like($test->stdout, qr|^a/b/\na/foo$|, "stdout"); 196 196 like($test->stderr, qr/^$/, "stderr"); 197 197 } -
branches/eam_branches/20090522/ippTools/share/chiptool_export_imfile.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/ippTools/share/chiptool_export_processed_imfile.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/ippTools/share/warptool_revertoverlap.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/ippTools/src/camtool.c
r24182 r24565 766 766 pxcamGetSearchArgs (config, where); 767 767 PXOPT_COPY_S64(config->args, where, "-cam_id", "camRun.cam_id", "=="); 768 PXOPT_COPY_STR(config->args, where, "-label", "camRun.label","==");768 pxAddLabelSearchArgs (config, where, "-label", "camRun.label", "=="); 769 769 PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "=="); 770 770 PXOPT_COPY_S16(config->args, where, "-fault", "camProcessedExp.fault", "=="); -
branches/eam_branches/20090522/ippTools/src/camtoolConfig.c
r23920 r24565 187 187 pxcamSetSearchArgs(revertprocessedexpArgs); 188 188 psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0, "search by cam_id", 0); 189 psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-label", 0,"search by camRun label", NULL);189 psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by camRun label", NULL); 190 190 psMetadataAddStr(revertprocessedexpArgs, PS_LIST_TAIL, "-reduction",0, "search by camRun reduction class", NULL); 191 191 psMetadataAddS16(revertprocessedexpArgs, PS_LIST_TAIL, "-code", 0, "search by fault code", 0); -
branches/eam_branches/20090522/ippTools/src/chiptool.c
r24557 r24565 676 676 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 677 677 PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "=="); 678 // require a single label 679 PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "=="); 678 pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "=="); 680 679 PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "=="); 681 680 PXOPT_COPY_S16(config->args, where, "-fault", "chipProcessedImfile.fault", "=="); -
branches/eam_branches/20090522/ippTools/src/chiptoolConfig.c
r23919 r24565 169 169 psMetadataAddStr(revertprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 170 170 psMetadataAddStr(revertprocessedimfileArgs, PS_LIST_TAIL, "-reduction", 0, "search by reduction class", NULL); 171 psMetadataAddStr(revertprocessedimfileArgs, PS_LIST_TAIL, "-label", 0, "search by chipRun label (LIKE comparison)", NULL);171 psMetadataAddStr(revertprocessedimfileArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by chipRun label (LIKE comparison)", NULL); 172 172 pxchipSetSearchArgs(revertprocessedimfileArgs); 173 173 psMetadataAddBool(revertprocessedimfileArgs, PS_LIST_TAIL, "-all", 0, "allow everything to be queued without search terms", false); -
branches/eam_branches/20090522/ippTools/src/faketool.c
r24557 r24565 632 632 633 633 psMetadata *where = psMetadataAlloc(); 634 pxAddLabelSearchArgs (config, where, "-label", "fakeRun.label", "=="); 634 635 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 635 PXOPT_COPY_STR(config->args, where, "-label", "fakeRun.label", "==");636 636 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 637 637 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); -
branches/eam_branches/20090522/ippTools/src/faketoolConfig.c
r23921 r24565 198 198 psMetadata *revertprocessedimfileArgs = psMetadataAlloc(); 199 199 psMetadataAddS64(revertprocessedimfileArgs, PS_LIST_TAIL, "-fake_id", 0, "search by fake ID", 0); 200 psMetadataAddStr(revertprocessedimfileArgs, PS_LIST_TAIL, "-label", 0, "search by label", NULL);200 psMetadataAddStr(revertprocessedimfileArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", NULL); 201 201 psMetadataAddS64(revertprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exp_id", 0); 202 202 psMetadataAddStr(revertprocessedimfileArgs, PS_LIST_TAIL, "-exp_name", 0, "search by exp_name", NULL); -
branches/eam_branches/20090522/ippTools/src/warptool.c
r24557 r24565 680 680 PXOPT_COPY_STR(config->args, where, "-skycell_id", "warpSkyCellMap.skycell_id", "=="); 681 681 PXOPT_COPY_STR(config->args, where, "-tess_id", "warpSkyCellMap.tess_id", "=="); 682 PXOPT_COPY_STR(config->args, where, "-label", "warpRun.label", "=="); 682 // PXOPT_COPY_STR(config->args, where, "-label", "warpRun.label", "=="); 683 pxAddLabelSearchArgs (config, where, "-label", "warpRun.label", "=="); 683 684 PXOPT_COPY_S16(config->args, where, "-fault", "warpSkyCellMap.fault", "=="); 684 685 … … 1269 1270 PXOPT_COPY_STR(config->args, where, "-tess_id", "warpSkyfile.tess_id", "=="); 1270 1271 PXOPT_COPY_STR(config->args, where, "-reduction", "rawExp.reduction", "=="); 1271 PXOPT_COPY_STR(config->args, where, "-label", "warpRun.label", "=="); 1272 // PXOPT_COPY_STR(config->args, where, "-label", "warpRun.label", "=="); 1273 pxAddLabelSearchArgs (config, where, "-label", "warpRun.label", "=="); 1272 1274 PXOPT_COPY_S16(config->args, where, "-fault", "warpSkyfile.fault", "=="); 1273 1275 -
branches/eam_branches/20090522/ippTools/src/warptoolConfig.c
r24557 r24565 164 164 psMetadataAddStr(revertoverlapArgs, PS_LIST_TAIL, "-skycell_id", 0, "search by skycell ID", NULL); 165 165 psMetadataAddStr(revertoverlapArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tessellation ID", NULL); 166 psMetadataAddStr(revertoverlapArgs, PS_LIST_TAIL, "-label", 0,"search by warpRun label", NULL);166 psMetadataAddStr(revertoverlapArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by warpRun label", NULL); 167 167 psMetadataAddS16(revertoverlapArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 168 168 psMetadataAddBool(revertoverlapArgs, PS_LIST_TAIL, "-all", 0, "allow everything to be queued without search terms", false); … … 227 227 psMetadataAddStr(revertwarpedArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tessellation ID", NULL); 228 228 psMetadataAddStr(revertwarpedArgs, PS_LIST_TAIL, "-reduction", 0, "search by warpRun reduction class", NULL); 229 psMetadataAddStr(revertwarpedArgs, PS_LIST_TAIL, "-label", 0,"search by warpRun label", NULL);229 psMetadataAddStr(revertwarpedArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by warpRun label", NULL); 230 230 psMetadataAddS16(revertwarpedArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 231 231 psMetadataAddBool(revertwarpedArgs, PS_LIST_TAIL, "-all", 0, "allow everything to be queued without search terms", false); -
branches/eam_branches/20090522/ppImage/src/ppImageReplaceBackground.c
r23825 r24565 144 144 for (int y = 0; y < numRows; y++) { 145 145 for (int x = 0; x < numCols; x++) { 146 float value = backData[y][x]; 147 if (!isfinite(value)) { 148 image->data.F32[y][x] = NAN; 149 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->lowMask; 146 if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal) { 147 image->data.F32[y][x] = 0.0; 150 148 } else { 151 image->data.F32[y][x] -= value; 152 } 149 float value = backData[y][x]; 150 if (!isfinite(value)) { 151 image->data.F32[y][x] = NAN; 152 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->lowMask; 153 } else { 154 image->data.F32[y][x] -= value; 155 } 156 } 153 157 } 154 158 } -
branches/eam_branches/20090522/psLib/src/mathtypes/psVector.c
r21183 r24565 77 77 // Create vector data array 78 78 vector->data.U8 = psAlloc(nalloc * elementSize); 79 memset (vector->data.U8, 0, nalloc * elementSize); 79 80 80 81 return vector; … … 119 120 _("psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown.")); 120 121 return NULL; 121 } else if (vector->nalloc != nalloc) { // No need to realloc to same size 122 elemType = vector->type.type; 123 elementSize = PSELEMTYPE_SIZEOF(elemType); 124 if (nalloc < vector->n) { 125 vector->n = nalloc; 126 } 127 // Realloc after decrementation to avoid accessing freed array elements 128 vector->data.U8 = psRealloc(vector->data.U8, nalloc * elementSize); 129 P_PSVECTOR_SET_NALLOC(vector,nalloc); 122 } 123 124 125 if (vector->nalloc == nalloc) { 126 // No need to realloc to same size 127 return vector; 128 } 129 130 elemType = vector->type.type; 131 elementSize = PSELEMTYPE_SIZEOF(elemType); 132 133 long nstart = vector->n; 134 if (nalloc < vector->n) { 135 vector->n = nalloc; 136 } 137 // Realloc after decrementation to avoid accessing freed array elements 138 vector->data.U8 = psRealloc(vector->data.U8, nalloc * elementSize); 139 P_PSVECTOR_SET_NALLOC(vector,nalloc); 140 141 // fill newly allocated range with zeros: 142 if (nstart < nalloc) { 143 long nNew = nalloc - nstart; 144 memset (&vector->data.U8[nstart*elementSize], 0, nNew*elementSize); 130 145 } 131 146 … … 165 180 vector->type.type = type; 166 181 vector->n = nalloc; 182 183 // zero the vector 184 memset (vector->data.U8, 0, byteSize); 185 167 186 return vector; 168 187 }
Note:
See TracChangeset
for help on using the changeset viewer.
