&pipethrough_run_along &pipethrough_run_finish
&pipethrough_run_gzip
&cgipostform &yarrgpostform &cgi_get_caller
- &set_ctype_utf8);
+ &set_ctype_utf8 $masterinfoversion);
%EXPORT_TAGS = ( );
@EXPORT_OK = qw();
}
+our $masterinfoversion= 2; # version we understand
+
our %oceans; # eg $oceans{'Midnight'}{'Ruby'}{'Eta Island'}= $sources;
our %clients; # eg $clients{'ypp-sc-tools'}= [ qw(last-page) ];
our %routes; # eg $routes{'Midnight'}{'Orca'}{'Tinga'}= $sources NB abbrevs!
our (%pctb_commodmap,@pctb_commodmap);
my %colours; # eg $colours{'c'}{'black'}= $sources
-my @rawcm; # eg $rawcm[0]='fine rum'; $rawcm[1]='fine %c cloth'
+my (@rawcm, @nocm); # eg $rawcm[0]='fine rum'; $rawcm[1]='fine %c cloth'
# IMPORTANT
# when extending the format of source-info in a non-backward
@ctx= (sub { $colours{$colourkind}{lc $_} .= $src; });
} elsif (m/^commods$/) {
@ctx= (sub { push @rawcm, lc $_; });
+ } elsif (m/^nocommods$/) {
+ @ctx= (sub { push @nocm, lc $_; });
} elsif (m/^ocean (\w+)$/) {
my $ocean= $1;
@ctx= (sub {
my ($name, $props) = $s =~
/^(\S[^\t]*\S)(?:\t+(\S[^\t]*\S))?$/
or die "bad commodspec $s";
+ return if grep { $name eq $_ } @nocm;
my $ucname= ucfirst $name;
$commods{$ucname}{Srcs} .= $ss;
my $c= $commods{$ucname};
sub parse_info_clientside () {
my $yarrg= $ENV{'YPPSC_YARRG_DICT_UPDATE'};
return unless $yarrg;
- my $master= fetch_with_rsync('info');
+ my $master= fetch_with_rsync("info-$masterinfoversion");
parse_info1($master,'s');
my $local= '_local-info.txt';
if (stat $local) {
---------------------------
commodity mass/volume in live database
+ eliminate black dye from live database
O N yppedia distance scraper finish
O N yppedia distances support hints in master-info
O N yppedia also cross-check arch/island pages
- eliminate black dye
-
when update rejected print better error message including
broken commodity name
system('./db-idempotent-populate',$oceanname); die $? if $?;
}
-print STDERR "installing new master-info...\n";
-
my $sfn= 'source-info.txt';
-my $dfn= "$rsyncdir/master-info.txt";
-
-my $sf= new IO::File $sfn or die "$sfn $!";
-my $df= new IO::File "$dfn.tmp", 'w' or die "$dfn.tmp $!";
-my $h;
-while (<$sf>) {
- chomp; s/\s+$//;
- next if m/^\s*\#/ || !m/\S/;
- if (m/^\S.*/) {
- $h= $&;
- }
- die "$_ ?" unless defined $h;
- if ($h =~ m/^commods|^\%[a-z]\b/) {
- s/\t.*//;
+foreach my $v (1..$masterinfoversion) {
+ my $dfnl= sprintf "master-info%s.txt", ($v>1 ? "-v$v" : '');
+ print STDERR "installing new $dfnl...\n";
+
+ my $dfn= "$rsyncdir/$dfnl";
+ my $sf= new IO::File $sfn or die "$sfn $!";
+ my $df= new IO::File "$dfn.tmp", 'w' or die "$dfn.tmp $!";
+
+ my $h;
+ while (<$sf>) {
+ chomp; s/\s+$//;
+ next if m/^\s*\#/ || !m/\S/;
+ if (m/^\S.*/) {
+ $h= $&;
+ }
+ die "$_ ?" unless defined $h;
+ if ($h =~ m/^commods|^\%[a-z]\b/) {
+ s/\t.*//;
+ }
+ if ($v<2) {
+ next if $h =~ m/^nocommods/;
+ }
+ print $df $_, "\n" or die $!;
}
- print $df $_, "\n" or die $!;
-}
-$sf->error and die $!;
-close $df or die $!;
-rename "$dfn.tmp", "$dfn" or die $!;
+ $sf->error and die $!;
+ close $df or die $!;
+ rename "$dfn.tmp", "$dfn" or die $!;
+}