From f138d0a6e34b3b162258686b18620b00672753e3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 17 Oct 2017 13:28:01 +0100 Subject: [PATCH 01/11] Obsidian: Add islands where chart scraper is confused --- yarrg/source-info.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yarrg/source-info.txt b/yarrg/source-info.txt index eb3e7d2..331a7ed 100644 --- a/yarrg/source-info.txt +++ b/yarrg/source-info.txt @@ -259,3 +259,8 @@ ocean Ice Winking Wall Island ocean Obsidian + Ye Bloody Bounding Main + Loggerhead Island + Melanaster Island + Picklepine Ridge + Woodtick Island -- 2.30.2 From 0595ca45694cc1f8c85df22850e121f2d2421582 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 5 Jul 2022 10:50:39 +0100 Subject: [PATCH 02/11] add Obsidian --- yarrg/source-info.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yarrg/source-info.txt b/yarrg/source-info.txt index aa628bc..eb3e7d2 100644 --- a/yarrg/source-info.txt +++ b/yarrg/source-info.txt @@ -257,3 +257,5 @@ ocean Meridian ocean Ice Vilya Winking Wall Island + +ocean Obsidian -- 2.30.2 From 669414f2132269b7bf7d885092165db632c8ba06 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 5 Jul 2022 11:06:13 +0100 Subject: [PATCH 03/11] Cope with modern Perl's default @INC --- yarrg/commod-results-processor | 1 + yarrg/commod-update-receiver | 2 ++ yarrg/database-info-fetch | 2 ++ yarrg/db-idempotent-populate | 2 ++ yarrg/decode-pctb-marketdata | 2 ++ yarrg/dictionary-update-receiver | 2 ++ yarrg/ocean-topology-graph | 2 ++ yarrg/update-master-info | 2 ++ 8 files changed, 15 insertions(+) diff --git a/yarrg/commod-results-processor b/yarrg/commod-results-processor index d427f74..fe05fb8 100755 --- a/yarrg/commod-results-processor +++ b/yarrg/commod-results-processor @@ -24,6 +24,7 @@ # are used without permission. This program is not endorsed or # sponsored by Three Rings. +BEGIN { unshift @INC, qw(.) } use strict (qw(vars)); use HTTP::Request; diff --git a/yarrg/commod-update-receiver b/yarrg/commod-update-receiver index 2059ad7..42cd253 100755 --- a/yarrg/commod-update-receiver +++ b/yarrg/commod-update-receiver @@ -25,6 +25,8 @@ # are used without permission. This program is not endorsed or # sponsored by Three Rings. +BEGIN { unshift @INC, qw(.) } + use strict (qw(vars)); use POSIX; use MIME::Entity; diff --git a/yarrg/database-info-fetch b/yarrg/database-info-fetch index 041e008..655d2ec 100755 --- a/yarrg/database-info-fetch +++ b/yarrg/database-info-fetch @@ -24,6 +24,8 @@ # are used without permission. This program is not endorsed or # sponsored by Three Rings. +BEGIN { unshift @INC, qw(.) } + use strict (qw(vars)); use JSON; #use Data::Dumper; diff --git a/yarrg/db-idempotent-populate b/yarrg/db-idempotent-populate index eb1a30b..2b63f2b 100755 --- a/yarrg/db-idempotent-populate +++ b/yarrg/db-idempotent-populate @@ -29,6 +29,8 @@ # are used without permission. This program is not endorsed or # sponsored by Three Rings. +BEGIN { unshift @INC, qw(.) } + use strict (qw(vars)); use DBI; diff --git a/yarrg/decode-pctb-marketdata b/yarrg/decode-pctb-marketdata index df8203c..d3f4a4e 100755 --- a/yarrg/decode-pctb-marketdata +++ b/yarrg/decode-pctb-marketdata @@ -3,6 +3,8 @@ # This specific file is hereby placed in the public domain, or nearest # equivalent in law, by me, Ian Jackson. 5th July 2009. +BEGIN { unshift @INC, qw(.) } + use IO::File; use strict (qw(vars)); diff --git a/yarrg/dictionary-update-receiver b/yarrg/dictionary-update-receiver index 3baef66..4c90f84 100755 --- a/yarrg/dictionary-update-receiver +++ b/yarrg/dictionary-update-receiver @@ -30,6 +30,8 @@ # YPPSC_YARRG_DICT_UPDATE=./ YPPSC_YARRG_DICT_SUBMIT=./ ./yarrg --ocean midnight --pirate aristarchus --find-island --same --raw-tsv >raw.tsv # ./dictionary-manager --debug --approve-updates '' . . +BEGIN { unshift @INC, qw(.) } + use strict (qw(vars)); use POSIX; diff --git a/yarrg/ocean-topology-graph b/yarrg/ocean-topology-graph index 2336b43..e234189 100755 --- a/yarrg/ocean-topology-graph +++ b/yarrg/ocean-topology-graph @@ -22,6 +22,8 @@ # are used without permission. This program is not endorsed or # sponsored by Three Rings. +BEGIN { unshift @INC, qw(.) } + use strict (qw(vars)); use CommodsDatabase; diff --git a/yarrg/update-master-info b/yarrg/update-master-info index adad34c..797eb9d 100755 --- a/yarrg/update-master-info +++ b/yarrg/update-master-info @@ -52,6 +52,8 @@ # are used without permission. This program is not endorsed or # sponsored by Three Rings. +BEGIN { unshift @INC, qw(.) } + use strict (qw(vars)); use DBI; use Commods; -- 2.30.2 From 9a0d51c1af18c8797002b08b7ded985ebabfb6d6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 5 Jul 2022 12:11:27 +0100 Subject: [PATCH 04/11] disable statement unlikely for die after exec, sigh --- yarrg/Commods.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yarrg/Commods.pm b/yarrg/Commods.pm index 5d0ffe2..fcd3eac 100644 --- a/yarrg/Commods.pm +++ b/yarrg/Commods.pm @@ -30,6 +30,8 @@ use LWP::UserAgent; use strict; use warnings; +no warnings qw(exec); + BEGIN { use Exporter (); our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); -- 2.30.2 From ae585535f616e7d06d017d4df4548ce2cc2764f4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 5 Jul 2022 12:18:23 +0100 Subject: [PATCH 05/11] disable statement unlikely for die after exec, sigh --- yarrg/web/autohandler | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yarrg/web/autohandler b/yarrg/web/autohandler index 8ff0996..64e31fc 100644 --- a/yarrg/web/autohandler +++ b/yarrg/web/autohandler @@ -35,6 +35,8 @@ <%perl> +no warnings qw(exec); + use CommodsWeb; my $printable= printable($m); -- 2.30.2 From 0c3aa82b2a089f147cdeb12768b4e2eba2c34a8f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 5 Jul 2022 12:20:24 +0100 Subject: [PATCH 06/11] disable statement unlikely for die after exec, sigh --- yarrg/commod-update-receiver | 2 ++ yarrg/dictionary-update-receiver | 2 ++ yarrg/web/query_routesearch | 2 ++ 3 files changed, 6 insertions(+) diff --git a/yarrg/commod-update-receiver b/yarrg/commod-update-receiver index 42cd253..0258a51 100755 --- a/yarrg/commod-update-receiver +++ b/yarrg/commod-update-receiver @@ -33,6 +33,8 @@ use MIME::Entity; use Commods; +no warnings qw(exec); + $CGI::POST_MAX= 3*1024*1024; use CGI qw/:standard -private_tempfiles/; diff --git a/yarrg/dictionary-update-receiver b/yarrg/dictionary-update-receiver index 4c90f84..feef04b 100755 --- a/yarrg/dictionary-update-receiver +++ b/yarrg/dictionary-update-receiver @@ -35,6 +35,8 @@ BEGIN { unshift @INC, qw(.) } use strict (qw(vars)); use POSIX; +no warnings qw(exec); + $CGI::POST_MAX= 1024*1024; $CGI::DISABLE_UPLOADS= 1; diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch index 151824c..126c4e8 100644 --- a/yarrg/web/query_routesearch +++ b/yarrg/web/query_routesearch @@ -51,6 +51,8 @@ $allargs <%perl> +no warnings qw(exec); + use BSD::Resource; my $emsg; -- 2.30.2 From c184fe839f492f094be0a3d11eaf02d6440b3436 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 6 Jul 2022 16:10:24 +0100 Subject: [PATCH 07/11] Cope with modern Perl's default @INC --- yarrg/commod-email-processor | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yarrg/commod-email-processor b/yarrg/commod-email-processor index e65b2b6..ff0880e 100755 --- a/yarrg/commod-email-processor +++ b/yarrg/commod-email-processor @@ -34,6 +34,8 @@ BEGIN { my $selfdir= $0; $selfdir =~ s,/+[^/]*$,,; chdir("$selfdir") or die "$selfdir $!"; + + unshift @INC, qw(.); } use Commods; -- 2.30.2 From 83139efed910a3c4e6e5c3e6214b88d42cd5f2e2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 21 Aug 2022 18:43:23 +0100 Subject: [PATCH 08/11] tolerate stalls whose names don't start with alphanumerics --- yarrg/Commods.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarrg/Commods.pm b/yarrg/Commods.pm index fcd3eac..7f40610 100644 --- a/yarrg/Commods.pm +++ b/yarrg/Commods.pm @@ -434,8 +434,8 @@ sub check_tsv_line ($$) { defined $commods{$commod} or &$bad_data("unknown commodity ".errsan($commod)); - $stall =~ m/^\p{IsAlnum}/ or - &$bad_data("stall does not start with alphanumeric ".errsan($stall)); + $stall =~ m/\p{IsAlnum}/ or + &$bad_data("stall does not contain with alphanumeric".errsan($stall)); !exists $check_tsv_done{$commod,$stall} or &$bad_data("repeated data ".errsan($commod).",".errsan($stall)); $check_tsv_done{$commod,$stall}= 1; -- 2.30.2 From 396999fb9191b7f5ac9ef4d1e7af928df8536c81 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 2 Apr 2023 16:58:25 +0100 Subject: [PATCH 09/11] source-info.txt: add some docs about documenting commodities --- yarrg/source-info.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/yarrg/source-info.txt b/yarrg/source-info.txt index 331a7ed..aa5593d 100644 --- a/yarrg/source-info.txt +++ b/yarrg/source-info.txt @@ -45,6 +45,19 @@ commodclasses *enamel *forageables +# Commodities are defined in `commods` sections +# Each line is +# +# and the can be +# kg +# l +# * (see commodclasses, above) +# @ sort order value, for where in the commods list it goes +# @+ sort order value; 10x line number is added +# The can contain `%` which is then defined in +# a `%` section. +# Volume defaults to 1l. + commods kraken's blood 1kg *dye @105 %d dye 1kg *dye @0 -- 2.30.2 From 0dcf81a46219785088b95a0d1d8a8dc7e9683c89 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 7 Apr 2023 19:12:44 +0100 Subject: [PATCH 10/11] Add rum spice and allspice --- yarrg/source-info.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yarrg/source-info.txt b/yarrg/source-info.txt index aa5593d..e160fcb 100644 --- a/yarrg/source-info.txt +++ b/yarrg/source-info.txt @@ -162,6 +162,7 @@ commods swill 1kg *ship_supplies @0+ grog 1kg *ship_supplies @0+ fine rum 1kg *ship_supplies @0+ + rum spice 800g *ship_supplies @0+ small cannon balls 7100g *ship_supplies @0+ medium cannon balls 14200g 2l *ship_supplies @0+ large cannon balls 21300g 3l *ship_supplies @0+ @@ -182,6 +183,7 @@ commods lily of the valley 300g *herbs @0+ nettle 300g *herbs @0+ butterfly weed 100g *herbs @0+ + allspice 800g *herbs @0+ bananas 125kg 100l *forageables @300000+ carambolas 125kg 100l *forageables @300000+ -- 2.30.2 From 42b085eeec629ef67a5f4e480e70deeb42fb7cde Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 8 Apr 2023 13:20:08 +0100 Subject: [PATCH 11/11] Normalise commodity name case (from uploads) --- yarrg/Commods.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/yarrg/Commods.pm b/yarrg/Commods.pm index 7f40610..474f43f 100644 --- a/yarrg/Commods.pm +++ b/yarrg/Commods.pm @@ -427,6 +427,7 @@ sub check_tsv_line ($$) { $l =~ m/[\t [:graph:]]/ or &$bad_data('nonprinting char(s) '.sprintf "%#x", ord $&); my @v= split /\t/, $l, -1; @v==6 or &$bad_data('wrong number of fields'); + $v[0] = ucfirst lc $v[0]; # YPP anomalously has "Rum Spice" $v[1] =~ s/^\s+//; $v[1] =~ s/\s+$//; # ooo don't check :-( my ($commod,$stall) = @v; -- 2.30.2