chiark / gitweb /
Merge branch 'stable-3.x'
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 9 Sep 2009 20:46:04 +0000 (21:46 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 9 Sep 2009 20:46:04 +0000 (21:46 +0100)
yarrg/source-info.txt
yarrg/update-master-info
yarrg/web/devel [new file with mode: 0755]
yarrg/web/docs
yarrg/web/footer
yarrg/web/intro
yarrg/web/lookup

index 35a13aa618443c83bd793749245e152effbe73e5..88b93113ff41ee5bc8b4c55c387733be0dd58e9b 100644 (file)
@@ -177,6 +177,7 @@ ocean Ice
 ocean Hunter
  Eagle
   Ix Chel
+  Manu Island
 
 ocean Malachite
  Draco
index b16e7b4704b4e486b4426ad423a81656bdd4d873..e2b0973db453b093e9b6f261b60c5f2969701e8b 100755 (executable)
@@ -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 (executable)
index 0000000..7e02d4c
--- /dev/null
@@ -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 <ijackson@chiark.greenend.org.uk>
+ 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 <http://www.gnu.org/licenses/>.
+
+ 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.
+
+
+</%doc>
+<html><head><title>YARRG (Yet Another Revenue Research Gatherer)</title>
+</head><body>
+
+<a href="lookup">YARRG</a> -
+ Yet Another Revenue Research Gatherer
+|
+<b>development</b>
+|
+<a href="intro">introduction</a>
+|
+<a href="docs">documentation</a>
+
+<h1>YARRG development, contribution and troubleshooting</h1>
+
+<h2>Free Software (aka Open Source) licensing</h2>
+
+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).  </p>
+
+<p>
+
+Note that there is <strong>NO WARRANTY</strong> !
+
+<h2>Resources for developers</h2>
+
+<h3>Source code</h3>
+
+<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
+an unpacked tree</a>
+
+<p><a href="source.tar.gz">Live website source code</a> 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.
+
+<h3>YARRG lookup website instances</h3>
+ <ul>
+ <li><a href="http://yarrg.chiark.net/">Main released site</a>
+ <li><a href="http://yarrg.chiark.net/test/data">Released code; testing database instance (updated with yarrg --test-servers)</a>
+ <li><a href="http://yarrg.chiark.net/test/code">Testing version of the site code</a>
+ <li><a href="http://yarrg.chiark.net/test/both">Testing code running against the testing database instance</a>
+ </ul>
+
+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.
+
+<h3>Data</h3>
+
+<kbd>rsync rsync.yarrg.chiark.net::yarrg/</kbd><br>
+accesses files published for the benefit of the yarrg upload client,
+
+<p>
+
+This directory also contains slightly stale copies (updated daily)
+of the actual databases (in SQLite3 format).
+It is <a href="http://yarrg.chiark.net/RSYNC/">also available by http</a>
+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.
+
+<p>
+
+<kbd>rsync rsync.yarrg.chiark.net::yarrg/test/</kbd><br>
+accesses the data for the testing instance.
+
+<h3>Documentation</h3>
+
+<a href="http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/yarrg/README.devel">README.devel</a>
+has the specification of the mechanism and format for uploading to YARRG.
+
+<h2>Support from the YARRG team</h2>
+
+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.
+
+<p>
+
+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.
+
+<h2>Contacting the YARRG developers</h2>
+
+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 &>
index 1c1ce69805fcaddcb15099b842b47746b656f585..cbb1c0dd2a30dea8055aef2fae6d78c4b27d7954 100755 (executable)
@@ -39,6 +39,8 @@
 <a href="lookup">YARRG</a> -
  Yet Another Revenue Research Gatherer
 |
+<a href="devel">development</a>
+|
 <a href="intro">introduction</a>
 |
 <b>documentation</b>
@@ -56,9 +58,9 @@ from YARRG.  It offers a variety of enquiry options.
 
 <p>
 
-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.
 
 <h2>Bookmarkable URLs</h2>
 
index 9c892fc5b00b38ee3d8004f59dd18a5b43a0b8fb..9837d533e26e35bb37aed0ac73669c70da4b9d0f 100644 (file)
@@ -34,7 +34,7 @@
 
 </%doc>
 <%args>
-$isdocs => 0
+$isdevel => 0
 </%args>
 <hr>
 <address>
@@ -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 <a href="intro">YARRG introduction webpage</a> for
+% if (!$isdevel) {
+Please see the <a href="devel">YARRG Development webpage</a> for
 details of how to obtain the client and server code and full details
 of the licences.
 % }
index 3088ccedbe7400f7b61ea981d4596e6699448f7d..5b3af6e22ed2afb856d950496210d98401c0d668 100755 (executable)
@@ -39,6 +39,8 @@
 <a href="lookup">YARRG</a> -
  Yet Another Revenue Research Gatherer
 |
+<a href="devel">development</a>
+|
 <b>introduction</b>
 |
 <a href="docs">documentation</a>
@@ -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:
- <a href="/~ijackson/ypp-sc-tools/master/">http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/</a>
+ <a href="http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/">http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/</a>
 See particularly the
-<a href="/~ijackson/ypp-sc-tools/master/yarrg/README">YARRG README</a>.
+<a href="http://www.chiark.greenend.org.uk/~ijackson/ypp-sc-tools/master/yarrg/README">YARRG README</a>.
 
 <p>
 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
-<a href="/~ijackson/ypp-sc-tools/master/yarrg/README.devel">README.devel</a>.
-
-<h1>YARRG development, contribution and troubleshooting</h1>
-
-<h2>Free Software (aka Open Source)</h2>
-
-YARRG is Free Software - you may share and modify it.  See the
-licences for details.
-
-<p>
-
-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 <code>web</code>
-directory.
-
-<p>
-
-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 <a href="source.tar.gz">tarball</a> of its
-actually-running source code.
+Windows PCTB v5 upload client to upload to YARRG as well.
 
 <p>
 
-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 <a href="devel">Developers' information</a> page.
 
 <h2>Contacting the YARRG developers</h2>
 
@@ -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 &>
index 448ad6ec3441d38171735cbcbb0546b9a235ed0c..7b3100ee17b28b541416d63f2fe4aed1506d9207 100755 (executable)
@@ -141,6 +141,8 @@ tr.datarow1 { background: #ffffff; }
 <a href="<% $m->current_comp()->name() |u %>">YARRG</a> -
  Yet Another Revenue Research Gatherer
 |
+<a href="devel">development</a>
+|
 <a href="intro">introduction</a>
 |
 <a href="docs">documentation</a>