Changeset 31065
- Timestamp:
- Mar 27, 2011, 10:57:10 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/Ohana/src/dvomerge
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/dvoverify.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/Ohana/src/dvomerge
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20110213/Ohana/src/dvomerge/src/dvoverify.c
r30615 r31065 13 13 # define DEBUG 0 14 14 15 int VERBOSE; 15 int VERBOSE = FALSE; 16 int NNotSorted = 0; 16 17 17 18 int main (int argc, char **argv) { … … 26 27 // Catalog catalog; 27 28 28 VERBOSE = FALSE; 29 int CHECKSORTED; 30 29 31 if ((N = get_argument (argc, argv, "-v"))) { 30 32 VERBOSE = TRUE; 33 remove_argument (N, &argc, argv); 34 } 35 if ((N = get_argument (argc, argv, "-verbose"))) { 36 VERBOSE = TRUE; 37 remove_argument (N, &argc, argv); 38 } 39 if ((N = get_argument (argc, argv, "-s"))) { 40 CHECKSORTED = TRUE; 41 remove_argument (N, &argc, argv); 42 } 43 if ((N = get_argument (argc, argv, "-sorted"))) { 44 CHECKSORTED = TRUE; 31 45 remove_argument (N, &argc, argv); 32 46 } … … 50 64 51 65 if (argc != 2) { 52 fprintf (stderr, "USAGE: dvoverify (catdir) [-region Rmin Rmax Dmin Dmax]\n"); 53 fprintf (stderr, " catdir : database of interest\n"); 66 fprintf (stderr, "USAGE: dvoverify (catdir) [-region Rmin Rmax Dmin Dmax] [-v] [-s]\n\n"); 67 fprintf (stderr, " -v : VERBOSE\n"); 68 fprintf (stderr, " -s : checks if sorted, return error if not\n"); 69 fprintf (stderr, " (catdir) : database of interest\n"); 54 70 exit (2); 55 71 } … … 89 105 for (i = 0; i < inlist[0].Nregions; i++) { 90 106 if (!inlist[0].regions[i][0].table) continue; 91 92 107 if (i % 1000 == 0) fprintf (stderr, "."); 93 108 … … 109 124 if (!CheckCatalogIndexes(catdir, inlist[0].filename[i], inlist[0].regions[i])){ 110 125 Nbad ++; 126 } 127 128 // exit immediately if any file are unsorted and we require sorted tables 129 if (CHECKSORTED && NNotSorted) { 130 fprintf (stderr, "ERROR: files are not sorted\n"); 131 exit (1); 111 132 } 112 133 } … … 118 139 119 140 fprintf (stderr, "SUCCESS: no files are bad\n"); 141 if (NNotSorted) { 142 fprintf (stderr, "NOTE: %d files are not sorted\n", NNotSorted); 143 } 120 144 exit (0); 121 145 } … … 267 291 dvo_catalog_unlock (&catalog); 268 292 dvo_catalog_free (&catalog); 293 NNotSorted++; 294 if (VERBOSE) fprintf (stderr, "file is not sorted: %s\n", filename); 269 295 return TRUE; 270 296 }
Note:
See TracChangeset
for help on using the changeset viewer.
