chiark / gitweb /
new --test-servers option
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Mon, 22 Jun 2009 23:10:29 +0000 (00:10 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Mon, 22 Jun 2009 23:10:29 +0000 (00:10 +0100)
pctb/README
pctb/convert.c
pctb/convert.h

index 888d53320433df63270b9516cb1964a2361839e3..9bb9867e917eba91c99a0c920459c5538ec62788 100644 (file)
@@ -30,6 +30,8 @@ Options to vary the processing:
   --edit-charset        Enable character set editing.  See README.dictionary.
   --find-island         Find and print the ocean and island.  Suppresses OCR
                          and output unless used with result processing option.
+  --test-servers        Set default servers to be the test servers, not
+                         the real live ones (doesn't affect explicit settings).
 
 Controlling what happens to the results - only one at a time:
   --upload (default) Upload to the PCTB server
index fa9837fa93e7279ce2c762ef4b816499dd486804..433b043a3dadd5a043f7f9087733c21262e12160 100644 (file)
@@ -132,7 +132,8 @@ void fetch_with_rsync(const char *stem) {
 }
 
 static void set_server(const char *envname, const char *defprotocol,
-                      const char *defvalue, const char *userspecified,
+                      const char *defvalue, const char *defvalue_test,
+                      const char *userspecified,
                       int enable) {
   const char *value;
   
@@ -142,6 +143,8 @@ static void set_server(const char *envname, const char *defprotocol,
     value= userspecified;
   else if ((value= getenv(envname)))
     ;
+  else if (o_flags & ff_testservers)
+    value= defvalue_test;
   else
     value= defvalue;
 
@@ -188,6 +191,7 @@ int main(int argc, char **argv) {
     else if (IS("--single-page"))      o_flags |= ff_singlepage;
     else if (IS("--quiet"))            o_quiet= 1;
     else if (IS("--edit-charset"))     o_flags |= ff_editcharset;
+    else if (IS("--test-servers"))     o_flags |= ff_testservers;
     else if (IS("--dict-local-only"))  o_flags &= ~ffs_dict;
     else if (IS("--dict-read-only"))   o_flags &= (~ffs_dict | ff_dict_fetch);
     else if (IS("--dict-anon"))        o_flags &= ~ff_dict_pirate;
@@ -234,15 +238,18 @@ int main(int argc, char **argv) {
   /* Defaults */
   
   set_server("YPPSC_PCTB_PCTB",
-            "http://",           "pctb.ilk.org",
-            o_serv_pctb,         o_flags & (ff_needisland|ff_upload));
+            "http://",          "pctb.ilk.org" /*pctb.crabdance.com*/,
+                                "pctb.ilk.org",
+            o_serv_pctb,        o_flags & (ff_needisland|ff_upload));
             
   set_server("YPPSC_PCTB_DICT_UPDATE",
-            "rsync://",          "rsync.pctb.chiark.greenend.org.uk/pctb",
+            "rsync://",         "rsync.pctb.chiark.greenend.org.uk/pctb",
+                                "rsync.pctb.chiark.greenend.org.uk/pctb/test",
             o_serv_dict_fetch,   o_flags & ff_dict_fetch);
 
   set_server("YPPSC_PCTB_DICT_SUBMIT",
             "http://",           "dictup.pctb.chiark.greenend.org.uk",
+                                 "dictup.pctb.chiark.greenend.org.uk/test",
             o_serv_dict_submit,  o_flags & ff_dict_submit);
 
   if (!o_screenshot_fn)
index 827c6a7cc341992fba84403db013b175d6eaf67e..d38c38efab83362a3ec7cb22e30dcc8539565cfb 100644 (file)
@@ -87,6 +87,7 @@ void progress_spinner(const char *fmt, ...)      FMT(1,2);
 enum flags {
   ff_editcharset=     00001,
   ff_singlepage=      00002,
+  ff_testservers=     00004,
   
   ff_dict_fetch=      00010,
   ff_dict_submit=     00020,