IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30830


Ignore:
Timestamp:
Mar 8, 2011, 5:37:06 PM (15 years ago)
Author:
heather
Message:

added more information for when dvoverify is invoked without arguments. added
-s which checks if sorted, exits with 1 on first unsorted file. you can find
out the name of the first unsorted file with -s -v

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvomerge/src/dvoverify.c

    r30615 r30830  
    1414
    1515int VERBOSE;
     16int CHECKSORTED;
     17int NNotSorted = 0;
    1618
    1719int main (int argc, char **argv) {
     
    3133    remove_argument (N, &argc, argv);
    3234  }
     35  if ((N = get_argument (argc, argv, "-s"))) {
     36    CHECKSORTED = TRUE;
     37    remove_argument (N, &argc, argv);
     38  }
     39
    3340
    3441  // restrict to a portion of the sky
     
    5057
    5158  if (argc != 2) {
    52     fprintf (stderr, "USAGE: dvoverify (catdir) [-region Rmin Rmax Dmin Dmax]\n");
     59    fprintf (stderr, "USAGE: dvoverify (catdir) [-region Rmin Rmax Dmin Dmax] [-v -s]\n\n -v = verbose \n -s = checks if sorted, return error if not\n");
    5360    fprintf (stderr, "  catdir : database of interest\n");
    5461    exit (2);
     
    8996  for (i = 0; i < inlist[0].Nregions; i++) {
    9097    if (!inlist[0].regions[i][0].table) continue;
    91 
     98    if ((NNotSorted > 0) && CHECKSORTED) continue;
    9299    if (i % 1000 == 0) fprintf (stderr, ".");
    93100
     
    115122    fprintf (stderr, "ERROR: %d files are bad\n", Nbad);
    116123    exit (1);
     124  }
     125  if ((NNotSorted > 0) && CHECKSORTED) {
     126    fprintf (stderr, "ERROR: files are not sorted\n");
     127     exit (1);
    117128  }
    118129
     
    267278    dvo_catalog_unlock (&catalog);
    268279    dvo_catalog_free (&catalog);
     280    NNotSorted++;
     281    if (VERBOSE) fprintf (stderr, "file is not sorted: %s\n", filename);
    269282    return TRUE;
    270283  }
Note: See TracChangeset for help on using the changeset viewer.