From: Ian Jackson Date: Wed, 9 Sep 2009 20:46:04 +0000 (+0100) Subject: Merge branch 'stable-3.x' X-Git-Tag: 5.0^2~151 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=5b88fe0fb309a1d55292c6b10b967481b78440d7;hp=efb064a7b665a2a704f52a8357dc88137cba7f82 Merge branch 'stable-3.x' --- diff --git a/yarrg/source-info.txt b/yarrg/source-info.txt index 35a13aa..88b9311 100644 --- a/yarrg/source-info.txt +++ b/yarrg/source-info.txt @@ -177,6 +177,7 @@ ocean Ice ocean Hunter Eagle Ix Chel + Manu Island ocean Malachite Draco diff --git a/yarrg/update-master-info b/yarrg/update-master-info index b16e7b4..e2b0973 100755 --- a/yarrg/update-master-info +++ b/yarrg/update-master-info @@ -26,6 +26,9 @@ # ./update-master-info -a # and check that nothing unexpected changes. # +# To just make backups of the databases into the rsync directory: +# ./update-master-info -b -d ~ftp/users/ijackson/yarrg/ -a +# ./update-master-info -b -d ~ftp/users/ijackson/yarrg/ -O ... # This is part of ypp-sc-tools, a set of third-party tools for assisting # players of Yohoho Puzzle Pirates. @@ -52,6 +55,8 @@ use strict (qw(vars)); use DBI; use Commods; +use CommodsDatabase; +use File::Copy; $ENV{'LC_CTYPE'}= 'en_GB.UTF-8'; @@ -119,6 +124,7 @@ sub update_master_info () { my @specoceans; my $alloceans; +my $backup; sub optarg () { return $_ if length; @@ -135,7 +141,10 @@ while (@ARGV && $ARGV[0] =~ m/^-/) { $rsyncdir= optarg(); } elsif (s/^-O//) { push @specoceans, optarg(); - } elsif (s/^-a//) { + } elsif (s/^-b/-/) { + die if $backup; + $backup=1; + } elsif (s/^-a/-/) { die if $alloceans; $alloceans=1; } else { @@ -146,10 +155,25 @@ while (@ARGV && $ARGV[0] =~ m/^-/) { die if @ARGV; die if @specoceans && $alloceans; +die if $backup && !$alloceans && !@specoceans; parse_info_serverside(); -if (@specoceans) { +if ($backup) { + my @oceans= $alloceans ? (sort keys %oceans) : @specoceans; + foreach my $ocean (@oceans) { + print "## database backup for $ocean\n"; + db_setocean($ocean); + db_writer(); + db_connect(); + $dbh->selectall_arrayref("SELECT * FROM commods WHERE commodid=1"); + my $src= db_filename(); + my $dst= $src; $dst =~ s,.*/,,; $dst= "$rsyncdir/$dst"; + copy($src,"$dst.tmp") or die "$src -> $dst.tmp $!"; + rename("$dst.tmp",$dst) or die "$dst.tmp -> $dst $!"; + $dbh->rollback(); + } +} elsif (@specoceans) { print "### full update of specified oceans ...\n"; foreach my $ocean (@specoceans) { die "$ocean ?" unless defined $oceans{$ocean}; @@ -167,7 +191,7 @@ if (@specoceans) { } } -if (defined $rsyncdir) { +if (defined $rsyncdir and !$backup) { print "### master-info update ...\n"; update_master_info(); } diff --git a/yarrg/web/devel b/yarrg/web/devel new file mode 100755 index 0000000..7e02d4c --- /dev/null +++ b/yarrg/web/devel @@ -0,0 +1,138 @@ +<%doc> + + This is part of the YARRG website. YARRG is a tool and website + for assisting players of Yohoho Puzzle Pirates. + + Copyright (C) 2009 Ian Jackson + Copyright (C) 2009 Clare Boothby + + YARRG's client code etc. is covered by the ordinary GNU GPL (v3 or later). + The YARRG website is covered by the GNU Affero GPL v3 or later, which + basically means that every installation of the website will let you + download the source. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + + Yohoho and Puzzle Pirates are probably trademarks of Three Rings and + are used without permission. This program is not endorsed or + sponsored by Three Rings. + + + This Mason component generates the introduction. + + + +YARRG (Yet Another Revenue Research Gatherer) + + +YARRG - + Yet Another Revenue Research Gatherer +| +development +| +introduction +| +documentation + +

YARRG development, contribution and troubleshooting

+ +

Free Software (aka Open Source) licensing

+ +YARRG is Free Software - you may share and modify it. See the +licences for details. Not only the client but also the website code +is Free. The yarrg client, support files, and so forth are under +the GNU GPL (v3 or later); the website is under the GNU Affero GPL (v3 +or later).

+ +

+ +Note that there is NO WARRANTY ! + +

Resources for developers

+ +

Source code

+ +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 +an unpacked tree + +

Live website source code can +be downloaded, in case we have made changes but not yet pushed them +(perhaps because we haven't done a release), and to make it easy for +anyone else who runs a copy of the website to provide everyone with +the source for their version, the website code itself lets you download +an up-to-date of its actually-running source code. So this link +gives you the source code for the pages you are now looking at. + +

YARRG lookup website instances

+ + +Each of these allows you to download its own source code so you +can get both the testing and the main version of the website. + +

Data

+ +rsync rsync.yarrg.chiark.net::yarrg/
+accesses files published for the benefit of the yarrg upload client, + +

+ +This directory also contains slightly stale copies (updated daily) +of the actual databases (in SQLite3 format). +It is also available by http +but please do not repeatedly download the databases by http - use +rsync which is much more efficient. Note also that if you want to +actually run your own improved yarrg website, I can arrange to +feed you data in real time - see below. + +

+ +rsync rsync.yarrg.chiark.net::yarrg/test/
+accesses the data for the testing instance. + +

Documentation

+ +README.devel +has the specification of the mechanism and format for uploading to YARRG. + +

Support from the YARRG team

+ +If you would like to run a (perhaps modified) copy of the YARRG +website it would be very easy for us to make our system send you +copies of updates submitted by users of the official YARRG client, in +the format expected by the YARRG code. Please just ask us - it's just +a matter of us adding your database instance's special email address +to our alias file. + +

+ +We encourage the development and improvement of this code. Please +continue to share your improvements with the Puzzle Pirates community. +In particular, do not remove or break the feature that allows users of +your website to download the up to date code you are running. + +

Contacting the YARRG developers

+ +Email Ian Jackson ijackson (at) chiark.greenend.org.uk. Or talk to +any Fleet Officer or above of the crew Special Circumstances on the +Midnight Ocean. + +<& footer, isdevel => 1 &> diff --git a/yarrg/web/docs b/yarrg/web/docs index 1c1ce69..cbb1c0d 100755 --- a/yarrg/web/docs +++ b/yarrg/web/docs @@ -39,6 +39,8 @@ YARRG - Yet Another Revenue Research Gatherer | +development +| introduction | documentation @@ -56,9 +58,9 @@ from YARRG. It offers a variety of enquiry options.

-This website documentation page contains information about the -database website which you may not be able to divine from the online -user interface. +Hopefully you will be able to work it without too much help, but this +documentation page contains information about the database website +which you may not be able to divine from the online user interface.

Bookmarkable URLs

diff --git a/yarrg/web/footer b/yarrg/web/footer index 9c892fc..9837d53 100644 --- a/yarrg/web/footer +++ b/yarrg/web/footer @@ -34,7 +34,7 @@ <%args> -$isdocs => 0 +$isdevel => 0
@@ -47,8 +47,8 @@ YARRG is Free Software. You may share and modify the code and the website, according to the terms of the GNU General Public Licence and the GNU Affero General Public Licence respectively (v3 or later). -% if (!$isdocs) { -Please see the YARRG introduction webpage for +% if (!$isdevel) { +Please see the YARRG Development webpage for details of how to obtain the client and server code and full details of the licences. % } diff --git a/yarrg/web/intro b/yarrg/web/intro index 3088cce..5b3af6e 100755 --- a/yarrg/web/intro +++ b/yarrg/web/intro @@ -39,6 +39,8 @@ YARRG - Yet Another Revenue Research Gatherer | +development +| introduction | documentation @@ -72,9 +74,9 @@ The YARRG upload client uploads both to YARRG and to the The current official version of YARRG for use as an upload client can browsed here: - http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/ + http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/ See particularly the -YARRG README. +YARRG README.

To install the client, install the `git' version control system @@ -104,39 +106,11 @@ to fetch the new version. There is not currently an upload client for Windows which feeds data into YARRG. It would probably be straightforward to modify the -Windows PCTB v5 upload client to upload to YARRG as well. The -mechanism and format for uploading is documented in -README.devel. - -

YARRG development, contribution and troubleshooting

- -

Free Software (aka Open Source)

- -YARRG is Free Software - you may share and modify it. See the -licences for details. - -

- -Not only the client but also the webserver code is Free. The website -code can be found in the same tree as above, in the web -directory. - -

- -But in case we have made changes but not yet pushed them -(perhaps because we haven't done a release), and to make it easy for -anyone else who runs a copy of the website to provide everyone with -the source for their version, the website code itself lets you download -an up-to-date tarball of its -actually-running source code. +Windows PCTB v5 upload client to upload to YARRG as well.

-If you would like to run a (perhaps modified) copy of the YARRG -website it would be very easy for us to make our system send you -copies of updates submitted by users of the official YARRG client, in -the format expected by the code you'll be running. Please just ask -us. +See our Developers' information page.

Contacting the YARRG developers

@@ -144,4 +118,4 @@ Email Ian Jackson ijackson (at) chiark.greenend.org.uk. Or talk to any Fleet Officer or above of the crew Special Circumstances on the Midnight Ocean. -<& footer, isdocs => 1 &> +<& footer &> diff --git a/yarrg/web/lookup b/yarrg/web/lookup index 448ad6e..7b3100e 100755 --- a/yarrg/web/lookup +++ b/yarrg/web/lookup @@ -141,6 +141,8 @@ tr.datarow1 { background: #ffffff; } YARRG - Yet Another Revenue Research Gatherer | +development +| introduction | documentation