chiark / gitweb /
Merge branch 'stable-3.x'
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Thu, 10 Sep 2009 18:50:06 +0000 (19:50 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Thu, 10 Sep 2009 18:50:06 +0000 (19:50 +0100)
yarrg/Commods.pm
yarrg/README.privacy
yarrg/convert.c
yarrg/database-info-fetch
yarrg/dictionary-manager
yarrg/ocr.c
yarrg/structure.c
yarrg/web/devel
yarrg/web/intro

index 44cc74e8543b91b885ee76082cb3ea0042d5f3fd..9c8281876f334b99578e73622cf95f00e9ec6259 100644 (file)
@@ -74,9 +74,13 @@ my (@rawcm, @nocm); # eg $rawcm[0]='fine rum'; $rawcm[1]='fine %c cloth'
 #  when extending the format of source-info in a non-backward
 #  compatible way, be sure to update update-master-info too.
 
-sub parse_info1 ($$) {
-    my ($mmfn,$src)= @_;
-    my $mm= new IO::File $mmfn, 'r' or die "$mmfn $!";
+sub parse_info1 ($$$) {
+    my ($mmfn,$src,$enoentok)= @_;
+    my $mm= new IO::File $mmfn, 'r';
+    if (!$mm) {
+       return if $enoentok && $!==&ENOENT;
+       die "$mmfn $!";
+    }
     my @ctx= ();
     while (<$mm>) {
        next if m/^\s*\#/;
@@ -176,16 +180,9 @@ sub parse_info1 ($$) {
 }
 
 sub parse_info_clientside () {
-    my $yarrg= $ENV{'YPPSC_YARRG_DICT_UPDATE'};
-    return unless $yarrg;
-    my $master= fetch_with_rsync("info-$masterinfoversion");
-    parse_info1($master,'s');
-    my $local= '_local-info.txt';
-    if (stat $local) {
-       parse_info1($local,'s');
-    } else {
-       die "$local $!" unless $! == &ENOENT;
-    }
+    my $master= fetch_with_rsync("info-v$masterinfoversion");
+    parse_info1($master,'s',1);
+    parse_info1('_local-info.txt','s',1);
 }
 
 sub fetch_with_rsync ($) {
@@ -205,12 +202,12 @@ sub fetch_with_rsync ($) {
 }
 
 sub parse_info_serverside () {
-    parse_info1('source-info.txt','s');
+    parse_info1('source-info.txt','s',0);
 }
 sub parse_info_serverside_ocean ($) {
     my ($oceanname) = @_;
     die "unknown ocean $oceanname ?" unless exists $oceans{$oceanname};
-    parse_info1("_ocean-".(lc $oceanname).".txt",'s');
+    parse_info1("_ocean-".(lc $oceanname).".txt", 's',0);
 }
 
 sub parse_pctb_commodmap () {
@@ -236,7 +233,14 @@ sub get_our_version ($$) {
     $aref->{"${prefix}name"}= 'ypp-sc-tools yarrg';
     $aref->{"${prefix}fixes"}= 'lastpage checkpager';
 
-    my $version= `git-describe --tags HEAD || echo 0unknown`; $? and die $?;
+    my $version= `
+       if type -p git-describe >/dev/null 2>&1; then
+               gd=git-describe
+       else
+               gd="git describe"
+       fi
+       \$gd --tags HEAD || echo 0unknown
+    `; $? and die $?;
     chomp($version);
     $aref->{"${prefix}version"}= $version;
     return $aref;
index 188a657113fb615db2a4910f91266d2298c74e79..d9f8b60d3c93368c6e501561e0eb60486496f189 100644 (file)
@@ -17,12 +17,12 @@ These servers records everyone's uploads of commodity prices and
 allows you to search for routes using the PCTB and YARRG websites.
 (*NB* currently the YARRG website is still under development.)
 
-The YARRG data upload server may also distributes the uploaded data to
+The YARRG data upload server may also distribute the uploaded data to
 other searching site operators for inclusion in their databases; your
 IP address is not passed on to those other operators.
 
 We upload to the PCTB and YARRG servers if you select one of the
---upload options, and not otherwise - but not that this is the
+--upload options, and not otherwise - but note that this is the
 default.
 
 We also query the PCTB server to determine possible island names, if
index 555eefe0274c4300ecbdcab8da5b91c9e6c2c508..76a9a7af96ac18c97d0e941496ff2b495551d182 100644 (file)
@@ -94,7 +94,7 @@ static void run_analysis(void) {
   analyse(tf);
 
   if (o_flags & ff_upload) {
-    if (npages<=1)
+    if (o_flags & ff_singlepage)
       fatal("Recognition successful, but refusing to upload partial data\n"
            " (--single-page specified).  Specify an output mode?");
   }
index 5e0576095a0b23ac7aa837a1d91ff72132f0c3c2..90db002aa4bddd79dd320c61eabaafece677e577 100755 (executable)
@@ -167,8 +167,8 @@ sub main__comparesources () {
 sub main__island () {
     my $ocean= get_ocean();
     
-    parse_info_clientside();
-    get_arches_islands_pctb($ocean);
+    parse_info_clientside() if $ENV{'YPPSC_YARRG_YARRG'};
+    get_arches_islands_pctb($ocean) if $pctb;
 
     for_islands($ocean,
                sub {
index 623e07dc0f5431d3d33b22c075183fb5a615444c..65fc977b505fd9b8c3b3dd343e37e891d853edff 100755 (executable)
@@ -450,14 +450,14 @@ proc required/pixmap {} {
     set col 0; foreach {colname coldesc rows} $alloptions {
        debug "INIT $col $colname \"$coldesc\""
        label .pe.grid.t$col -text $colname
-       listbox .pe.grid.l$col
+       listbox .pe.grid.l$col -height -1
        foreach {rowname rowdesc} $rows {
            debug "INIT $col $colname \"$coldesc\" $rowname \"$rowdesc\""
            .pe.grid.l$col insert end $rowdesc
        }
        bind .pe.grid.l$col <<ListboxSelect>> [list pixmap_select $col]
        grid .pe.grid.t$col -column $col -row 0
-       grid .pe.grid.l$col -column $col -row 1
+       grid .pe.grid.l$col -column $col -row 1 -sticky ns
        incr col
     }
     pixmap_maybe_ok
index 92b09031c5c53ccde0029c0b7a26343db68645c6..08bc60c6b4c1efa3664bdcfd05faaca70faba1c2 100644 (file)
@@ -279,7 +279,8 @@ static int should_reject(OcrReader *rd) {
   int ovector[30];
 
   if (!rejections_loaded) {
-    fetch_with_rsync("reject");
+    if (o_flags & ff_dict_fetch)
+      fetch_with_rsync("reject");
     load_rejections("master");
     load_rejections("local");
     rejections_loaded=1;
index ba7ba0dedc5b9208fa1ec195bde7490e9f19d08a..a49fe0fd7e91782d6d1f68254ac6974e74097e87 100644 (file)
@@ -1052,7 +1052,7 @@ void check_pager_motion(int first, int stop) {
   if (count <= 1) return; /* only one page */
 
   double firstheight= PH(first);
-  double max= count>2 ? firstheight / (count-2) : 0;
+  double max= count>2 ? firstheight / (count-2) : 1e6;
   double min=           firstheight / (count-1);
   max *= 1.1;
   min /= 1.1;
index 7e02d4c38e51cdb6af68a0eed9a1d6f44e685831..063d641cba509f3e6422dd53a02bdb3c339d109e 100755 (executable)
@@ -63,7 +63,7 @@ Note that there is <strong>NO WARRANTY</strong> !
 
 <h3>Source code</h3>
 
-<kbd>git-clone http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/.git/</kbd><br>
+<kbd>git clone http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/.git/</kbd><br>
 obtains the source code of the latest version released for use as a
 client, which you can also find
 <a href="http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/">as
index 5b3af6e22ed2afb856d950496210d98401c0d668..c77f183a7424b5e1a6874488721d0572cc0bc2b2 100755 (executable)
@@ -83,7 +83,7 @@ To install the client, install the `git' version control system
 and the other dependencies listed in the `Installation requirements'
 section of the README and then run:
 <pre>
-git-clone http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/.git ypp-sc-tools
+git clone http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/.git ypp-sc-tools
 cd ypp-sc-tools
 cd yarrg
 make
@@ -96,7 +96,7 @@ and build the software.
 When new versions of the upload client are released, you can:
 <pre>
 cd .../ypp-sc-tools
-git-pull
+git pull
 cd yarrg
 make
 </pre>