From: Ian Jackson Date: Thu, 10 Sep 2009 18:50:06 +0000 (+0100) Subject: Merge branch 'stable-3.x' X-Git-Tag: 5.0^2~143 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=commitdiff_plain;h=555b3391b3cd9967a29b219fff242b583137d2b8;hp=4c6a28f4cbed2ed351697f63f30fb4827259f6a9;p=ypp-sc-tools.web-live.git Merge branch 'stable-3.x' --- diff --git a/yarrg/Commods.pm b/yarrg/Commods.pm index 44cc74e..9c82818 100644 --- a/yarrg/Commods.pm +++ b/yarrg/Commods.pm @@ -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; diff --git a/yarrg/README.privacy b/yarrg/README.privacy index 188a657..d9f8b60 100644 --- a/yarrg/README.privacy +++ b/yarrg/README.privacy @@ -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 diff --git a/yarrg/convert.c b/yarrg/convert.c index 555eefe..76a9a7a 100644 --- a/yarrg/convert.c +++ b/yarrg/convert.c @@ -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?"); } diff --git a/yarrg/database-info-fetch b/yarrg/database-info-fetch index 5e05760..90db002 100755 --- a/yarrg/database-info-fetch +++ b/yarrg/database-info-fetch @@ -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 { diff --git a/yarrg/dictionary-manager b/yarrg/dictionary-manager index 623e07d..65fc977 100755 --- a/yarrg/dictionary-manager +++ b/yarrg/dictionary-manager @@ -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 <> [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 diff --git a/yarrg/ocr.c b/yarrg/ocr.c index 92b0903..08bc60c 100644 --- a/yarrg/ocr.c +++ b/yarrg/ocr.c @@ -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; diff --git a/yarrg/structure.c b/yarrg/structure.c index ba7ba0d..a49fe0f 100644 --- a/yarrg/structure.c +++ b/yarrg/structure.c @@ -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; diff --git a/yarrg/web/devel b/yarrg/web/devel index 7e02d4c..063d641 100755 --- a/yarrg/web/devel +++ b/yarrg/web/devel @@ -63,7 +63,7 @@ Note that there is NO WARRANTY !

Source code

-git-clone http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/.git/
+git clone http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/.git/
obtains the source code of the latest version released for use as a client, which you can also find as diff --git a/yarrg/web/intro b/yarrg/web/intro index 5b3af6e..c77f183 100755 --- a/yarrg/web/intro +++ b/yarrg/web/intro @@ -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:
-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:
 
 cd .../ypp-sc-tools
-git-pull
+git pull
 cd yarrg
 make