X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fconvert.c;h=8101fb920a40adafad02ab92ed4efd5181c2ae44;hb=579edbc3e615ade4ac65296eeaff383ac19fe9b1;hp=61901a5924854c967d9fc981a63406d6af89f66d;hpb=c2c039f07de178037bfbf12e4ee23c06f546de32;p=ypp-sc-tools.web-live.git diff --git a/pctb/convert.c b/pctb/convert.c index 61901a5..8101fb9 100644 --- a/pctb/convert.c +++ b/pctb/convert.c @@ -92,7 +92,7 @@ static void run_analysis(void) { analyse(tf); if (o_flags & ff_upload) { - if (o_flags & ff_singlepage) + if (npages<=1) fatal("Recognition successful, but refusing to upload partial data\n" " (--single-page specified). Specify an output mode?"); } @@ -124,8 +124,10 @@ void fetch_with_rsync(const char *stem) { const char *src= getenv("YPPSC_PCTB_DICT_UPDATE"); char *remote= masprintf("%s/master-%s.txt", src, stem); char *local= masprintf("#master-%s#.txt", stem); + if (DEBUGP(rsync)) + fprintf(stderr,"executing rsync to fetch %s to %s\n",remote,local); execlp(rsync, "rsync", - DEBUGP(rsync) ? "-vLt" : "-Lt", + DEBUGP(rsync) ? "-zvLt" : "-zLt", "--",remote,local,(char*)0); sysassert(!"exec rsync failed"); } @@ -295,13 +297,15 @@ int main(int argc, char **argv) { progress_log("OK for you to move the mouse now."); } if (o_mode & mf_readscreenshot) { + if ((o_flags & ff_upload) && !(o_flags & ff_testservers)) + badusage("must not reuse screenshots for upload to live PCTB database"); open_screenshot_file("r"); if (o_flags & ff_singlepage) read_one_screenshot(); else read_screenshots(); } if (o_mode & mf_analyse) { if (o_flags & ff_needisland) { - find_islandname(page0_rgbimage); + find_islandname(page_images[0]->rgb); if (o_flags & ff_printisland) printf("%s, %s\n", archipelago, island); sysassert(! setenv("YPPSC_ISLAND",island,1) );