# 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*\#/;
}
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 ($) {
}
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 () {
$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;
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
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?");
}
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 {
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
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;
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;
<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
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
When new versions of the upload client are released, you can:
<pre>
cd .../ypp-sc-tools
-git-pull
+git pull
cd yarrg
make
</pre>