[Box Backup-dev] COMMIT r675 - in box/chris/general: . bin/bbackupd bin/bbackupquery bin/bbstored distribution/boxbackup/contrib/cygwin documentation documentation/boxbackup documentation/boxbackup/html documentation/boxbackup/html/images infrastructure infrastructure/m4 lib/backupclient lib/common lib/compress lib/crypto lib/raidfile lib/server test/backupstorefix test/backupstorefix/testfiles test/basicserver test/bbackupd/testfiles

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sun Jul 23 01:13:53 BST 2006


Author: chris
Date: 2006-07-23 00:12:10 +0000 (Sun, 23 Jul 2006)
New Revision: 675

Added:
   box/chris/general/bin/bbackupd/bbackupd-config.in
   box/chris/general/bin/bbackupquery/makedocumentation.pl.in
   box/chris/general/bin/bbstored/bbstored-certs.in
   box/chris/general/bin/bbstored/bbstored-config.in
   box/chris/general/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl.in
   box/chris/general/documentation/
   box/chris/general/documentation/boxbackup/
   box/chris/general/documentation/boxbackup/Makefile
   box/chris/general/documentation/boxbackup/adminguide.xml
   box/chris/general/documentation/boxbackup/bb-book.xsl
   box/chris/general/documentation/boxbackup/bb-man.xsl
   box/chris/general/documentation/boxbackup/bb-nochunk-book.xsl
   box/chris/general/documentation/boxbackup/bbackupctl.xml
   box/chris/general/documentation/boxbackup/bbackupquery.xml
   box/chris/general/documentation/boxbackup/bbstoreaccounts.xml
   box/chris/general/documentation/boxbackup/bbstored-certs.xml
   box/chris/general/documentation/boxbackup/bbstored-config.xml
   box/chris/general/documentation/boxbackup/generate_except_xml.pl
   box/chris/general/documentation/boxbackup/html/
   box/chris/general/documentation/boxbackup/html/bbdoc-man.css
   box/chris/general/documentation/boxbackup/html/bbdoc.css
   box/chris/general/documentation/boxbackup/html/images/
   box/chris/general/documentation/boxbackup/html/images/arrow.png
   box/chris/general/documentation/boxbackup/html/images/bblogo.png
   box/chris/general/documentation/boxbackup/html/images/stepahead.png
   box/chris/general/documentation/boxbackup/instguide.xml
   box/chris/general/documentation/boxbackup/raidfile-config.xml
   box/chris/general/infrastructure/m4/ax_config_scripts.m4
   box/chris/general/infrastructure/makebuildenv.pl.in
   box/chris/general/infrastructure/makeparcels.pl.in
   box/chris/general/lib/common/makeexception.pl.in
   box/chris/general/lib/raidfile/raidfile-config.in
   box/chris/general/lib/server/makeprotocol.pl.in
   box/chris/general/runtest.pl.in
   box/chris/general/test/backupstorefix/testfiles/testbackupstorefix.pl.in
   box/chris/general/test/bbackupd/testfiles/extcheck1.pl.in
   box/chris/general/test/bbackupd/testfiles/extcheck2.pl.in
   box/chris/general/test/bbackupd/testfiles/notifyscript.pl.in
Removed:
   box/chris/general/bin/bbackupd/bbackupd-config
   box/chris/general/bin/bbackupquery/makedocumentation.pl
   box/chris/general/bin/bbstored/bbstored-certs
   box/chris/general/bin/bbstored/bbstored-config
   box/chris/general/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl
   box/chris/general/documentation/boxbackup/
   box/chris/general/documentation/boxbackup/Makefile
   box/chris/general/documentation/boxbackup/adminguide.xml
   box/chris/general/documentation/boxbackup/bb-book.xsl
   box/chris/general/documentation/boxbackup/bb-man.xsl
   box/chris/general/documentation/boxbackup/bb-nochunk-book.xsl
   box/chris/general/documentation/boxbackup/bbackupctl.xml
   box/chris/general/documentation/boxbackup/bbackupquery.xml
   box/chris/general/documentation/boxbackup/bbstoreaccounts.xml
   box/chris/general/documentation/boxbackup/bbstored-certs.xml
   box/chris/general/documentation/boxbackup/bbstored-config.xml
   box/chris/general/documentation/boxbackup/generate_except_xml.pl
   box/chris/general/documentation/boxbackup/html/
   box/chris/general/documentation/boxbackup/html/bbdoc-man.css
   box/chris/general/documentation/boxbackup/html/bbdoc.css
   box/chris/general/documentation/boxbackup/html/images/
   box/chris/general/documentation/boxbackup/html/images/arrow.png
   box/chris/general/documentation/boxbackup/html/images/bblogo.png
   box/chris/general/documentation/boxbackup/html/images/stepahead.png
   box/chris/general/documentation/boxbackup/instguide.xml
   box/chris/general/documentation/boxbackup/raidfile-config.xml
   box/chris/general/infrastructure/m4/ax_check_llong_minmax.m4
   box/chris/general/infrastructure/makebuildenv.pl
   box/chris/general/infrastructure/makeparcels.pl
   box/chris/general/lib/common/makeexception.pl
   box/chris/general/lib/raidfile/raidfile-config
   box/chris/general/lib/server/makeprotocol.pl
   box/chris/general/runtest.pl
   box/chris/general/test/backupstorefix/testfiles/testbackupstorefix.pl
   box/chris/general/test/bbackupd/testfiles/extcheck1.pl
   box/chris/general/test/bbackupd/testfiles/extcheck2.pl
   box/chris/general/test/bbackupd/testfiles/notifyscript.pl
Modified:
   box/chris/general/
   box/chris/general/bin/bbackupd/
   box/chris/general/bin/bbackupd/BackupDaemon.cpp
   box/chris/general/bin/bbackupquery/
   box/chris/general/bin/bbackupquery/BackupQueries.cpp
   box/chris/general/bin/bbackupquery/Makefile.extra
   box/chris/general/bin/bbstored/
   box/chris/general/bin/bbstored/Makefile.extra
   box/chris/general/configure.ac
   box/chris/general/infrastructure/
   box/chris/general/infrastructure/makedistribution.pl
   box/chris/general/infrastructure/setupexternal.pl
   box/chris/general/lib/backupclient/Makefile.extra
   box/chris/general/lib/common/
   box/chris/general/lib/common/Makefile.extra
   box/chris/general/lib/compress/Makefile.extra
   box/chris/general/lib/crypto/Makefile.extra
   box/chris/general/lib/raidfile/
   box/chris/general/lib/raidfile/Makefile.extra
   box/chris/general/lib/server/
   box/chris/general/lib/server/Makefile.extra
   box/chris/general/test/backupstorefix/testbackupstorefix.cpp
   box/chris/general/test/backupstorefix/testfiles/
   box/chris/general/test/basicserver/Makefile.extra
   box/chris/general/test/bbackupd/testfiles/
   box/chris/general/test/bbackupd/testfiles/bbackupd.conf
Log:
* Many files
- Merged changed from trunk revs 495-674 into win32 general branch



Property changes on: box/chris/general
___________________________________________________________________
Name: svn:ignore
   - aclocal.m4
autom4te.cache
config.log
config.status
configure
debug
ExceptionCodes.txt
local
Makefile
parcels
release

   + aclocal.m4
autom4te.cache
config.log
config.status
configure
debug
ExceptionCodes.txt
local
Makefile
parcels
release
runtest.pl



Property changes on: box/chris/general/bin/bbackupd
___________________________________________________________________
Name: svn:ignore
   - Makefile

   + Makefile
bbackupd-config


Modified: box/chris/general/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/chris/general/bin/bbackupd/BackupDaemon.cpp	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/bin/bbackupd/BackupDaemon.cpp	2006-07-23 00:12:10 UTC (rev 675)
@@ -720,6 +720,9 @@
 				::syslog(LOG_ERR, "Failed to delete the "
 					"StoreObjectInfoFile, backup cannot "
 					"continue safely.");
+				// prevent runaway process where the logs fill up -- without this
+				// the log message will be emitted in a tight loop.
+				::sleep(60); 
 				continue;
 			}
 
@@ -2541,14 +2544,25 @@
 		return false;
 	}
 
-	std::string StoreObjectInfoFile = 
-		GetConfiguration().GetKeyValue("StoreObjectInfoFile");
+	std::string storeObjectInfoFile(GetConfiguration().GetKeyValue("StoreObjectInfoFile"));
 
-	if (::unlink(StoreObjectInfoFile.c_str()) != 0)
+	// Check to see if the file exists
+	if(!FileExists(storeObjectInfoFile.c_str()))
 	{
+		// File doesn't exist -- so can't be deleted. But something isn't quite right, so log a message
+		::syslog(LOG_ERR, "Expected to be able to delete "
+			"store object info file '%s', but the file did not exist.",
+			storeObjectInfoFile.c_str());
+		// Return true to stop things going around in a loop
+		return true;
+	}
+
+	// Actually delete it
+	if(::unlink(storeObjectInfoFile.c_str()) != 0)
+	{
 		::syslog(LOG_ERR, "Failed to delete the old "
 			"store object info file '%s': %s",
-			StoreObjectInfoFile.c_str(), strerror(errno));
+			storeObjectInfoFile.c_str(), strerror(errno));
 		return false;
 	}
 

Deleted: box/chris/general/bin/bbackupd/bbackupd-config
===================================================================
--- box/chris/general/bin/bbackupd/bbackupd-config	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/bin/bbackupd/bbackupd-config	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,533 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-# should be running as root
-if($> != 0)
-{
-	printf "\nWARNING: this should be run as root\n\n"
-}
-
-sub error_print_usage
-{
-	print <<__E;
-
-Setup bbackupd config utility.
-
-Bad command line parameters.
-Usage:
-	bbackupd-config config-dir backup-mode account-num server-hostname working-dir backup-dir [more backup directories]
-
-config-dir usually /etc/box
-backup-mode is lazy or snapshot
-    lazy mode runs continously, uploading files over a specified age
-    snapshot mode uploads a snapshot of the filesystem when instructed explicitly
-account-num (hexdecimal) and server-hostname as supplied from the server administrator
-working-dir usually /var/bbackupd
-backup-dir, list of directories to back up
-
-__E
-	print "=========\nERROR:\n",$_[0],"\n\n" if $_[0] ne '';
-	exit(1);
-}
-
-# check and get command line parameters
-if($#ARGV < 4)
-{
-	error_print_usage();
-}
-
-# check for OPENSSL_CONF environment var being set
-if(exists $ENV{'OPENSSL_CONF'})
-{
-	print <<__E;
-
----------------------------------------
-
-WARNING:
-    You have the OPENSSL_CONF environment variable set.
-    Use of non-standard openssl configs may cause problems.
-
----------------------------------------
-
-__E
-}
-
-# default locations
-my $default_config_location = '/etc/box/bbackupd.conf';
-
-# command line parameters
-my ($config_dir,$backup_mode,$account_num,$server,$working_dir, at tobackup) = @ARGV;
-
-# check backup mode is valid
-if($backup_mode ne 'lazy' && $backup_mode ne 'snapshot')
-{
-	error_print_usage("ERROR: backup mode must be 'lazy' or 'snapshot'");
-}
-
-# check server exists
-{
-	my @r = gethostbyname($server);
-	if($#r < 0)
-	{
-		error_print_usage("Backup server specified as '$server', but it could not found.\n(A test DNS lookup failed -- check arguments)");
-	}
-}
-
-if($working_dir !~ m~\A/~)
-{
-	error_print_usage("Working directory $working_dir is not specified as an absolute path");
-}
-
-# ssl stuff
-my $private_key = "$config_dir/bbackupd/$account_num-key.pem";
-my $certificate_request = "$config_dir/bbackupd/$account_num-csr.pem";
-my $certificate = "$config_dir/bbackupd/$account_num-cert.pem";
-my $ca_root_cert = "$config_dir/bbackupd/serverCA.pem";
-
-# encryption keys
-my $enc_key_file = "$config_dir/bbackupd/$account_num-FileEncKeys.raw";
-
-# other files
-my $config_file = "$config_dir/bbackupd.conf";
-my $notify_script = "$config_dir/bbackupd/NotifySysadmin.sh";
-
-# check that the directories are allowable
-for(@tobackup)
-{
-	if($_ eq '/')
-	{
-		die "It is not recommended that you backup the root directory of your disc";
-	}
-	if($_ !~ m/\A\//)
-	{
-		die "Directory $_ is not specified as an absolute path";
-	}
-	if(!-d $_)
-	{
-		die "$_ is not a directory";
-	}
-}
-
-# summarise configuration
-
-print <<__E;
-
-Setup bbackupd config utility.
-
-Configuration:
-   Writing configuration file: $config_file
-   Account: $account_num
-   Server hostname: $server
-   Directories to back up:
-__E
-print '      ',$_,"\n" for(@tobackup);
-print <<__E;
-
-Note: If other file systems are mounted inside these directories, then problems may occur
-with files on the store server being renamed incorrectly. This will cause efficiency
-problems, but not affect the integrity of the backups.
-
-WARNING: Directories not checked against mountpoints. Check mounted filesystems manually.
-
-__E
-
-# create directories
-if(!-d $config_dir)
-{
-	printf "Creating $config_dir...\n";
-	mkdir $config_dir,0755 or die "Can't create $config_dir";
-}
-
-if(!-d "$config_dir/bbackupd")
-{
-	printf "Creating $config_dir/bbackupd\n";
-	mkdir "$config_dir/bbackupd",0700 or die "Can't create $config_dir/bbackupd";
-}
-
-if(!-d "$working_dir")
-{
-	printf "Creating $working_dir\n";
-	if(!mkdir($working_dir,0700))
-	{
-		die "Couldn't create $working_dir -- create this manually and try again\n";
-	}
-}
-
-# generate the private key for the server
-if(!-f $private_key)
-{
-	print "Generating private key...\n";
-	if(system("openssl genrsa -out $private_key 2048") != 0)
-	{
-		die "Couldn't generate private key."
-	}
-}
-
-# generate a certificate request
-if(!-f $certificate_request)
-{
-	die "Couldn't run openssl for CSR generation" unless
-		open(CSR,"|openssl req -new -key $private_key -sha1 -out $certificate_request");
-	print CSR <<__E;
-.
-.
-.
-.
-.
-BACKUP-$account_num
-.
-.
-.
-
-__E
-	close CSR;
-	print "\n\n";
-	die "Certificate request wasn't created.\n" unless -f $certificate_request
-}
-
-# generate the key material for the file
-if(!-f $enc_key_file)
-{
-	print "Generating keys for file backup\n";
-	if(system("openssl rand -out $enc_key_file 1024") != 0)
-	{
-		die "Couldn't generate file backup keys."
-	}
-}
-
-# write the notify when store full script
-print "Writing notify script $notify_script\n";
-open NOTIFY,">$notify_script" or die "Can't open for writing";
-
-my $hostname = `hostname`; chomp $hostname;
-my $current_username = `whoami`; chomp $current_username;
-my $sendmail = `whereis sendmail`; chomp $sendmail;
-$sendmail =~ s/\n.\Z//s;
-# for Linux style whereis
-$sendmail = $1 if $sendmail =~ /^sendmail:\s+([\S]+)/;
-# last ditch guess
-$sendmail = 'sendmail' if $sendmail !~ m/\S/;
-
-print NOTIFY <<__EOS;
-#!/bin/sh
-
-SUBJECT="BACKUP PROBLEM on host $hostname"
-SENDTO="$current_username"
-
-if [ \$1 = store-full ]
-then
-$sendmail \$SENDTO <<EOM
-Subject: \$SUBJECT (store full)
-To: \$SENDTO
-
-
-The store account for $hostname is full.
-
-=============================
-FILES ARE NOT BEING BACKED UP
-=============================
-
-Please adjust the limits on account $account_num on server $server.
-
-EOM
-elif [ \$1 = read-error ]
-then
-$sendmail \$SENDTO <<EOM
-Subject: \$SUBJECT (read errors)
-To: \$SENDTO
-
-
-Errors occured reading some files or directories for backup on $hostname.
-
-===================================
-THESE FILES ARE NOT BEING BACKED UP
-===================================
-
-Check the logs on $hostname for the files and directories which caused
-these errors, and take appropraite action.
-
-Other files are being backed up.
-
-EOM
-else
-$sendmail \$SENDTO <<EOM
-Subject: \$SUBJECT (unknown)
-To: \$SENDTO
-
-
-The backup daemon on $hostname reported an unknown error.
-
-==========================
-FILES MAY NOT BE BACKED UP
-==========================
-
-Please check the logs on $hostname.
-
-EOM
-fi
-__EOS
-
-close NOTIFY;
-chmod 0700,$notify_script or die "Can't chmod $notify_script";
-
-
-# write the configuration file
-print "Writing configuration file $config_file\n";
-open CONFIG,">$config_file" or die "Can't open config file for writing";
-print CONFIG <<__E;
-
-StoreHostname = $server
-AccountNumber = 0x$account_num
-KeysFile = $enc_key_file
-
-CertificateFile = $certificate
-PrivateKeyFile = $private_key
-TrustedCAsFile = $ca_root_cert
-
-DataDirectory = $working_dir
-
-
-# This script is run whenever bbackupd encounters a problem which requires
-# the system administrator to assist:
-# 1) The store is full, and no more data can be uploaded.
-# 2) Some files or directories were not readable.
-# The default script emails the system administrator.
-
-NotifyScript = $notify_script
-
-__E
-
-if($backup_mode eq 'lazy')
-{
-	# lazy mode configuration
-	print CONFIG <<__E;
-
-# A scan of the local discs will be made once an hour (approximately).
-# To avoid cycles of load on the server, this time is randomly adjusted by a small
-# percentage as the daemon runs.
-
-UpdateStoreInterval = 3600
-
-
-# A file must have been modified at least 6 hours ago before it will be uploaded.
-
-MinimumFileAge = 21600
-
-
-# If a file is modified repeated, it won't be uploaded immediately in case it's modified again.
-# However, it should be uploaded eventually. This is how long we should wait after first noticing
-# a change. (1 day)
-
-MaxUploadWait = 86400
-
-__E
-}
-else
-{
-	# snapshot configuration
-	print CONFIG <<__E;
-
-# This configuration file is written for snapshot mode.
-# You will need to run bbackupctl to instruct the daemon to upload files.
-
-AutomaticBackup = no
-UpdateStoreInterval = 0
-MinimumFileAge = 0
-MaxUploadWait = 0
-
-__E
-}
-
-print CONFIG <<__E;
-
-# Files above this size (in bytes) are tracked, and if they are renamed they will simply be
-# renamed on the server, rather than being uploaded again. (64k - 1)
-
-FileTrackingSizeThreshold = 65535
-
-
-# The daemon does "changes only" uploads for files above this size (in bytes).
-# Files less than it are uploaded whole without this extra processing.
-
-DiffingUploadSizeThreshold = 8192
-
-
-# The limit on how much time is spent diffing files. Most files shouldn't take very long,
-# but if you have really big files you can use this to limit the time spent diffing them.
-# * Reduce if you are having problems with processor usage.
-# * Increase if you have large files, and think the upload of changes is too large and want
-#   to spend more time searching for unchanged blocks.
-
-MaximumDiffingTime = 20
-
-
-# Uncomment this line to see exactly what the daemon is going when it's connected to the server.
-
-# ExtendedLogging = yes
-
-
-# Use this to temporarily stop bbackupd from syncronising or connecting to the store.
-# This specifies a program or script script which is run just before each sync, and ideally
-# the full path to the interpreter. It will be run as the same user bbackupd is running as,
-# usually root.
-# The script prints either "now" or a number to STDOUT (and a terminating newline, no quotes).
-# If the result was "now", then the sync will happen. If it's a number, then the script will
-# be asked again in that number of seconds.
-# For example, you could use this on a laptop to only backup when on a specific network.
-
-# SyncAllowScript = /path/to/intepreter/or/exe script-name parameters etc
-
-
-# Where the command socket is created in the filesystem.
-
-CommandSocket = /var/run/bbackupd.sock
-
-# Uncomment the StoreObjectInfoFile to enable the experimental archiving
-# of the daemon's state (including client store marker and configuration)
-# between backup runs. This saves time and increases efficiency when
-# bbackupd is frequently stopped and started, since it removes the need
-# to rescan all directories on the remote server. However, it is new and
-# not yet heavily tested, so use with caution.
-
-# StoreObjectInfoFile = $working_dir/bbackupd.state
-
-Server
-{
-	PidFile = /var/run/bbackupd.pid
-}
-
-# 
-# BackupLocations specifies which locations on disc should be backed up. Each
-# directory is in the format
-# 
-# 	name
-# 	{
-# 		Path = /path/of/directory
-# 		(optional exclude directives)
-# 	}
-# 
-# 'name' is derived from the Path by the config script, but should merely be
-# unique.
-# 
-# The exclude directives are of the form
-# 
-# 	[Exclude|AlwaysInclude][File|Dir][|sRegex] = regex or full pathname
-# 
-# (The regex suffix is shown as 'sRegex' to make File or Dir plural)
-#
-# For example:
-# 
-# 	ExcludeDir = /home/guest-user
-# 	ExcludeFilesRegex = *.(mp3|MP3)\$
-# 	AlwaysIncludeFile = /home/username/veryimportant.mp3
-# 
-# This excludes the directory /home/guest-user from the backup along with all mp3
-# files, except one MP3 file in particular.
-# 
-# In general, Exclude excludes a file or directory, unless the directory is
-# explicitly mentioned in a AlwaysInclude directive.
-# 
-# If a directive ends in Regex, then it is a regular expression rather than a
-# explicit full pathname. See
-# 
-# 	man 7 re_format
-# 
-# for the regex syntax on your platform.
-# 
-
-BackupLocations
-{
-__E
-
-# write the dirs to backup
-for my $d (@tobackup)
-{
-	$d =~ m/\A.(.+)\Z/;
-	my $n = $1;
-	$n =~ tr`/`-`;
-	
-	my $excludekeys = '';
-	if(substr($enc_key_file, 0, length($d)+1) eq $d.'/')
-	{
-		$excludekeys = "\t\tExcludeFile = $enc_key_file\n";
-		print <<__E;
-
-NOTE: Keys file has been explicitly excluded from the backup.
-
-__E
-	}
-	
-	print CONFIG <<__E
-	$n
-	{
-		Path = $d
-$excludekeys	}
-__E
-}
-
-print CONFIG "}\n\n";
-close CONFIG;
-
-# explain to the user what they need to do next
-my $daemon_args = ($config_file eq $default_config_location)?'':" $config_file";
-my $ctl_daemon_args = ($config_file eq $default_config_location)?'':" -c $config_file";
-
-print <<__E;
-
-===================================================================
-
-bbackupd basic configuration complete.
-
-What you need to do now...
-
-1) Make a backup of $enc_key_file
-   This should be a secure offsite backup.
-   Without it, you cannot restore backups. Everything else can
-   be replaced. But this cannot.
-   KEEP IT IN A SAFE PLACE, OTHERWISE YOUR BACKUPS ARE USELESS.
-
-2) Send $certificate_request
-   to the administrator of the backup server, and ask for it to
-   be signed.
-
-3) The administrator will send you two files. Install them as
-      $certificate
-      $ca_root_cert
-   after checking their authenticity.
-
-4) You may wish to read the configuration file
-      $config_file
-   and adjust as appropraite.
-   
-   There are some notes in it on excluding files you do not
-   wish to be backed up.
-
-5) Review the script
-      $notify_script
-   and check that it will email the right person when the store
-   becomes full. This is important -- when the store is full, no
-   more files will be backed up. You want to know about this.
-
-6) Start the backup daemon with the command
-      /usr/local/bin/bbackupd$daemon_args
-   in /etc/rc.local, or your local equivalent.
-   Note that bbackupd must run as root.
-__E
-if($backup_mode eq 'snapshot')
-{
-	print <<__E;
-
-7) Set up a cron job to run whenever you want a snapshot of the
-   file system to be taken. Run the command
-      /usr/local/bin/bbackupctl -q$ctl_daemon_args sync
-__E
-}
-print <<__E;
-
-===================================================================
-
-Remember to make a secure, offsite backup of your backup keys,
-as described in step 1 above. If you do not, you have no backups.
-
-__E
-

Copied: box/chris/general/bin/bbackupd/bbackupd-config.in (from rev 674, box/trunk/bin/bbackupd/bbackupd-config.in)


Property changes on: box/chris/general/bin/bbackupquery
___________________________________________________________________
Name: svn:ignore
   - autogen_Documentation.cpp
Makefile

   + autogen_Documentation.cpp
Makefile
makedocumentation.pl


Modified: box/chris/general/bin/bbackupquery/BackupQueries.cpp
===================================================================
--- box/chris/general/bin/bbackupquery/BackupQueries.cpp	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/bin/bbackupquery/BackupQueries.cpp	2006-07-23 00:12:10 UTC (rev 675)
@@ -26,6 +26,7 @@
 #endif
 
 #include <set>
+#include <limits>
 
 #include "BackupQueries.h"
 #include "Utils.h"
@@ -813,7 +814,7 @@
 	}
 	
 	int64_t id = ::strtoll(args[0].c_str(), 0, 16);
-	if(id == LLONG_MIN || id == LLONG_MAX || id == 0)
+	if(id == std::numeric_limits<long long>::min() || id == std::numeric_limits<long long>::max() || id == 0)
 	{
 		printf("Not a valid object ID (specified in hex)\n");
 		return;
@@ -930,7 +931,8 @@
 		{
 			// Specified as ID. 
 			fileId = ::strtoll(args[0].c_str(), 0, 16);
-			if(fileId == LLONG_MIN || fileId == LLONG_MAX || 
+			if(fileId == std::numeric_limits<long long>::min() || 
+				fileId == std::numeric_limits<long long>::max() || 
 				fileId == 0)
 			{
 				printf("Not a valid object ID (specified in hex)\n");
@@ -1372,6 +1374,17 @@
 				(localDirEn->d_name[1] == '\0' || (localDirEn->d_name[1] == '.' && localDirEn->d_name[2] == '\0')))
 			{
 				// ignore, it's . or ..
+				
+#ifdef HAVE_VALID_DIRENT_D_TYPE
+				if (localDirEn->d_type != DT_DIR)
+				{
+					fprintf(stderr, "ERROR: d_type does "
+						"not really work on your "
+						"platform. Reconfigure Box!\n");
+					return;
+				}
+#endif
+				
 				continue;
 			}
 
@@ -1395,7 +1408,7 @@
 			{
 			    // Directory
 			    localDirs.insert(std::string(localDirEn->d_name));
-			}			
+			}
 #else
 			// Entry -- file or dir?
 			if(localDirEn->d_type == DT_REG || localDirEn->d_type == DT_LNK)
@@ -1815,7 +1828,7 @@
 	{
 		// Specified as ID. 
 		dirID = ::strtoll(args[0].c_str(), 0, 16);
-		if(dirID == LLONG_MIN || dirID == LLONG_MAX || dirID == 0)
+		if(dirID == std::numeric_limits<long long>::min() || dirID == std::numeric_limits<long long>::max() || dirID == 0)
 		{
 			printf("Not a valid object ID (specified in hex)\n");
 			return;

Modified: box/chris/general/bin/bbackupquery/Makefile.extra
===================================================================
--- box/chris/general/bin/bbackupquery/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/bin/bbackupquery/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,6 +1,6 @@
 
 # AUTOGEN SEEDING
 autogen_Documentation.cpp:	makedocumentation.pl documentation.txt
-	perl makedocumentation.pl
+	$(PERL) makedocumentation.pl
 
 

Deleted: box/chris/general/bin/bbackupquery/makedocumentation.pl
===================================================================
--- box/chris/general/bin/bbackupquery/makedocumentation.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/bin/bbackupquery/makedocumentation.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,75 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-print "Creating built-in documentation for bbackupquery...\n";
-
-open DOC,"documentation.txt" or die "Can't open documentation.txt file";
-my $section;
-my %help;
-my @in_order;
-
-while(<DOC>)
-{
-	if(m/\A>\s+(\w+)/)
-	{
-		$section = $1;
-		m/\A>\s+(.+)\Z/;
-		$help{$section} = $1."\n";
-		push @in_order,$section;
-	}
-	elsif(m/\A</)
-	{
-		$section = '';
-	}
-	elsif($section ne '')
-	{
-		$help{$section} .= $_;
-	}
-}
-
-close DOC;
-
-open OUT,">autogen_Documentation.cpp" or die "Can't open output file for writing";
-
-print OUT <<__E;
-//
-// Automatically generated file, do not edit.
-//
-
-#include "Box.h"
-
-#include "MemLeakFindOn.h"
-
-char *help_commands[] =
-{
-__E
-
-for(@in_order)
-{
-	print OUT qq:\t"$_",\n:;
-}
-
-print OUT <<__E;
-	0
-};
-
-char *help_text[] =
-{
-__E
-
-for(@in_order)
-{
-	my $t = $help{$_};
-	$t =~ s/\t/    /g;
-	$t =~ s/\n/\\n/g;
-	$t =~ s/"/\\"/g;
-	print OUT qq:\t"$t",\n:;	
-}
-
-print OUT <<__E;
-	0
-};
-
-__E
-
-close OUT;

Copied: box/chris/general/bin/bbackupquery/makedocumentation.pl.in (from rev 674, box/trunk/bin/bbackupquery/makedocumentation.pl.in)


Property changes on: box/chris/general/bin/bbstored
___________________________________________________________________
Name: svn:ignore
   - autogen_BackupProtocolServer.cpp
autogen_BackupProtocolServer.h
Makefile

   + autogen_BackupProtocolServer.cpp
autogen_BackupProtocolServer.h
Makefile
bbstored-certs
bbstored-config


Modified: box/chris/general/bin/bbstored/Makefile.extra
===================================================================
--- box/chris/general/bin/bbstored/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/bin/bbstored/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -5,5 +5,5 @@
 
 # AUTOGEN SEEDING
 autogen_BackupProtocolServer.cpp autogen_BackupProtocolServer.h:	$(MAKEPROTOCOL) backupprotocol.txt
-	perl $(GEN_CMD_SRV)
+	$(PERL) $(GEN_CMD_SRV)
 

Deleted: box/chris/general/bin/bbstored/bbstored-certs
===================================================================
--- box/chris/general/bin/bbstored/bbstored-certs	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/bin/bbstored/bbstored-certs	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,319 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-# validity period for root certificates -- default is a very long time
-my $root_sign_period = '10000';
-
-# but less so for client certificates
-my $sign_period = '5000';
-
-# check and get command line parameters
-if($#ARGV < 1)
-{
-	print <<__E;
-
-bbstored certificates utility.
-
-Bad command line parameters.
-Usage:
-	bbstored-certs certs-dir command [arguments]
-
-certs-dir is the directory holding the root keys and certificates for the backup system
-command is the action to perform, taking parameters.
-
-Commands are
-
-	init
-		-- generate initial root certificates (certs-dir must not already exist)
-	sign certificate-name
-		-- sign a client certificate
-	sign-server certificate-name
-		-- sign a server certificate
-
-Signing requires confirmation that the certificate is correct and should be signed.
-
-__E
-	exit(1);
-}
-
-# check for OPENSSL_CONF environment var being set
-if(exists $ENV{'OPENSSL_CONF'})
-{
-	print <<__E;
-
----------------------------------------
-
-WARNING:
-    You have the OPENSSL_CONF environment variable set.
-    Use of non-standard openssl configs may cause problems.
-
----------------------------------------
-
-__E
-}
-
-# directory structure:
-#
-# roots/
-#	clientCA.pem -- root certificate for client (used on server)
-#	serverCA.pem -- root certificate for servers (used on clients)
-# keys/
-#   clientRootKey.pem -- root key for clients
-#   serverRootKey.pem -- root key for servers
-# servers/
-#   hostname.pem -- certificate for server 'hostname'
-# clients/
-#   account.pem -- certficiate for account 'account' (ID in hex)
-#
-
-
-# check parameters
-my ($cert_dir,$command, at args) = @ARGV;
-
-# check directory exists
-if($command ne 'init')
-{
-	if(!-d $cert_dir)
-	{
-		die "$cert_dir does not exist";
-	}
-}
-
-# run command
-if($command eq 'init') {&cmd_init;}
-elsif($command eq 'sign') {&cmd_sign;}
-elsif($command eq 'sign-server') {&cmd_sign_server;}
-else
-{
-	die "Unknown command $command"
-}
-
-sub cmd_init
-{
-	# create directories
-	unless(mkdir($cert_dir,0700)
-		&& mkdir($cert_dir.'/roots',0700)
-		&& mkdir($cert_dir.'/keys',0700)
-		&& mkdir($cert_dir.'/servers',0700)
-		&& mkdir($cert_dir.'/clients',0700))
-	{
-		die "Failed to create directory structure"
-	}
-
-	# create root keys and certrs
-	cmd_init_create_root('client');
-	cmd_init_create_root('server');
-}
-
-sub cmd_init_create_root
-{
-	my $entity = $_[0];
-
-	my $cert = "$cert_dir/roots/".$entity.'CA.pem';
-	my $serial = "$cert_dir/roots/".$entity.'CA.srl';
-	my $key = "$cert_dir/keys/".$entity.'RootKey.pem';
-	my $csr = "$cert_dir/keys/".$entity.'RootCSR.pem';
-
-	# generate key
-	if(system("openssl genrsa -out $key 2048") != 0)
-	{
-		die "Couldn't generate private key."
-	}
-	
-	# make CSR
-	die "Couldn't run openssl for CSR generation" unless
-		open(CSR,"|openssl req -new -key $key -sha1 -out $csr");
-	print CSR <<__E;
-.
-.
-.
-.
-.
-Backup system $entity root
-.
-.
-.
-
-__E
-	close CSR;
-	print "\n\n";
-	die "Certificate request wasn't created.\n" unless -f $csr;
-	
-	# sign it to make a self-signed root CA key
-	if(system("openssl x509 -req -in $csr -sha1 -extensions v3_ca -signkey $key -out $cert -days $root_sign_period") != 0)
-	{
-		die "Couldn't generate root certificate."
-	}
-	
-	# write the initial serial number
-	open SERIAL,">$serial" or die "Can't open $serial for writing";
-	print SERIAL "00\n";
-	close SERIAL;
-}
-
-sub cmd_sign
-{
-	my $csr = $args[0];
-	
-	if(!-f $csr)
-	{
-		die "$csr does not exist";
-	}
-	
-	# get the common name specified in this certificate
-	my $common_name = get_csr_common_name($csr);
-	
-	# look OK?
-	unless($common_name =~ m/\ABACKUP-([A-Fa-f0-9]+)\Z/)
-	{
-		die "The certificate presented does not appear to be a backup client certificate"
-	}
-	
-	my $acc = $1;
-	
-	# check against filename
-	if(!($csr =~ m/(\A|\/)([A-Fa-f0-9]+)-/) || $2 ne $acc)
-	{
-		die "Certificate request filename does not match name in certificate ($common_name)"
-	}
-		
-	print <<__E;
-
-This certificate is for backup account
-
-   $acc
-
-Ensure this matches the account number you are expecting. The filename is
-
-   $csr
-
-which should include this account number, and additionally, you should check
-that you received it from the right person.
-
-Signing the wrong certificate compromises the security of your backup system.
-
-Would you like to sign this certificate? (type 'yes' to confirm)
-__E
-
-	return unless get_confirmation();
-
-	# out certificate
-	my $out_cert = "$cert_dir/clients/$acc"."-cert.pem";
-
-	# sign it!
-	if(system("openssl x509 -req -in $csr -sha1 -extensions usr_crt -CA $cert_dir/roots/clientCA.pem -CAkey $cert_dir/keys/clientRootKey.pem -out $out_cert -days $sign_period") != 0)
-	{
-		die "Signing failed"
-	}
-	
-	# tell user what to do next
-	print <<__E;
-
-
-Certificate signed.
-
-Send the files
-
-   $out_cert
-   $cert_dir/roots/serverCA.pem
-
-to the client.
-
-__E
-}
-
-sub cmd_sign_server
-{
-	my $csr = $args[0];
-	
-	if(!-f $csr)
-	{
-		die "$csr does not exist";
-	}
-	
-	# get the common name specified in this certificate
-	my $common_name = get_csr_common_name($csr);
-	
-	# look OK?
-	if($common_name !~ m/\A[-a-zA-Z0-9.]+\Z/)
-	{
-		die "Invalid server name"
-	}
-	
-	print <<__E;
-
-This certificate is for backup server
-
-   $common_name
-
-Signing the wrong certificate compromises the security of your backup system.
-
-Would you like to sign this certificate? (type 'yes' to confirm)
-__E
-
-	return unless get_confirmation();
-
-	# out certificate
-	my $out_cert = "$cert_dir/servers/$common_name"."-cert.pem";
-
-	# sign it!
-	if(system("openssl x509 -req -in $csr -sha1 -extensions usr_crt -CA $cert_dir/roots/serverCA.pem -CAkey $cert_dir/keys/serverRootKey.pem -out $out_cert -days $sign_period") != 0)
-	{
-		die "Signing failed"
-	}
-	
-	# tell user what to do next
-	print <<__E;
-
-
-Certificate signed.
-
-Install the files
-
-   $out_cert
-   $cert_dir/roots/clientCA.pem
-
-on the server.
-
-__E
-}
-
-
-sub get_csr_common_name
-{
-	my $csr = $_[0];
-	
-	open CSRTEXT,"openssl req -text -in $csr |" or die "Can't open openssl for reading";
-	
-	my $subject;
-	while(<CSRTEXT>)
-	{
-		$subject = $1 if m/Subject:.+?CN=([-\.\w]+)/
-	}	
-	close CSRTEXT;
-
-	if($subject eq '')
-	{
-		die "No subject found in CSR $csr"
-	}
-	
-	return $subject
-}
-
-sub get_confirmation()
-{
-	my $line = <STDIN>;
-	chomp $line;
-	if(lc $line ne 'yes')
-	{
-		print "CANCELLED\n";
-		return 0;
-	}
-	
-	return 1;
-}
-
-
-
-
-

Copied: box/chris/general/bin/bbstored/bbstored-certs.in (from rev 674, box/trunk/bin/bbstored/bbstored-certs.in)

Deleted: box/chris/general/bin/bbstored/bbstored-config
===================================================================
--- box/chris/general/bin/bbstored/bbstored-config	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/bin/bbstored/bbstored-config	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,242 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-# should be running as root
-if($> != 0)
-{
-	printf "\nWARNING: this should be run as root\n\n"
-}
-
-# check and get command line parameters
-if($#ARGV < 2)
-{
-	print <<__E;
-
-Setup bbstored config utility.
-
-Bad command line parameters.
-Usage:
-	bbstored-config config-dir server-hostname username [raidfile-config]
-
-config-dir usually /etc/box
-server-hostname is the hostname used by clients to connect to this server
-username is the user to run the server under
-raidfile-config is optional. Use if you have a non-standard raidfile.conf file.
-
-__E
-	exit(1);
-}
-
-# check for OPENSSL_CONF environment var being set
-if(exists $ENV{'OPENSSL_CONF'})
-{
-	print <<__E;
-
----------------------------------------
-
-WARNING:
-    You have the OPENSSL_CONF environment variable set.
-    Use of non-standard openssl configs may cause problems.
-
----------------------------------------
-
-__E
-}
-
-# default locations
-my $default_config_location = '/etc/box/bbstored.conf';
-
-# command line parameters
-my ($config_dir,$server,$username,$raidfile_config) = @ARGV;
-
-$raidfile_config = $config_dir . '/raidfile.conf' unless $raidfile_config ne '';
-
-# check server exists, but don't bother checking that it's actually this machine.
-{
-	my @r = gethostbyname($server);
-	if($#r < 0)
-	{
-		die "Server '$server' not found. (check server name, test DNS lookup failed.)"
-	}
-}
-
-# check this exists
-if(!-f $raidfile_config)
-{
-	print "The RaidFile configuration file $raidfile_config doesn't exist.\nYou may need to create it with raidfile-config.\nWon't configure bbstored without it.\n";
-	exit(1);
-}
-
-# check that the user exists
-die "You shouldn't run bbstored as root" if $username eq 'root';
-my $user_uid = 0;
-(undef,undef,$user_uid) = getpwnam($username);
-if($user_uid == 0)
-{
-	die "User $username doesn't exist\n";
-}
-
-# check that directories are writeable
-open RAIDCONF,$raidfile_config or die "Can't open $raidfile_config";
-{
-	my %done = ();
-	while(<RAIDCONF>)
-	{
-		next unless m/Dir\d\s*=\s*(.+)/;
-		my $d = $1;
-		$d = $d.'/backup' if -e $d.'/backup';
-		print "Checking permissions on $d\n";
-		my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($d);
-		my $req_perms = ($uid == $user_uid)?0700:0007;
-		if(($mode & $req_perms) != $req_perms)
-		{
-			print "$username doesn't appear to have the necessary permissions on $d\n";
-			print "Either adjust permissions, or create a directory 'backup' inside the\n";
-			print "directory specified in raidfile.conf which is writable.\n";
-			exit(1);
-		}
-	}
-}
-close RAIDCONF;
-
-# ssl stuff
-my $private_key = "$config_dir/bbstored/$server-key.pem";
-my $certificate_request = "$config_dir/bbstored/$server-csr.pem";
-my $certificate = "$config_dir/bbstored/$server-cert.pem";
-my $ca_root_cert = "$config_dir/bbstored/clientCA.pem";
-
-# other files
-my $config_file = "$config_dir/bbstored.conf";
-my $accounts_file = "$config_dir/bbstored/accounts.txt";
-
-# summarise configuration
-
-print <<__E;
-
-Setup bbstored config utility.
-
-Configuration:
-   Writing configuration file: $config_file
-   Writing empty accounts file: $accounts_file
-   Server hostname: $server
-   RaidFile config: $raidfile_config
-
-__E
-
-# create directories
-if(!-d $config_dir)
-{
-	print "Creating $config_dir...\n";
-	mkdir $config_dir,0755 or die "Can't create $config_dir";
-}
-
-if(!-d "$config_dir/bbstored")
-{
-	print "Creating $config_dir/bbstored\n";
-	mkdir "$config_dir/bbstored",0755 or die "Can't create $config_dir/bbstored";
-}
-
-# create blank accounts file
-if(!-f $accounts_file)
-{
-	print "Creating blank accounts file\n";
-	open ACC,">$accounts_file";
-	close ACC;
-}
-
-# generate the private key for the server
-if(!-f $private_key)
-{
-	print "Generating private key...\n";
-	if(system("openssl genrsa -out $private_key 2048") != 0)
-	{
-		die "Couldn't generate private key."
-	}
-}
-
-# generate a certificate request
-if(!-f $certificate_request)
-{
-	die "Couldn't run openssl for CSR generation" unless
-		open(CSR,"|openssl req -new -key $private_key -sha1 -out $certificate_request");
-	print CSR <<__E;
-.
-.
-.
-.
-.
-$server
-.
-.
-.
-
-__E
-	close CSR;
-	print "\n\n";
-	die "Certificate request wasn't created.\n" unless -f $certificate_request
-}
-
-# write the configuration file
-print "Writing configuration file $config_file\n";
-open CONFIG,">$config_file" or die "Can't open config file for writing";
-print CONFIG <<__E;
-
-RaidFileConf = $raidfile_config
-AccountDatabase = $accounts_file
-
-# Uncomment this line to see exactly what commands are being received from clients.
-# ExtendedLogging = yes
-
-# scan all accounts for files which need deleting every 15 minutes.
-
-TimeBetweenHousekeeping = 900
-
-Server
-{
-	PidFile = /var/run/bbstored.pid
-	User = $username
-	ListenAddresses = inet:$server
-	CertificateFile = $certificate
-	PrivateKeyFile = $private_key
-	TrustedCAsFile = $ca_root_cert
-}
-
-
-__E
-
-close CONFIG;
-
-# explain to the user what they need to do next
-my $daemon_args = ($config_file eq $default_config_location)?'':" $config_file";
-
-print <<__E;
-
-===================================================================
-
-bbstored basic configuration complete.
-
-What you need to do now...
-
-1) Sign $certificate_request
-   using the bbstored-certs utility.
-
-2) Install the server certificate and root CA certificate as
-      $certificate
-      $ca_root_cert
-
-3) You may wish to read the configuration file
-      $config_file
-   and adjust as appropraite.
-
-4) Create accounts with bbstoreaccounts
-
-5) Start the backup store daemon with the command
-      /usr/local/bin/bbstored$daemon_args
-   in /etc/rc.local, or your local equivalent.
-
-===================================================================
-
-__E
-
-
-

Copied: box/chris/general/bin/bbstored/bbstored-config.in (from rev 674, box/trunk/bin/bbstored/bbstored-config.in)

Modified: box/chris/general/configure.ac
===================================================================
--- box/chris/general/configure.ac	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/configure.ac	2006-07-23 00:12:10 UTC (rev 675)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT([Box Backup], 0.09, [box at fluffy.co.uk])
+AC_INIT([Box Backup], 0.10, [box at fluffy.co.uk])
 AC_CONFIG_SRCDIR([lib/common/Box.h])
 AC_CONFIG_HEADERS([lib/common/BoxConfig.h])
 
@@ -26,6 +26,12 @@
   # Use -rdynamic if we have gcc. This is needed for backtrace
   AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic'])
 fi
+AC_PATH_PROG([PERL], [perl], [no])
+if test "x$PERL" != "xno"; then
+  AC_DEFINE_UNQUOTED([PERL_EXECUTABLE], ["$PERL"], [Location of the perl executable])
+else
+  AC_MSG_ERROR([[perl executable was not found]])
+fi
 
 
 ### Checks for libraries.
@@ -126,7 +132,6 @@
 AC_STRUCT_TM
 AX_CHECK_DIRENT_D_TYPE
 AC_SYS_LARGEFILE
-AX_CHECK_LLONG_MINMAX
 AX_CHECK_DEFINE_PRAGMA
 if test "x$ac_cv_c_bigendian" != "xyes"; then
   AX_BSWAP64
@@ -226,12 +231,27 @@
 
 ### Output files
 AC_CONFIG_FILES([infrastructure/BoxPlatform.pm])
+AX_CONFIG_SCRIPTS([bin/bbackupd/bbackupd-config
+                   bin/bbackupquery/makedocumentation.pl
+                   bin/bbstored/bbstored-certs
+                   bin/bbstored/bbstored-config
+                   infrastructure/makebuildenv.pl
+                   infrastructure/makeparcels.pl
+                   lib/common/makeexception.pl
+                   lib/raidfile/raidfile-config
+                   lib/server/makeprotocol.pl
+                   runtest.pl
+                   test/backupstorefix/testfiles/testbackupstorefix.pl
+                   test/bbackupd/testfiles/extcheck1.pl
+                   test/bbackupd/testfiles/extcheck2.pl
+                   test/bbackupd/testfiles/notifyscript.pl])
+# TODO: Need to do contrib/cygwin/install-cygwin-service.pl but location varies
 AC_OUTPUT
 
 # Configure the Box build system
 echo
-perl ./infrastructure/makebuildenv.pl &&
-  perl ./infrastructure/makeparcels.pl
+$PERL ./infrastructure/makebuildenv.pl &&
+  $PERL ./infrastructure/makeparcels.pl
 
 # Write summary of important info
 cat <<EOC

Deleted: box/chris/general/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl
===================================================================
--- box/chris/general/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,112 +0,0 @@
-#!/usr/bin/perl -w
-
-
-# Contributed to the boxbackup project by Per Reedtz Thomsen. pthomsen at reedtz.com
-
-# This script reads the config file for boxbackup, and changes the mode
-# of the directory named by 'DataDirectory' and any files there. Also,
-# the files pointed to by the 'CommandSocket' and 'PidFile' configuration
-# parameters will be chmod'ed to be read-write by all.
-# The Windows services are created and started using the 'cygrunsrv' utility.
-
-# Date      Who                      Comments
-# 20041005  pthomsen at reedtz.com      Created 
-# 20041020  pthomsen at reedtz.com	     Switched to using Getopt::Std for cmd-line things.
-
-use strict;
-
-use Getopt::Std;
-getopt('ce');
-our ($opt_c, $opt_e);
-# Figure out the config file to use. Default is /etc/box/bbackupd.conf
-my $confFile = (defined($opt_c) ? $opt_c :  "/etc/box/bbackupd.conf");
-# Figure out the bbaackupd executable to use. Default is /usr/local/bin/bbackupd.exe
-my $exeFile = (defined($opt_e) ? $opt_e :  "/usr/local/bin/bbackupd.exe");
-
-die "File $confFile does not exist. Please provide the full path to the bbackupd configuration file.\n" if !(-f $confFile);
-die "Can't read $confFile. Permission denied. Please chmod the file so I can read it.\n" if !(-r $confFile);
-die "File $exeFile does not exist. Please provide the full path to the bbackupd.exe file.\n" if !(-f $exeFile);
-die "File $exeFile is not executable. Please provide the full path to the correct bbackupd.exe file.\n" if !(-x $exeFile);
-
-# print "Config: $confFile\n";
-
-my $dataDir;
-my $cmdSocket;
-my $pidFile;
-
-open (CONFIG, "<$confFile") or die "Can't open $confFile: $!\n";
-
-# Read the confgiguration file, and pull the DataDirectory, CommandSocket, and PidFile parameters.
-while (<CONFIG>)
-{
-    
-    if (/^\s*DataDirectory\s*=\s*([^\n\s]+)\s*\n/)
-    {
-	$dataDir = $1;
-	next;
-    }
-
-    if (/^\s*CommandSocket\s*=\s*([^\n\s]+)\s*\n/)
-    {
-	$cmdSocket = $1;
-	next;
-    }
-    if (/^\s*PidFile\s*=\s*([^\n\s]+)\s*\n/)
-    {
-	$pidFile = $1;
-	next;
-    }
-}
-
-# check that we got all the parameters from the file. If not, die.
-if ((!defined($dataDir)) || (!defined($cmdSocket)) || (!defined($pidFile)))
-{
-    die "Could not read config parameters from $confFile. Values retrieved:\n\tDataDirectory = $dataDir\n\tCommandSocket = $cmdSocket\n\tPidFile = $pidFile\n";
-}
-
-
-print  "Parameters retrieved from $confFile. Values:\n\tDataDirectory = $dataDir\n\tCommandSocket = $cmdSocket\n\tPidFile = $pidFile\n";
-print "chmod...";
-# change the mode of the files/dirs retrieved.
-chmod(0777, $dataDir) or die "Can't chmod $dataDir: $!\n";
-chmod(0666, "$dataDir/*") or die "Can't chmod $dataDir/*: $!\n";
-chmod(0666, $pidFile) or die "Can't chmod $pidFile: $!\n";
-chmod(0755, $cmdSocket) or die "Can't chmod $cmdSocket: $!\n";
-print " Done.\n";
-
-# Now install the service using cygrunsrv.
-# Details: 
-#   -I <svc_name>      Install a service. svc_name is the name under which the
-#                      service will appear in the Windows Service Manager
-#   -p <path_to_exe>   Path to the executable.
-#   -a <options>       Command line options to the executable.
-#   -f <description>   Description of the service.
-#   -o                 Attempt clean exit of service during system shutdown
-
-print "Installing boxbackup service...";
-my $sysCmd = "cygrunsrv.exe -I boxbackup -p " . $exeFile;
-$sysCmd .= " -a \"" . $confFile . " SINGLEPROCESS\"";
-$sysCmd .= " -o -f \"Online Backup System by Ben Summers\"";
-print "$sysCmd\n";
-my $output = qx($sysCmd);
-die "cygrunsrv failed to install service. Error Message: $output\n" if($output ne "");
-print " Done.\n";
-
-
-# Start the service
-# Details:
-#   -S <svc_name>     Start a service. svc_name is the name of the (installed)
-#                     service to start.
-
-print "Starting boxbackup service...";
-$sysCmd = "cygrunsrv.exe -S boxbackup";
-print "$sysCmd\n";
-$output = qx($sysCmd);
-die "cygrunsrv failed to start service. Error Message: $output\n" if($output ne "");
-print " Done.\n";
-
-print "\n\nService Installation complete. To test, reboot your machine, and make sure that\n";
-print "the boxbackup service is running. A good way to make sure, is to check that the account number\n";
-print "from this machine is connecting to the bbstored server. Check the bbstored logs for more info.\n\n";
-
-

Copied: box/chris/general/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl.in (from rev 674, box/trunk/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl.in)

Copied: box/chris/general/documentation (from rev 674, box/trunk/documentation)

Copied: box/chris/general/documentation/boxbackup (from rev 674, box/trunk/documentation/boxbackup)

Deleted: box/chris/general/documentation/boxbackup/Makefile
===================================================================
--- box/trunk/documentation/boxbackup/Makefile	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/Makefile	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,64 +0,0 @@
-
-
-# Process DocBook to HTML
-
-DBPROC=/usr/bin/xsltproc
-BOOKXSL=bb-book.xsl
-NOCHUNKBOOKXSL=bb-nochunk-book.xsl
-MANXSL=bb-man.xsl
-HTMLPREFIX=box-html
-VPATH= adminguide
-.SUFFIXES: .html .xml
-
-all: adminguide instguide manpages 
-
-adminguide: $(HTMLPREFIX)/adminguide/index.html 
-
-$(HTMLPREFIX)/adminguide/index.html: adminguide.xml ExceptionCodes.xml $(BOOKXSL)
-	# docname=`echo $@ | sed -e 's/\/index.html//'`
-	$(DBPROC) -o $(HTMLPREFIX)/adminguide/ $(BOOKXSL) adminguide.xml
-
-instguide: $(HTMLPREFIX)/instguide/index.html 
-
-$(HTMLPREFIX)/instguide/index.html: instguide.xml $(BOOKXSL)
-	$(DBPROC) -o $(HTMLPREFIX)/instguide/ $(BOOKXSL) instguide.xml
-
-ExceptionCodes.xml: ../../ExceptionCodes.txt
-	perl ./generate_except_xml.pl
-
-manpages: man-dirs man-nroff man-html
-
-man-dirs: man-pages/.there $(HTMLPREFIX)/man-html/.there
-
-$(HTMLPREFIX)/man-html/.there:
-	if [ ! -d man-html ]; then mkdir -p $(HTMLPREFIX)/man-html; touch $(HTMLPREFIX)/man-html/.there; fi
-
-man-pages/.there:
-	if [ ! -d man-pages ]; then mkdir man-pages; touch man-pages/.there; fi
-
-man-nroff: bbackupquery.1 bbackupctl.1 bbstoreaccounts.1 bbstored-config.1 raidfile-config.1 bbstored-certs.1
-
-man-html: bbackupquery.html bbackupctl.html bbstoreaccounts.html bbstored-config.html raidfile-config.html bbstored-certs.html
-
-%.html: %.xml
-	$(DBPROC) -o $@ $(NOCHUNKBOOKXSL) $<
-	mv $@ $(HTMLPREFIX)/man-html/.
-
-%.1: %.xml
-	$(DBPROC) -o $@ $(MANXSL) $<
-	mv $@ man-pages/.
-	gzip -f -9 man-pages/$@
-
-dockit: instguide adminguide manpages
-	mkdir $(HTMLPREFIX)/images
-	cp html/images/*.png $(HTMLPREFIX)/images/.
-	cp html/*.css $(HTMLPREFIX)/.
-	tar zcf documentation-kit-0.10.tar.gz $(HTMLPREFIX)/
-
-clean:
-	if [ -d ./$(HTMLPREFIX) ]; then rm -rf $(HTMLPREFIX) ; fi
-	if [ -d ./man-pages ]; then  rm -rf ./man-pages/; fi
-	if [ -f ExceptionCodes.xml ]; then rm ExceptionCodes.xml; fi
-	if [ -f documentation-kit-0.10.tar.gz ]; then rm documentation-kit-0.10.tar.gz; fi
-
-

Copied: box/chris/general/documentation/boxbackup/Makefile (from rev 674, box/trunk/documentation/boxbackup/Makefile)

Deleted: box/chris/general/documentation/boxbackup/adminguide.xml
===================================================================
--- box/trunk/documentation/boxbackup/adminguide.xml	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/adminguide.xml	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,1232 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
-<!ENTITY __ExceptionCodes__elfjz3fu SYSTEM "ExceptionCodes.xml">
-]>
-<book>
-  <title>Box Backup administrator's guide</title>
-
-  <preface>
-    <title>License</title>
-
-    <para>Copyright © 2003 - 2006, Ben Summers and contributors. All rights
-    reserved.</para>
-
-    <para>Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are
-    met:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>Redistributions of source code must retain the above copyright
-        notice, this list of conditions and the following disclaimer.</para>
-      </listitem>
-
-      <listitem>
-        <para>Redistributions in binary form must reproduce the above
-        copyright notice, this list of conditions and the following disclaimer
-        in the documentation and/or other materials provided with the
-        distribution.</para>
-      </listitem>
-
-      <listitem>
-        <para>Neither the name of the authors nor the names of its
-        contributors may be used to endorse or promote products derived from
-        this software without specific prior written permission</para>
-      </listitem>
-    </itemizedlist>
-
-    <para>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</para>
-  </preface>
-
-  <chapter>
-    <title>Configuration</title>
-
-    <section>
-      <title>System configuration</title>
-
-      <section>
-        <title>Server</title>
-
-        <para>After you've downloaded and compiled the programs you need to
-        install the programs on your server. As root do the following:</para>
-
-        <programlisting>make install-backup-server</programlisting>
-
-        <para>This assumes that you are installing on the same server that you
-        compiled the software on. If not, copy the
-        boxbackup-x.xx-backup-server-OSNAME.tgz file to the server you want to
-        run on, and install there. For example (on Mac OS X):</para>
-
-        <programlisting>tar zxvf boxbackup-0.10-server-darwin8.5.0.tgz
-cd boxbackup-0.10-server-darwin8.5.0
-./install-backup-server</programlisting>
-
-        <para>Then create the user for the backup daemon on the server:</para>
-
-        <programlisting>useradd _bbstored</programlisting>
-
-        <para>BoxBackup supports Raid for the backup store. There are some
-        configuration options. Use the following command if you want to create
-        a simple server WITHOUT Raid protection:</para>
-
-        <programlisting>mkdir /tmp/boxbackupRepository                        # Create the directory
-chown _bbstored /tmp/boxbackupRepository/             # Change the owner to the new boxbackup daemon user
-
-/usr/local/bin/raidfile-config /etc/box/  1024 /tmp/boxbackupRepository
-
-#substitute 1024 with the desired blocksize
-#substitute /tmp/boxbackupRepository with a directory that exists where you want the backup store located
-#/usr/local/bin/raidfile-config --help shows you the options</programlisting>
-
-        <para>Then create the configuration file /etc/box/bbstored.conf The
-        hostname is tricky as it is used for two things: The name of the
-        server in the certificate and the address the server is listening on.
-        Since you might be using NAT, might move the server around or the
-        domain name might change, choose a name that describes the server.
-        When the network address of the server changes, you need to update the
-        ListenAddresses directive in the /etc/box/bbstored.conf file.</para>
-
-        <programlisting>/usr/local/bin/bbstored-config /etc/box hostname _bbstored</programlisting>
-
-        <para>This last step outputs 5 instructions that you must execute to
-        the letter. A lot of questions are raised on the mailing list because
-        these steps have not been followed properly.</para>
-
-        <para>TODO: Expand on this. Explain the 5 steps in detail.</para>
-
-        <para>If you want to run the system as a non-root user, look <link
-        linkend="WORoot">here</link>.</para>
-      </section>
-
-      <section>
-        <title>Certificate Management</title>
-
-        <para>There are two steps involved to create an account. You need to
-        create the account on the server, and sign a certificate to give the
-        client permission to connect to the server.</para>
-
-        <para>Running a Certification Authority for TLS (SSL) connections is
-        not trivial. However, a script to does most of the work in a way which
-        should be good enough for most deployments.</para>
-
-        <para><emphasis role="bold">Important Note:</emphasis> The certificate
-        authority directory is intended to be stored on another server. It
-        should not be kept on the backup server to limit the impact of a
-        server compromise. The instructions and the script assume that it will
-        be kept elsewhere, so will ask you to copy files to and from the
-        CA.</para>
-
-        <para><emphasis role="bold">Clock time warning</emphasis>: SSL
-        certificates contain validity dates, including a "valid from" time. If
-        the clock on the machine which signs the certificates is not
-        syncronised to the clocks of the machines using these certificates,
-        you will probably get strange errors until the start time is reached
-        on all machines. If you get strange errors when attempting to use new
-        certificates, check the clocks! You will probably just need to wait a
-        while until the certificates become valid, rather than having to
-        regenerate them.</para>
-
-        <section>
-          <title>Set up a CA</title>
-
-          <para>It's best to do this on a machine other than your server,
-          probably without direct network access. The contents of this
-          directory control who can access your backup store server.</para>
-
-          <para>To setup the basic key structure, do the following:</para>
-
-          <programlisting>/usr/local/bin/bbstored-certs ca init</programlisting>
-
-          <para>(See <link linkend="instguide.xml">OpenSSL notes</link> if you
-          get an OpenSSL error)</para>
-
-          <para>This creates the directory 'ca' in the current directory, and
-          initialises it with basic keys.</para>
-        </section>
-
-        <section>
-          <title>Sign a server certificate</title>
-
-          <para>When you use the bbstored-config script to set up a config
-          file for a server, it will generate a certificate request (CSR) for
-          you. Transfer it to the machine with your CA, then do:</para>
-
-          <programlisting>/usr/local/bin/bbstored-certs ca sign-server hostname-csr.pem</programlisting>
-
-          <para>This signs the certificate for the server. Follow the
-          instructions in the output on which files to install on the server.
-          The CSR file is now no longer needed. Make sure you run this command
-          from the directory above the directory 'ca'.</para>
-
-          <para>TODO: Explain instructions in output.</para>
-        </section>
-
-        <section>
-          <title>Set up an account</title>
-
-          <para>Choose an account number for the user. This must be unique on
-          the server, and is presented as a 31 bit number in hex greater than
-          0, for example, 1 or 75AB23C. Then on the backup store server,
-          create the account with:</para>
-
-          <programlisting>/usr/local/bin/bbstoreaccounts create 75AB23C 0 4096M 4505M</programlisting>
-
-          <para>This looks complicated. The numbers are, in order:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para>The account number allocated (hex)</para>
-            </listitem>
-
-            <listitem>
-              <para>The RAID disc set (0 if you use raidfile-config and don't
-              add a new set)</para>
-            </listitem>
-
-            <listitem>
-              <para>Soft limit (size)</para>
-            </listitem>
-
-            <listitem>
-              <para>Hard limit (size)</para>
-            </listitem>
-          </itemizedlist>
-
-          <para>The sizes are are specified in Mb, Gb, or blocks, depending on
-          the suffix. 1M specifies 1 Mb, 1G specifies 1 Gb, and 1B specifies 1
-          block, the size of which depends on how you have configured the
-          raidfile system with raidfile-config.</para>
-
-          <para>In this example, I have allocated 4Gb (assuming you use 2048
-          byte blocks as per my example) as the soft limit, and 4Gb + 10% as
-          the hard limit.</para>
-
-          <para>NOTE The sizes specified here are pre-RAID. So if you are
-          using userland RAID, you are actually allocating two-thirds of this
-          amount. This means that, when you take compression into account,
-          that if you allocate 2Gb on the server, it'll probably hold about
-          2Gb of backed up files (depending on the compressability of those
-          files).</para>
-
-          <para>The backup client will (voluntarily) try not to upload more
-          data than is allowed by the soft limit. The store server will refuse
-          to accept a file if it would take it over the hard limit, and when
-          doing housekeeping for this account, try and delete old versions and
-          deleted files to reduce the space taken to below the soft
-          limit.</para>
-
-          <para>This command will create some files on disc in the raid file
-          directories (if you run as root, the utility will change to the user
-          specified in the bbstored.conf file to write them) and update the
-          accounts file. A server restart is not required.</para>
-
-          <para>NOTE If you get a message saying 'Exception: RaidFile (2/8)',
-          the directories you specified in the raidfile.conf are not writable
-          by the _bbstored user -- fix it, and try again.</para>
-
-          <para>Finally, tell the user their account number, and the hostname
-          of your server. They will use this to set up the backup client, and
-          send you a CSR. This has the account number embedded in it, and you
-          should be sure that it has the right account number in it.</para>
-
-          <para>Sign this CSR with this command:</para>
-
-          <programlisting>/usr/local/bin/bbstored-certs ca sign 75AB23C-csr.pem</programlisting>
-
-          <para>Don't forget to check that the embedded account number is
-          correct! Then send the two files back to the user, as instructed by
-          the script.</para>
-
-          <para>Please read the Troubleshooting page if you have
-          problems.</para>
-
-          <para>TODO: Link to troubleshooting...</para>
-        </section>
-      </section>
-
-      <section>
-        <title>Log Files</title>
-
-        <para>You may wish to see what's going on with the server. Edit
-        /etc/syslog.conf, and add:</para>
-
-        <programlisting>local6.info                         /var/log/box
-local5.info                         /var/log/raidfile</programlisting>
-
-        <para><emphasis role="bold">Note:</emphasis> Separators must be tabs,
-        otherwise these entries will be ignored.</para>
-
-        <programlisting>touch /var/log/box
-touch /var/log/raidfile</programlisting>
-
-        <para>Set up log rotation, by adding in /etc/newsyslog.conf:</para>
-
-        <programlisting>/var/log/box                644  7    2000 *     Z
-/var/log/raidfile           644  7    2000 *     Z</programlisting>
-
-        <para>Then restart syslogd.</para>
-      </section>
-
-      <section>
-        <title>Configuring a client</title>
-
-        <para>Before you can do any configuration, you need to know the
-        hostname of the server you will be using, and your account number on
-        that server.</para>
-
-        <para>Later in the process, you will need to send a certificate
-        request to the administrator of that server for it to be
-        signed.</para>
-
-        <para>Installation is covered in the compiling and installing section.
-        You only need the backup-client parcel.</para>
-
-        <para>It is important that you read all the output of the config
-        scripts. See the end of this page for an example.</para>
-
-        <para>The backup client has to be run as root, because it needs to
-        read all your files to back them up, although it is possible to back
-        up a single user's files by running it as that user. (Tip: specify a
-        directory other than /etc/box, and then give the alternate config file
-        as the first argument to bbackupd). However, it will fall over if you
-        don't give yourself read access to one of your files.</para>
-
-        <section>
-          <title id="BasicConfig">Basic configuration</title>
-
-          <para>Run the bbackupd-config script to generate the configuration
-          files and generate a private key and certificate request.</para>
-
-          <programlisting>/usr/local/bin/bbackupd-config /etc/box lazy <emphasis
-              role="bold">999 hostname</emphasis> /var/bbackupd <emphasis
-              role="bold">/home</emphasis></programlisting>
-
-          <para>(See <link linkend="instguide.sgml">OpenSSL notes</link> if
-          you get an OpenSSL error)</para>
-
-          <para>The items in bold need to be changed. In order, they are the
-          account number, the hostname of the server you're using, and
-          finally, the directories you want backed up. You can include as many
-          you want here.</para>
-
-          <para>However, the directories you specify must not contain other
-          mounted file systems within them at any depth. Specify them
-          separately, one per mount point. No checks are currently made to
-          catch bad configuration of this nature!</para>
-
-          <para>You may also want to consider changing the mode from lazy to
-          snapshot, depending on what your system is used for.</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><emphasis role="bold">lazy</emphasis>. This mode regularly
-              scans the files, with only a rough schedule. It uploads files as
-              and when they are changed, if the latest version is more than a
-              set age. This is good for backing up user's documents stored on
-              a server, and spreads the load out over the day.</para>
-            </listitem>
-
-            <listitem>
-              <para><emphasis role="bold">snapshot</emphasis>. This mode
-              emulates the traditional backup behaviour of taking a snapshot
-              of the filesystem. The backup daemon does absolutely nothing
-              until it is instructed to make a backup using the bbackupctl
-              utility (probably as a cron job), at which point it uploads all
-              files which have been changed since the last time it
-              uploaded.</para>
-            </listitem>
-          </itemizedlist>
-
-          <para>When you run the config script, it will tell you what you need
-          to do next. Don't forget to read all the output. An example is shown
-          at the end of this page, but the instructions for your installation
-          may be different.</para>
-        </section>
-
-        <section>
-          <title>Certificates</title>
-
-          <para>After you have sent your certificate request off to the server
-          administrator and received your certificate and CA root back,
-          install them where instructed by the bbackupd-config script during
-          basic bbackupd configuration.</para>
-
-          <para>You can then run the daemon (as root) by typing
-          /usr/local/bin/bbackupd, and of course, adding it to your system's
-          startup scripts. The first time it's run it will upload everything.
-          Interrupting it and restarting it will only upload files which were
-          not uploaded before - it's very tolerant.</para>
-
-          <para>If you run in snapshot mode, you will need to add a cron job
-          to schedule backups. The config script will tell you the exact
-          command to use for your system.</para>
-
-          <para>Please read the Troubleshooting page if you have
-          problems.</para>
-
-          <para>Remember to make a traditional backup of the keys file, as
-          instructed. You cannot restore files without it.</para>
-
-          <para>It is recommended that you backup up all of /etc/box as it
-          will make things easier if you need to restore files. But only the
-          keys are absolutely essential.</para>
-
-          <para>If you want to see what it's doing in more detail (probably a
-          good idea), follow the instructions in the server setup to create
-          new log files with syslog. Adding and removing backed up
-          locations.</para>
-
-          <para>By editing the /etc/box/bbackupd.conf file, you can add and
-          remove directories to back up -- see comments in this file for help.
-          Send bbackupd a HUP signal after you modify it.</para>
-
-          <para>When you remove a location, it will not be marked as deleted
-          immediately. Instead, bbackupd waits about two days before doing so,
-          just in case you change your mind. After this, it will be eventually
-          removed from the store by the housekeeping process. Run as
-          root.</para>
-
-          <para>The backup client is designed to be run as root. It is
-          possible to run without root, but this is not recommended. Clock
-          synchronisation for file servers.</para>
-
-          <para>If you are using the backup client to backup a filesystem
-          served from a fileserver, you should ideally ensure that the
-          fileserver clocks are synchronised with the fileserver.</para>
-
-          <para>bbackupd will cope perfectly well if the clocks are not
-          synchronised. Errors up to about half an hour cause no problems.
-          Larger discrepancies cause a loss of efficiency and the potential to
-          back up a file during a write process.</para>
-
-          <para>There is a configuration parameter MaxFileTimeInFuture, which
-          specifies how far in the future a file must be for it to be uploaded
-          as soon as it is seen. You should not need to adjust this (default
-          is 2 days). Instead, get those clocks synchronised. Excluding files
-          and directories from the backup.</para>
-
-          <para>Within the bbackupd.conf file, there is a section named
-          BackupLocations which specifies which locations on disc should be
-          backed up. It has subsections, each of which is in the
-          format:</para>
-
-          <programlisting> name
- {
-    Path = /path/of/directory
-    (optional exclude directives)
- }</programlisting>
-
-          <para><emphasis role="bold">name</emphasis> is derived from the Path
-          by the config script, but should merely be unique.</para>
-
-          <para>The exclude directives are of the form:</para>
-
-          <programlisting>[Exclude|AlwaysInclude][File|Dir][|sRegex] = regex or full pathname</programlisting>
-
-          <para>(The regex suffix is shown as 'sRegex' to make File or Dir
-          plural)</para>
-
-          <para>For example:</para>
-
-          <programlisting> ExcludeDir = /home/guest-user
- ExcludeFilesRegex = *.(mp3|MP3)\$
- AlwaysIncludeFile = /home/username/veryimportant.mp3</programlisting>
-
-          <para>This excludes the directory /home/guest-user from the backup
-          along with all mp3 files, except one MP3 file in particular.</para>
-
-          <para>In general, Exclude excludes a file or directory, unless the
-          directory is explicitly mentioned in a AlwaysInclude
-          directive.</para>
-
-          <para>If a directive ends in Regex, then it is a regular expression
-          rather than a explicit full pathname. See</para>
-
-          <programlisting> man 7 re_format</programlisting>
-
-          <para>for the regex syntax on your platform.</para>
-        </section>
-
-        <section>
-          <title>Example configuration output</title>
-
-          <para>This is an example of output from the bbstored-config
-          script.</para>
-
-          <para><emphasis role="bold">Important</emphasis>: Follow the
-          instructions output by your script, not the ones here -- they may be
-          different for your system.</para>
-
-          <programlisting>/usr/local/bin/bbackupd-config /etc/box lazy 51 server.example.com /var/bbackupd /home /etc/samba
-
-Setup bbackupd config utility.
-
-Configuration:
-   Writing configuration file: /etc/box/bbackupd.conf
-   Account: 51
-   Server hostname: server.example.com
-   Directories to back up:
-      /home
-      /etc/samba
-
-Note: If other file systems are mounted inside these directories, then problems may occur
-with files on the store server being renamed incorrectly. This will cause efficiency
-problems, but not affect the integrity of the backups.
-
-WARNING: Directories not checked against mountpoints. Check mounted filesystems manually.
-
-Creating /etc/box...
-Creating /etc/box/bbackupd
-Generating private key...
- [OpenSSL output omitted]
-
-Generating keys for file backup
-Writing notify script /etc/box/bbackupd/NotifyStoreFull.sh
-Writing configuration file /etc/box/bbackupd.conf
-
-===================================================================
-
-bbackupd basic configuration complete.
-
-What you need to do now...
-
-1) Make a backup of /etc/box/bbackupd/51-FileEncKeys.raw
-   This should be a secure offsite backup.
-   Without it, you cannot restore backups. Everything else can
-   be replaced. But this cannot.
-   KEEP IT IN A SAFE PLACE, OTHERWISE YOUR BACKUPS ARE USELESS.
-
-2) Send /etc/box/bbackupd/51-csr.pem
-   to the administrator of the backup server, and ask for it to
-   be signed.
-
-3) The administrator will send you two files. Install them as
-      /etc/box/bbackupd/51-cert.pem
-      /etc/box/bbackupd/serverCA.pem
-   after checking their authenticity.
-
-4) You may wish to read the configuration file
-      /etc/box/bbackupd.conf
-   and adjust as appropraite.
-   
-   There are some notes in it on excluding files you do not
-   wish to be backed up.
-
-5) Review the script
-      /etc/box/bbackupd/NotifyStoreFull.sh
-   and check that it will email the right person when the store
-   becomes full. This is important -- when the store is full, no
-   more files will be backed up. You want to know about this.
-
-6) Start the backup daemon with the command
-      /usr/local/bin/bbackupd
-   in /etc/rc.local, or your local equivalent.
-   Note that bbackupd must run as root.
-
-===================================================================</programlisting>
-
-          <para>Remember to make a secure, offsite backup of your backup keys,
-          as described in <link linkend="BasicConfig">Basic
-          configuration</link> above. If you do not,, and that key is lost,
-          you have no backups.</para>
-        </section>
-      </section>
-    </section>
-  </chapter>
-
-  <chapter>
-    <title>Administration</title>
-
-    <para>This chapter deals with the dauily running and management of the Box
-    Backup system. It explains most day-to-day tasks.</para>
-
-    <section>
-      <title>Regular Maintenance</title>
-
-      <para>The steps involved in maintaining and keeping the backup sets
-      healthy are outlined in this section.</para>
-
-      <section>
-        <title>Controlling a backup client</title>
-
-        <para>The bbackupctl program sends control commands to the bbackupd
-        daemon. It must be run as the same user as the daemon, and there is no
-        exception for root.</para>
-
-        <para>The command line syntax is:</para>
-
-        <programlisting>/usr/local/bin/bbackupctl [-q] [-c config-file] command</programlisting>
-
-        <para>The -q option reduces the amount of output the program emits,
-        and -c allows an alternative configuration file to be
-        specified.</para>
-
-        <para>Valid commands are:</para>
-
-        <itemizedlist>
-          <listitem>
-            <para><emphasis role="bold">terminate</emphasis></para>
-
-            <para>Stop the bbackupd daemon now (equivalent to kill)</para>
-          </listitem>
-
-          <listitem>
-            <para><emphasis role="bold">reload</emphasis></para>
-
-            <para>Reload the configuration file (equivalent to kill
-            -HUP)</para>
-          </listitem>
-
-          <listitem>
-            <para><emphasis role="bold">sync</emphasis></para>
-
-            <para>Connect to the server and synchronise files now</para>
-          </listitem>
-        </itemizedlist>
-
-        <para><emphasis role="bold">bbackupctl</emphasis> communicates with
-        the server via a UNIX domain socket, specified in bbackupd.conf with
-        the CommandSocket directive. This does not need to be specified, and
-        <emphasis role="bold">bbackupd</emphasis> will run without the command
-        socket, but in this case bbackupctl will not be able to communicate
-        with the daemon.</para>
-
-        <para>Some platforms cannot check the user id of the connecting
-        process, so this command socket becomes a denial of service security
-        risk. <emphasis role="bold">bbackupd</emphasis> will warn you when it
-        starts up if this is the case on your platform, and you should
-        consider removing the CommandSocket directive on these
-        platforms.</para>
-      </section>
-
-      <section>
-        <title>Using bbackupctl to perform snapshots</title>
-
-        <para><emphasis role="bold">bbackupctl</emphasis>'s main purpose is to
-        implement snapshot based backups, emulating the behaviour of
-        traditional backup software.</para>
-
-        <para>Use bbackupd-config to write a configuration file in snapshot
-        mode, and then run the following command as a cron job.</para>
-
-        <programlisting>/usr/local/bin/bbackupctl -q sync</programlisting>
-
-        <para>This will cause the backup daemon to upload all changed files
-        immediately. <emphasis role="bold">bbackupctl</emphasis> will exit
-        almost immediately, and will not output anything unless there is an
-        error.</para>
-      </section>
-
-      <section>
-        <title>Checking storage space used on the server</title>
-
-        <section>
-          <title>From the client machine</title>
-
-          <para>bbackupquery can tell you how much space is used on the server
-          for this account. Either use the usage command in interactive mode,
-          or type:</para>
-
-          <programlisting>/usr/local/bin/bbackupquery -q usage quit</programlisting>
-
-          <para>to show the space used as a single command.</para>
-        </section>
-
-        <section>
-          <title>On the server</title>
-
-          <para>bbstoreaccounts allows you to query the space used, and change
-          the limits. To display the space used on the server for an account,
-          use:</para>
-
-          <programlisting>/usr/local/bin/bbstoreaccounts info 75AB23C</programlisting>
-
-          <para>To adjust the soft and hard limits on an account, use:</para>
-
-          <programlisting>/usr/local/bin/bbstoreaccounts setlimit 75AB23C new-soft-limit new-hard-limit</programlisting>
-
-          <para>You do not need to restart the server.</para>
-        </section>
-      </section>
-
-      <section>
-        <title>Verify and restore files</title>
-
-        <para>Backups are no use unless you can restore them. The bbackupquery
-        utility does this and more.</para>
-
-        <para>You don't provide any login information to it, as it just picks
-        up the data it needs from /etc/box/bbackupd.conf. You should run it as
-        root so it can find everything it needs.</para>
-
-        <para>Full documentation can be found in the <link
-        linkend="bbackupquery.xml">bbackupquery man page</link>. It follows
-        the model of a command line sftp client quite closely.</para>
-
-        <para>TODO: Link to bbackupquery man-page here.</para>
-
-        <para>On systems where GNU readline is available (by default) it uses
-        that for command line history and editing. Otherwise it falls back to
-        very basic UNIX text entry.</para>
-
-        <para>TODO: Did the readline dependency change to editline?</para>
-
-        <section>
-          <title>Using bbackupquery</title>
-
-          <para>bbackupquery is the tool you use to verify, restore and
-          investigate your backup files with. When invoked, it simply logs
-          into the server using the certificates you have listed in
-          bbackupd.conf.</para>
-
-          <para>After you run bbackupquery, you will see a prompt, allowing
-          you to execute commands. The list (or ls) command lets you view
-          files in the store. It works much like unix ls, but with different
-          options. An example:</para>
-
-          <programlisting>[pthomsen at host bbackupquery]$ bbackupquery 
-Box Backup Query Tool  v0.10, (c) Ben Summers and contributors 2003-2006
-Using configuration file /etc/box/bbackupd.conf
-Connecting to store...
-Handshake with store...
-Login to store...
-Login complete.
-
-Type "help" for a list of commands.
-
-query > ls
-00000002 -d---- mp3
-00000003 -d---- video
-00000004 -d---- home-pthomsen
-00000005 -d---- root
-query >   </programlisting>
-
-          <para>The ls commands shows the directories that are backed up. Now
-          we'll take a closer look at the home-pthomsen directory:</para>
-
-          <programlisting>query > cd home-pthomsen
-query > ls
-00002809 f----- sample.tiff
-0000280a f----- s3.tiff
-0000280b f----- s4.tiff
-0000280d f----- s2.tiff
-0000280e f----- foo.pdf
-0000286c f----- core.28720
-0000339a -d---- .emacs.d
-0000339d -d---- bbackup-contrib
-00003437 f----- calnut.compare.txt
-0000345d f----- DSCN1783.jpg
-0000345e f----- DSCN1782.jpg
-query ></programlisting>
-
-          <para>The ls command takes the following options;</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><emphasis role="bold">-r </emphasis>-- recursively list
-              all files</para>
-            </listitem>
-
-            <listitem>
-              <para><emphasis role="bold">-d</emphasis> -- list deleted
-              files/directories</para>
-            </listitem>
-
-            <listitem>
-              <para><emphasis role="bold">-o</emphasis> -- list old versions
-              of files/directories</para>
-            </listitem>
-
-            <listitem>
-              <para><emphasis role="bold">-I</emphasis> -- don't display
-              object ID</para>
-            </listitem>
-
-            <listitem>
-              <para><emphasis role="bold">-F </emphasis>-- don't display
-              flags</para>
-            </listitem>
-
-            <listitem>
-              <para><emphasis role="bold">-t </emphasis>-- show file
-              modification time (and attr mod time if has the object has
-              attributes, ~ separated)</para>
-            </listitem>
-
-            <listitem>
-              <para><emphasis role="bold">-s</emphasis> -- show file size in
-              blocks used on server (only very approximate indication of size
-              locally)</para>
-            </listitem>
-          </itemizedlist>
-
-          <para>The flags displayed from the ls command are as follows:</para>
-
-          <simplelist>
-            <member>f = file</member>
-
-            <member>d = directory</member>
-
-            <member>X = deleted</member>
-
-            <member>o = old version</member>
-
-            <member>R = remove from server as soon as marked deleted or
-            old</member>
-
-            <member>a = has attributes stored in directory record which
-            override attributes in backup file</member>
-          </simplelist>
-        </section>
-
-        <section>
-          <title>Verify backups</title>
-
-          <para>Since this system is not yet 100% production-ready, you'll be
-          keen to verify that your backups are correct. This is easy:</para>
-
-          <programlisting>/usr/local/bin/bbackupquery "compare -a" quit</programlisting>
-
-          <para>It will report all the differences between the store and the
-          files on disc. It will download everything, so may take a while. You
-          should expect to see some differences on a typical compare, because
-          files which have recently changed are unlikely to have been uploaded
-          yet. Consider checking the timestamps on the files, or keeping a
-          record of these messages and comparing them with a future
-          verification.</para>
-
-          <para>If you would like to do a "quick" check which just downloads
-          file checksums and compares against that, then do:</para>
-
-          <programlisting>/usr/local/bin/bbackupquery "compare -aq" quit</programlisting>
-
-          <para>However, this does not check that the file attributes are
-          correct, and since the checksums are generated on the client they
-          may not reflect the data on the server if there is a problem -- the
-          server cannot check the encrypted contents. View this as a good
-          indication, rather than a definite check that your backup verifies
-          correctly.</para>
-
-          <para>You may wish to run either one as a cron job while testing
-          this system.</para>
-        </section>
-
-        <section>
-          <title>Restore backups</title>
-
-          <para>You will need the keys file created when you configured the
-          server. Without it, you cannot restore the files; this is the
-          downside of encrypted backups. However, by keeping the small keys
-          file safe, you indirectly keep your entire backup safe.</para>
-
-          <para>The first step is to recreate the configuration of the backup
-          client. It's probably best to have stored the /etc/box directory
-          with your keys. But if you're recreating it, all you really need is
-          to have got the login infomation correct (ie the certs and
-          keys).</para>
-
-          <para>Don't run bbackupd yet! It will mark all your files as deleted
-          if you do, which is not hugely bad in terms of losing data, just a
-          major inconvenience. (This assumes that you are working from a blank
-          slate. If you want to restore some files to a different location,
-          it's fine to restore while bbackupd is running, just do it outside a
-          backed up directory to make sure it doesn't start uploading the
-          restored files.)</para>
-
-          <para>Type:</para>
-
-          <programlisting>/usr/local/bin/bbackupquery</programlisting>
-
-          <para>to run it in interactive mode.</para>
-
-          <para>Type:</para>
-
-          <programlisting>list</programlisting>
-
-          <para>to see a list of the locations stored on the server.</para>
-
-          <para>For each location you want to restore, type:</para>
-
-          <programlisting>restore name-on-server local-dir-name</programlisting>
-
-          <para>The directory specified by local-dir-name must not exist yet.
-          If the restore is interrupted for any reason, repeat the above
-          steps, but add the <emphasis role="bold">-r</emphasis> flag to the
-          restore command to tell it to resume.</para>
-        </section>
-
-        <section>
-          <title>Retrieving deleted and old files</title>
-
-          <para>Box Backup makes old versions of files and files you have
-          deleted available, subject to there being enough disc space on the
-          server to hold them.</para>
-
-          <para>This is how to retrieve them using bbackupquery. Future
-          versions will make this far more user-friendly.</para>
-
-          <para>Firstly, run bbackupquery in interactive mode. It behaves in a
-          similar manner to a command line sftp client.</para>
-
-          <programlisting>/usr/local/bin/bbackupquery</programlisting>
-
-          <para>Then navigate to the directory containing the file you want,
-          using list, cd and pwd.</para>
-
-          <programlisting>query > cd home/profiles/USERNAME</programlisting>
-
-          <para>List the directory, using the "o" option to list the files
-          available without filtering out everything apart from the current
-          version. (if you want to see deleted files as well, use list
-          -odt)</para>
-
-          <programlisting>query > list -ot
-00000078 f--o- 2004-01-21T20:17:48 NTUSER.DAT
-00000079 f--o- 2004-01-21T20:17:48 ntuser.dat.LOG
-0000007a f--o- 2004-01-21T17:55:12 ntuser.ini
-0000007b f---- 2004-01-12T15:32:00 ntuser.pol
-0000007c -d--- 1970-01-01T00:00:00 Templates
-00000089 -d--- 1970-01-01T00:00:00 Start Menu
-000000a0 -d--- 1970-01-01T00:00:00 SendTo
-000000a6 -d--- 1970-01-01T00:00:00 Recent
-00000151 -d--- 1970-01-01T00:00:00 PrintHood
-00000152 -d--- 1970-01-01T00:00:00 NetHood
-00000156 -d--- 1970-01-01T00:00:00 My Documents
-0000018d -d--- 1970-01-01T00:00:00 Favorites
-00000215 -d--- 1970-01-01T00:00:00 Desktop
-00000219 -d--- 1970-01-01T00:00:00 Cookies
-0000048b -d--- 1970-01-01T00:00:00 Application Data
-000005da -d--- 1970-01-01T00:00:00 UserData
-0000437e f--o- 2004-01-24T02:45:43 NTUSER.DAT
-0000437f f--o- 2004-01-24T02:45:43 ntuser.dat.LOG
-00004380 f--o- 2004-01-23T17:01:29 ntuser.ini
-00004446 f--o- 2004-01-24T02:45:43 NTUSER.DAT
-00004447 f--o- 2004-01-24T02:45:43 ntuser.dat.LOG
-000045f4 f---- 2004-01-26T15:54:16 NTUSER.DAT
-000045f5 f---- 2004-01-26T15:54:16 ntuser.dat.LOG
-000045f6 f---- 2004-01-26T16:54:31 ntuser.ini</programlisting>
-
-          <para>(this is a listing from a server which is used as a Samba
-          server for a network of Windows clients.) You now need to fetch the
-          file using it's ID, rather than it's name. The ID is the hex number
-          in the first column. Fetch it like this:</para>
-
-          <programlisting>query > get -i 0000437e NTUSER.DAT
-Object ID 0000437e fetched successfully.</programlisting>
-
-          <para>The object is now available on your local machine. You can use
-          lcd to move around, and sh ls to list directories on your local
-          machine.</para>
-        </section>
-      </section>
-    </section>
-
-    <section>
-      <title id="FixCorruptions">Fixing corruptions of store data</title>
-
-      <para>This section gives help on what to do if your server has suffered
-      corruption, for example, after an unclean shutdown or other OS or
-      hardware problem.</para>
-
-      <para>In general, as updates to the store are made in an atomic manner,
-      the most likely result is wasted disc space. However, if really bad
-      things happen, or you believe that there is a lot of wasted space, then
-      these instructions will help to restore your data.</para>
-
-      <para>You know you will need to do something if you get strange errors,
-      and bbackupd attempts to contact the server every 100 seconds or so. Or
-      if one of the discs in your RAID disc set has failed.</para>
-
-      <para>After following these instructions, the end result will be that
-      bbackupquery will be able to see all the files which were stored on your
-      server, and retrieve them. Some of them may be in lost+found directories
-      in the root of the store (or in their original position if they have
-      been moved) but they will all be able to be retrieved.</para>
-
-      <para>After you have retrieved the files you want, bbackupd will upload
-      new versions where necessary, and after about two days, mark any
-      lost+found directories as deleted. Finally, those directories will be
-      removed by the housekeeping process on the server.</para>
-
-      <para>These instructions assume you're working on account 1234,
-      subsitute this for whatever account you're actually working on. These
-      will need to be repeated for all affected accounts.</para>
-
-      <section>
-        <title>Stop bbackupd</title>
-
-        <para>First, make sure that bbackupd is not running on the client
-        machine for the account you are going to recover. Use kill to
-        terminate it. This step is not strictly necessary, but is recommended.
-        During any checks on the account, bbackupd will be unable to log in,
-        and after they are complete, the account is marked as changed on the
-        server so bbackupd will perform a complete scan.</para>
-      </section>
-
-      <section>
-        <title>Are you using RAID on the server?</title>
-
-        <para>At the moment, the raidfile recovery tools have not been
-        written. However, when two out of three files are available, the
-        server will run succesfully, even if it complains a lot in the logs.
-        So, your best bet here is to fix the accounts, if necessary, and
-        retrieve any files you need. Then move the old store directories aside
-        (in case you need them) and start afresh with new accounts, and let
-        the clients upload all their data again. These utilities will be
-        written shortly!</para>
-
-        <para>TODO: Is this true anymore???</para>
-      </section>
-
-      <section>
-        <title>Check and fix the account</title>
-
-        <para>First, run the check utility, and see what errors it
-        reports.</para>
-
-        <programlisting>/usr/local/bin/bbstoreaccounts check 1234</programlisting>
-
-        <para>This will take some time, and use a fair bit of memory (about 16
-        bytes per file and directory). If the output looks plausible and
-        reports errors which need fixing, run it again but with the fix
-        flag:</para>
-
-        <programlisting>/usr/local/bin/bbstoreaccounts check 1234 fix</programlisting>
-
-        <para>This will fix any errors, and remove unrecoverable files.
-        Directories will be recreated if necessary.</para>
-
-        <para><emphasis role="bold">NOTE</emphasis>: The utility may adjust
-        the soft and hard limits on the account to make sure that housekeeping
-        will not remove anything -- check these afterwards.</para>
-      </section>
-
-      <section>
-        <title>Grab any files you need with bbackupquery</title>
-
-        <para>At this point, you will have a working store. Every file which
-        was on the server, and wasn't corrupt, will be available.</para>
-
-        <para>On the client, use bbackupquery to log in and examine the store.
-        (type help at the prompt for instructions). Retrieve any files you
-        need, paying attention to any lost+found directories in the root
-        directory of the store.</para>
-
-        <para>You can skip this step if you are sure that the client machine
-        is fine -- in this case, bbackupd will bring the store up to
-        date.</para>
-      </section>
-
-      <section>
-        <title>Restart bbackupd</title>
-
-        <para>Restart bbackupd on the client machine. The store account will
-        be brought up to date, and files in the wrong place will be marked for
-        eventual deletion.</para>
-      </section>
-    </section>
-
-    <section>
-      <title>Troubleshooting</title>
-
-      <para>If you are trying to fix a store after your disc has been
-      corrupted, see <link linkend="FixCorruptions">Fixing corruptions of
-      store data</link>.</para>
-
-      <para>Unfortunately, the error messages are not particularly helpful at
-      the moment. This page lists some of the common errors, and the most
-      likely causes of them.</para>
-
-      <para>When an error occurs, you will see a message like 'Exception:
-      RaidFile/OSFileError (2/8)' either on the screen or in your log files.
-      (it is recommended you set up another log file as recommended in the
-      server setup instructions.)</para>
-
-      <para>This error may not be particularly helpful, although some do have
-      extra information about probable causes. To get further information,
-      check the ExceptionCodes.txt file in the root of the distribution. This
-      file is generated by the ./configure script, so you will need to have
-      run that first.</para>
-
-      <para>Some common causes of exceptions are listed below.</para>
-
-      <para>Please email me with any other codes you get, and I will let you
-      know what they mean, and add notes here.</para>
-
-      <section>
-        <title>RaidFile (2/8)</title>
-
-        <para>This is found either when running bbstoreaccounts or in the
-        bbstored logs.</para>
-
-        <para><emphasis role="bold">Problem</emphasis>: The directories you
-        specified in the raidfile.conf are not writable by the _bbstored
-        user.</para>
-
-        <para><emphasis role="bold">Resolution</emphasis>: Change permissions
-        appropriately.</para>
-      </section>
-
-      <section>
-        <title>Common (1/2)</title>
-
-        <para>This usually occurs when the configuration files can't be
-        opened.</para>
-
-        <para><emphasis role="bold">Problem</emphasis>: You created your
-        configurations in non-standard locations, and the programs cannot find
-        them.</para>
-
-        <para><emphasis role="bold">Resolution</emphasis>: Explicitly specify
-        configuration file locations to daemons and programs. For
-        example</para>
-
-        <programlisting>/usr/local/bin/bbstored /some/other/dir/bbstored.config /usr/local/bin/bbackupquery -c /some/other/dir/bbackupd.config</programlisting>
-
-        <para>(daemons specify the name as the first argument, utility
-        programs with the -c option).</para>
-
-        <para><emphasis role="bold">Problem</emphasis>: bbstored can't find
-        the raidfile.conf file specified in bbstored.conf.</para>
-
-        <para><emphasis role="bold">Resolution</emphasis>: Edit bbstored.conf
-        to point to the correct location of this additional configuration
-        file.</para>
-      </section>
-
-      <section>
-        <title>Server (3/16)</title>
-
-        <para>The server can't listen for connections on the IP address
-        specified when you configured it.</para>
-
-        <para><emphasis role="bold">Problem</emphasis>: This probably means
-        you've specified the wrong hostname to bbstored-config -- maybe your
-        server is behind a NAT firewall?</para>
-
-        <para><emphasis role="bold">Resolution</emphasis>: Edit bbstored.conf
-        and correct the ListenAddresses line. You should replace the server
-        address with the IP address of your machine.</para>
-      </section>
-
-      <section>
-        <title>Connection (7/x)</title>
-
-        <para>These errors all relate to connections failing -- you may see
-        them during operation if there are network failures or other problems
-        between the client and server. The backup system will recover from
-        them automatically.</para>
-
-        <section>
-          <title>Connection (7/30) - SSL problems</title>
-
-          <para>Log snippet from client side:</para>
-
-          <programlisting>bbackupd[1904]: Opening connection to server xxxx.xxx...
-bbackupd[1904]: SSL err during Connect: error:xxxxxxxx:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01
-bbackupd[1904]: SSL err during Connect: error:xxxxxxxx:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check failed
-bbackupd[1904]: SSL err during Connect: error:xxxxxxxx:asn1 encoding routines:ASN1_verify:EVP lib
-bbackupd[1904]: SSL err during Connect: error:xxxxxxxx:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
-bbackupd[1904]: TRACE: Exception thrown: ConnectionException(Conn_TLSHandshakeFailed) at SocketStreamTLS.cpp(237)
-bbackupd[1904]: Exception caught (7/30), reset state and waiting to retry...</programlisting>
-
-          <para>And from the server:</para>
-
-          <programlisting>bbstored[19291]: Incoming connection from xx.xxx.xx.xxx port xxxxx (handling in child xxxxx)
-bbstored[21588]: SSL err during Accept: error:xxxxxxxx:SSL routines:SSL3_READ_BYTES:tlsv1 alert decrypt error
-bbstored[21588]: in server child, exception Connection TLSHandshakeFailed (7/30) -- terminating child</programlisting>
-
-          <para><emphasis role="bold">Solution</emphasis>: Create a new CA on
-          the server side and re-generate the client certificate. Re-creating
-          the client certificate request is not necessary.</para>
-        </section>
-      </section>
-
-      <section>
-        <title>Advanced troubleshooting</title>
-
-        <para>If this really doesn't help, then using the DEBUG builds of the
-        system will give you much more information -- a more descriptive
-        exception message and the file and line number where the error
-        occurred.</para>
-
-        <para>For example, if you are having problems with bbstoreaccounts,
-        build the debug version with:</para>
-
-        <programlisting>cd boxbackup-0.0
-cd bin/bbstoreaccounts
-make</programlisting>
-
-        <para>Within the module directories, make defaults to building the
-        debug version. At the top level, it defaults to release.</para>
-
-        <para>This will build an executable in debug/bin/bbstoreaccounts which
-        you can then use instead of the release version. It will give far more
-        useful error messages.</para>
-
-        <para>When you get an error message, use the file and line number to
-        locate where the error occurs in the code. There will be comments
-        around that line to explain why the exception happened.</para>
-
-        <para>If you are using a debug version of a daemon, these extended
-        messages are found in the log files.</para>
-      </section>
-    </section>
-  </chapter>
-
-  &__ExceptionCodes__elfjz3fu;
-
-  <appendix>
-    <title id="WORoot">Running without root</title>
-
-    <para>It is possible to run both the server and client without root
-    privileges.</para>
-
-    <section>
-      <title>Server</title>
-
-      <para>The server, by default, runs as a non-root user. However, it
-      expects to be run as root and changes user to a specified user as soon
-      as it can, simply for administrative convenience. The server uses a port
-      greater than 1024, so it doesn't need root to start.</para>
-
-      <para>To run it entirely as a non-root user, edit the bbstored.conf
-      file, and remove the User directive from the Server section. Then simply
-      run the server as your desired user.</para>
-    </section>
-
-    <section>
-      <title>Client</title>
-
-      <para>The client requires root for normal operation, since it must be
-      able to access all files to back them up. However, it is possible to run
-      the client as a non-root user, with certain limitations.</para>
-
-      <para>Follow the installation instructions, but install the executable
-      files manually to somewhere in your home directory. Then use
-      bbackupd-config to configure the daemon, but use a directory other than
-      /etc/box, probably somewhere in your home directory.</para>
-
-      <para>All directories you specify to be backed up must be readable, and
-      all files must be owned by the user and readable to that user.</para>
-
-      <para>Important: If any file or directory is not readable by this user,
-      the backup process will skip that file or directory. Keep an eye on the
-      logs for reports of this failure.</para>
-
-      <para>Non-root operation of the backup client is recommended only for
-      testing, and should not be relied on in a production environment.</para>
-    </section>
-  </appendix>
-</book>
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/adminguide.xml (from rev 674, box/trunk/documentation/boxbackup/adminguide.xml)

Deleted: box/chris/general/documentation/boxbackup/bb-book.xsl
===================================================================
--- box/trunk/documentation/boxbackup/bb-book.xsl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/bb-book.xsl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,17 +0,0 @@
-<?xml version='1.0'?> 
-<xsl:stylesheet  
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
-
-<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/> 
-
-<xsl:param name="html.stylesheet" select="'../bbdoc.css'"/>
-<xsl:param name="chunk.section.depth" select="'0'"/>
-<xsl:template name="user.header.navigation">
-<div id="header">
-<div id="logo">
-<img src="../images/bblogo.png" alt="logo" height="65" width="331" border="0" vspace="5" align="middle" /> <img src="../images/stepahead.png" alt="a step ahead in data security" width="182" height="11" hspace="10" vspace="20" border="0" align="middle" /></div>
-</div>
-</xsl:template>
-
-
-</xsl:stylesheet>

Copied: box/chris/general/documentation/boxbackup/bb-book.xsl (from rev 674, box/trunk/documentation/boxbackup/bb-book.xsl)

Deleted: box/chris/general/documentation/boxbackup/bb-man.xsl
===================================================================
--- box/trunk/documentation/boxbackup/bb-man.xsl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/bb-man.xsl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,9 +0,0 @@
-<?xml version='1.0'?> 
-<xsl:stylesheet  
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
-
-<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/> 
-
-<xsl:param name="chunk.section.depth" select="'0'"/>
-
-</xsl:stylesheet>

Copied: box/chris/general/documentation/boxbackup/bb-man.xsl (from rev 674, box/trunk/documentation/boxbackup/bb-man.xsl)

Deleted: box/chris/general/documentation/boxbackup/bb-nochunk-book.xsl
===================================================================
--- box/trunk/documentation/boxbackup/bb-nochunk-book.xsl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/bb-nochunk-book.xsl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,17 +0,0 @@
-<?xml version='1.0'?> 
-<xsl:stylesheet  
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
-
-<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> 
-
-<xsl:param name="html.stylesheet" select="'../bbdoc-man.css'"/>
-<xsl:param name="chunk.section.depth" select="'0'"/>
-<xsl:template name="user.header.content">
-<div id="header">
-<div id="logo">
-<img src="../images/bblogo.png" alt="logo" height="65" width="331" border="0" vspace="5" align="middle" /> <img src="../images/stepahead.png" alt="a step ahead in data security" width="182" height="11" hspace="10" vspace="20" border="0" align="middle" /></div>
-</div>
-</xsl:template>
-
-
-</xsl:stylesheet>

Copied: box/chris/general/documentation/boxbackup/bb-nochunk-book.xsl (from rev 674, box/trunk/documentation/boxbackup/bb-nochunk-book.xsl)

Deleted: box/chris/general/documentation/boxbackup/bbackupctl.xml
===================================================================
--- box/trunk/documentation/boxbackup/bbackupctl.xml	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/bbackupctl.xml	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry>
-  <refmeta>
-    <refentrytitle>bbackupctl</refentrytitle>
-
-    <manvolnum>1</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>bbackupctl</refname>
-
-    <refpurpose>Control the bbackupd daemon </refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis>
-      <command>bbackupctl [-q] [-c config-file] command</command>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-
-  <refsection>
-    <title>Description</title>
-
-    <para><literal>bbackupctl</literal> lets the user control the bbackupd
-    daemon on a client machine. The main use is to force a sync with the store
-    server. This is especially important if bbackupd(1) is configured to do
-    snapshot backups. In that case <literal>bbackupctl</literal> is the only
-    way to effect a backup.</para>
-
-    <para>Communication with the bbackupd daemon takes place over a local
-    socket. Some platforms (notably Windows) can't determine if the user
-    connecting on this socket has the correct credentials to execute the
-    commands, leaving a rather sizeable security hole open. To avoid this,
-    unset the CommandSocket parameter in <literal>bbackupd.conf</literal>(8).
-    That disables the command socket, so bbackupd is secure. This does,
-    however, render bbackupctl unusable.</para>
-
-    <refsection>
-      <title>Options</title>
-
-      <itemizedlist>
-        <listitem>
-          <para>-q -- quiet. Do not output status messages.</para>
-        </listitem>
-
-        <listitem>
-          <para>-c config_file -- Use a different config file from the default
-          one. Can be a full or a relative path.</para>
-        </listitem>
-      </itemizedlist>
-    </refsection>
-
-    <refsection>
-      <title>Commands</title>
-
-      <para>The following commands are available in bbackupctl:</para>
-
-      <itemizedlist>
-        <listitem>
-          <para><literal>terminate</literal></para>
-
-          <para>This command stops the bbackupd server. This is the equivalent
-          of killing (kill -KILL) the bbackupd process.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>reload</literal></para>
-
-          <para>Causes the bbackupd daemon to re-read all its configuration
-          files. Equivalent to kill -HUP.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>sync</literal></para>
-
-          <para>Initiates a backup to the store of whatever needs to be backed
-          up.</para>
-        </listitem>
-      </itemizedlist>
-    </refsection>
-  </refsection>
-
-  <refsection>
-    <title>Author</title>
-
-    <para>Ben Summers and contributors. For help, please go to the <ulink
-    url="http://boxbackup.hostworks.ca/">Wiki</ulink>, or subscribe to the Box
-    Backup <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list.</ulink></para>
-  </refsection>
-
-  <refsection>
-    <title>See Also</title>
-
-    <para><literal>bbackupd.conf(8)</literal></para>
-
-    <para>bbackupd(1)</para>
-  </refsection>
-
-  <refsection>
-    <title>Files</title>
-
-    <para><literal>bbackupctl</literal> uses the Box Backup client
-    configuration file, usually located in
-    <filename>/etc/box/bbackupd.conf</filename>. On Windows this file is
-    usually located in the installation directory, and is named
-    <filename>bbackupd.conf</filename> as well.</para>
-  </refsection>
-
-  <refsection>
-    <title>Bugs</title>
-
-    <para>If you find a bug in Box Backup, and you want to let us know about
-    it, join the <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list</ulink>, and send a description of the problem there.</para>
-
-    <para>To report a bug, give us at least the following information:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>The version of Box Backup you are running</para>
-      </listitem>
-
-      <listitem>
-        <para>The platform you are running on (Hardware and OS), for both
-        client and server.</para>
-      </listitem>
-
-      <listitem>
-        <para>If possible attach your config files (bbstored.conf,
-        bbackupd.conf) to the bug report.</para>
-      </listitem>
-
-      <listitem>
-        <para>Also attach any log file output that helps shed light on the
-        problem you are seeing.</para>
-      </listitem>
-
-      <listitem>
-        <para>And last but certainly not least, a description of what you are
-        seeing, in as much detail as possible.</para>
-      </listitem>
-    </itemizedlist>
-  </refsection>
-</refentry>
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/bbackupctl.xml (from rev 674, box/trunk/documentation/boxbackup/bbackupctl.xml)

Deleted: box/chris/general/documentation/boxbackup/bbackupquery.xml
===================================================================
--- box/trunk/documentation/boxbackup/bbackupquery.xml	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/bbackupquery.xml	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,380 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry>
-  <refmeta>
-    <refentrytitle>bbackupquery</refentrytitle>
-
-    <manvolnum>1</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>bbackupquery</refname>
-
-    <refpurpose>Box Backup store query and retrieval</refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis>
-      <command>bbackupquery [-q] [-c configfile] [commands ...]</command>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-
-  <refsection>
-    <title>Description</title>
-
-    <para><literal>bbackupquery</literal> is the main way of interacting with
-    the backup store from a Box Backup client machine. It supports both
-    interactive and batch modes of operation.</para>
-
-    <para>It can be used to reviewing the status of a client machine's backup
-    store, getting status from the store server. The main use is to retrieve
-    files and directories when needed.</para>
-
-    <para><literal>bbackupquery</literal> supports interactive and batch modes
-    of operation. Interactive mode allows for interaction with the server much
-    like an interactive FTP client.</para>
-
-    <para>Batch mode is invoked by putting commands into the invocation of
-    bbackupquery. Example:</para>
-
-    <programlisting>bbackupquery "list home-dirs" quit</programlisting>
-
-    <para>Note that commands that contain spaces are enclosed in double
-    quotes. If the <literal>quit</literal> command is ommitted, after the
-    preceding commands are completed, <literal>bbackupquery</literal> will
-    enter interactive mode.</para>
-
-    <para><emphasis role="bold">Options</emphasis></para>
-
-    <para><emphasis>-q: Quiet. Suppresses status output while
-    running.</emphasis></para>
-
-    <para><emphasis>-c configfile: Use config file, instead of the default
-    bbackupd.conf file. Can be a relative or full path.</emphasis></para>
-
-    <refsection>
-      <title>Commands</title>
-
-      <para>The commands that can be used in <literal>bbackupquery</literal>
-      are listed below.</para>
-
-      <itemizedlist>
-        <listitem>
-          <para><literal>help</literal></para>
-
-          <para>Displays the basic help message, which gives information about
-          the commands available in bbackupquery. Use the form <literal>help
-          command</literal>, to get help on a specific command.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>quit</literal></para>
-
-          <para>End the session with the store server, and quit
-          <literal>bbackupquery</literal>.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>cd [options] <directory-name></literal></para>
-
-          <para>Change directory. Options:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><literal>-d</literal> -- consider deleted directories for
-              traversal</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-o</literal> -- consider old versions of
-              directories for traversal. This option should never be useful in
-              a correctly formed store.</para>
-            </listitem>
-          </itemizedlist>
-        </listitem>
-
-        <listitem>
-          <para><literal>lcd <local-directory-name></literal></para>
-
-          <para>Change directory on the client machine. To list the contents
-          of the local directory, type <literal>sh ls</literal> (on unix-like
-          machines). TODO: Does <literal>sh dir</literal> work on
-          Windows?</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>list [options] [directory-name]</literal></para>
-
-          <para>The <literal>list</literal> (or its synonym
-          <literal>ls</literal>) command lists the content of the current, or
-          specified, directory. The options are as follows:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><literal>-r</literal> -- recursively list all files</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-d</literal> -- list deleted files and
-              directories</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-o</literal> -- list old versions of files and
-              directories</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-I</literal> -- don't display object IDs</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-F</literal> -- don't display flags</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-t</literal> -- show file modification time (and
-              attr mod time, if the object has attributes.</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-s</literal> -- show file size in blocks used on
-              server. Note that this is only a very approximate indication of
-              local file size.</para>
-            </listitem>
-          </itemizedlist>
-        </listitem>
-
-        <listitem>
-          <para><literal>ls [options] [directory-name]</literal></para>
-
-          <para>Synonym for <literal>list</literal>.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal><literal>pwd</literal></literal></para>
-
-          <para>Print current directory, always relative to the backup store
-          root.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>sh <shell command></literal></para>
-
-          <para>Everything after the sh is passed to a shell and run. All
-          output from the command is displayed in the client.</para>
-
-          <para>Example: to list the contents of the current directory on the
-          client machine type <literal>sh ls</literal>.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>compare -a</literal></para>
-
-          <para><literal>compare -l <location-name></literal></para>
-
-          <para><literal>compare <store-dir-name>
-          <local-dir-name></literal></para>
-
-          <para>Compare the current data in the store with the data on the
-          disc. Please note that all the data will be downloaded from the
-          store, so this can be a very lengthy process depending on the size
-          of the store, and the size of the part you are comparing.</para>
-
-          <para>Options:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><literal>-a</literal> -- compare all locations. </para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-l</literal> -- compare one backup location as
-              specified in the configuration file. This compares one of the
-              top level store directories.</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-c</literal> -- set return code. The return code
-              is set to the following values, if <literal>quit</literal> is
-              the next command. So, if another command is run after the
-              <literal>compare</literal>, the return code will not refer to
-              the <literal>compare</literal>. This option is very useful for
-              automating compares. Return code values:</para>
-
-              <itemizedlist>
-                <listitem>
-                  <para>1 -- no differences were found</para>
-                </listitem>
-
-                <listitem>
-                  <para>2 -- differences were found</para>
-                </listitem>
-
-                <listitem>
-                  <para>3 -- an error occured</para>
-                </listitem>
-              </itemizedlist>
-            </listitem>
-          </itemizedlist>
-        </listitem>
-
-        <listitem>
-          <para><literal>get <object-filename>
-          [<local-filename>]</literal></para>
-
-          <para><literal>get -i <object-id>
-          <local-filename></literal></para>
-
-          <para>Gets a file from the store. Object is specified as the
-          filename within the current directory. Local filename is optional.
-          Ignores old and deleted files when searching the directory for the
-          file to retrieve.</para>
-
-          <para>To get an old or deleted file, use the <literal>-i</literal>
-          option and select the object as a hex object ID (first column in
-          listing). The local filename must be specified.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>getobject <object-id>
-          <local-filename></literal></para>
-
-          <para>Gets the object specified by the object id (in hex) and stores
-          the raw contents in the local file specified. <emphasis
-          role="bold">Note</emphasis>: This is only useful for debugging as it
-          does not decode files from the stored format, which is encrypted and
-          compressed.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>restore [-d] <directory-name>
-          <local-directory-name></literal></para>
-
-          <para><literal>restore -r</literal></para>
-
-          <para>Restores a directory to the local disc. The local directory
-          specified must not exist (unless a previous restore is being
-          restarted). The root cannot be restored -- restore locations
-          individually. </para>
-
-          <para>Options:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><literal>-d</literal> -- restore a deleted
-              directory</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>-r</literal> -- resume an interrupted
-              restore</para>
-            </listitem>
-          </itemizedlist>
-
-          <para> If a restore operation is interrupted for any reason, it can
-          be restarted using the <literal>-r</literal> switch. Restore
-          progress information is saved in a file at regular intervals during
-          the restore operation to allow restarts.</para>
-        </listitem>
-
-        <listitem>
-          <para>usage</para>
-
-          <para>Show space used on the server for this account. Display
-          fields:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><literal>Used</literal>: Total amount of space used on the
-              server</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>Old files</literal>: Space used by old
-              files</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>Deleted files</literal>: Space used by deleted
-              files</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>Directories</literal>: Space used by the
-              directory structure</para>
-            </listitem>
-          </itemizedlist>
-
-          <para>When Used exceeds the soft limit, the server will start to
-          remove old and deleted files until the usage drops below the soft
-          limit. After a while, you should expect to see the usage stay at
-          just below the soft limit. You only need more space if the space
-          used by old and deleted files is near zero.</para>
-        </listitem>
-      </itemizedlist>
-    </refsection>
-  </refsection>
-
-  <refsection>
-    <title>Author</title>
-
-    <para>Ben Summers and contributors. For help, please go to the <ulink
-    url="http://boxbackup.hostworks.ca/">Wiki</ulink>, or subscribe to the Box
-    Backup <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list.</ulink></para>
-  </refsection>
-
-  <refsection>
-    <title>See Also</title>
-
-    <para>bbackupd.conf(8)</para>
-  </refsection>
-
-  <refsection>
-    <title>Files</title>
-
-    <para><literal>bbackupquery</literal> uses the Box Backup client
-    configuration file, usually located in
-    <filename>/etc/box/bbackupd.conf</filename>. On Windows this file is
-    usually located in the installation directory, and is named
-    <filename>bbackupd.conf</filename> as well.</para>
-  </refsection>
-
-  <refsection>
-    <title>Bugs</title>
-
-    <para>If you find a bug in Box Backup, and you want to let us know about
-    it, join the <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list</ulink>, and send a description of the problem there.</para>
-
-    <para>To report a bug, give us at least the following information:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>The version of Box Backup you are running</para>
-      </listitem>
-
-      <listitem>
-        <para>The platform you are running on (Hardware and OS), for both
-        client and server.</para>
-      </listitem>
-
-      <listitem>
-        <para>If possible attach your config files (bbstored.conf,
-        bbackupd.conf) to the bug report.</para>
-      </listitem>
-
-      <listitem>
-        <para>Also attach any log file output that helps shed light on the
-        problem you are seeing.</para>
-      </listitem>
-
-      <listitem>
-        <para>And last but certainly not least, a description of what you are
-        seeing, in as much detail as possible.</para>
-      </listitem>
-    </itemizedlist>
-  </refsection>
-</refentry>
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/bbackupquery.xml (from rev 674, box/trunk/documentation/boxbackup/bbackupquery.xml)

Deleted: box/chris/general/documentation/boxbackup/bbstoreaccounts.xml
===================================================================
--- box/trunk/documentation/boxbackup/bbstoreaccounts.xml	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/bbstoreaccounts.xml	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,290 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry>
-  <refmeta>
-    <refentrytitle>bbstoreaccounts</refentrytitle>
-
-    <manvolnum>1</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>bbstoreaccounts</refname>
-
-    <refpurpose>View and change account information on the store
-    server</refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis>
-      <command>bbstoreaccounts [-c configfile] command account_id
-      [command-specific arguments]</command>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-
-  <refsection>
-    <title>Description</title>
-
-    <para><literal>bbstoreaccounts</literal> is the tool for managing accounts
-    on the store server. It can be used to view information related to
-    accounts, as well as create, change and delete accounts on the store
-    server. </para>
-
-    <para><literal>bbstoreaccounts</literal> alwas takes at least 2
-    parameters: the command name and the account ID. Some commands require
-    additional parameters, and some commands have optional parameters.</para>
-
-    <refsection>
-      <title>Options</title>
-
-      <para><literal>-c <configfile></literal></para>
-
-      <para>The configfile to use for connecting to the store. Default is
-      <literal>/etc/box/bbstored.conf</literal>.</para>
-    </refsection>
-
-    <refsection>
-      <title>Commands</title>
-
-      <para>The commands tells bbstoreaccounts what action to perform.</para>
-
-      <itemizedlist>
-        <listitem>
-          <para><literal>check <account-id> [fix]</literal></para>
-
-          <para>The <literal>check</literal> command verifies the integrity of
-          the store account given, and optionally fixes any corruptions.
-          <emphasis role="bold">Note</emphasis>: It is recommended to run the
-          'simple' check command (without <literal>fix</literal>) before using
-          the <literal>fix</literal> option, This gives an overview of the
-          extent of any problems, before attempting to fix them.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>create <account-id> <discset>
-          <softlimit> <hardlimit></literal></para>
-
-          <para>Creates a new store account with the parameters given. The
-          parameters are as follows:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><literal>account-id</literal>: the ID of the new account
-              to be created. A 32-bit hexadecimal number. Cannot already exist
-              on the server.</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>discset</literal>: the disc set from
-              raidfile.conf(5) where the backups for this client will be
-              stored.. A number. Each RAID-file set has a number in
-              raidfile.conf. This number is what's used.</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>softlimit</literal>: The soft limit is the amount
-              of storage that the server will guarantee to be available for
-              storage.</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>hardlimit</literal>: The amount of storage that
-              the the server will allow, before rejecting uploads, and
-              starting to eliminate old and deleted files to get back down to
-              <literal>softlimit</literal>. </para>
-            </listitem>
-          </itemizedlist>
-        </listitem>
-
-        <listitem>
-          <para><literal>delete <account-id> [yes]</literal></para>
-
-          <para>Deletes the account from the store server completely. Removes
-          all backups and deletes all references to the account in the config
-          files.</para>
-
-          <para><literal>delete</literal> will ask for confirmation from the
-          user, when called. Using the <literal>yes</literal> flag, eliminates
-          that need. This is useful when deleting accounts from within a
-          script or some other automated means.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>info <account-id></literal></para>
-
-          <para>Display information about the given account. Example:</para>
-
-          <programlisting>[root]# bbstoreaccounts info 1
-                  Account ID: 00000001
-              Last object ID: 58757
-                 Blocks used: 9864063 (38531.50Mb)
-    Blocks used by old files: 62058 (242.41Mb)
-Blocks used by deleted files: 34025 (132.91Mb)
-  Blocks used by directories: 6679 (26.09Mb)
-            Block soft limit: 11796480 (46080.00Mb)
-            Block hard limit: 13107200 (51200.00Mb)
-         Client store marker: 1139559852000000 </programlisting>
-
-          <para>Explanation:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para>Account ID: The account ID being displayed.</para>
-            </listitem>
-
-            <listitem>
-              <para>Last Object ID: A counter that keeps track of the objects
-              that have been backed up. This number refers to the last file
-              that was written to the store. The ID is displayed as a decimal
-              number, and the object ID can be converted to a path name to a
-              file as follows: convert the number to hex (e.g.: 58757 =>
-              0xE585); The last backed up file will be (relative from the
-              client's store root): <literal>e5/o85.rfw</literal>. Longer
-              numbers infer more directories in the structure, so as an
-              example 3952697264 as the last object ID gives 0xEB995FB0, which
-              translates to a backup pathname of
-              <literal>eb/99/5f/ob0.rfw.</literal></para>
-            </listitem>
-
-            <listitem>
-              <para>Blocks used: The number of blocks used by the store. The
-              size in Mb depends on the number of blocks, as well as the block
-              size for the disc set given in
-              <literal>raidfile.conf(5)</literal>. In this case the block size
-              is 4096.</para>
-            </listitem>
-
-            <listitem>
-              <para>Blocks used by old files: The number of blocks occupied by
-              files that have newer versions in the store. This data is at
-              risk for being removed during housekeeping.</para>
-            </listitem>
-
-            <listitem>
-              <para>Blocks used by deleted files: The number of blocks used by
-              files that have been deleted on the client. Thi s data is at
-              risk for being removed during housekeeping.</para>
-            </listitem>
-
-            <listitem>
-              <para>Blocks used by directories: The number of blocks used by
-              directories in the store.</para>
-            </listitem>
-
-            <listitem>
-              <para>Block soft limit: The soft limit in blocks. The soft limit
-              is the maximum guaranteed storage space available to the
-              account. When housekeeping starts, and the old and deleted files
-              are removed, they are removed in chronological order (oldest
-              first), until the data used is less than the soft limit.</para>
-            </listitem>
-
-            <listitem>
-              <para>Block hard limit: The hard limit in blocks. The hard limit
-              is the most amount of storage the server will allow in an
-              account. Any data above this amount will be rejected.
-              Housekeeping will reduce the storage use, so more data can be
-              uploaded.</para>
-            </listitem>
-
-            <listitem>
-              <para>Client store marker: TODO What exactly is this? </para>
-            </listitem>
-          </itemizedlist>
-        </listitem>
-
-        <listitem>
-          <para><literal>setlimit <account-id> <softlimit>
-          <hardlimit></literal></para>
-
-          <para>Changes the storage space allocation for the given account. No
-          server restart is needed.</para>
-
-          <para>Parameters:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para><literal>account-id</literal>: the ID of the new account
-              to be created. A 32-bit hexadecimal number. Cannot already exist
-              on the server.</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>softlimit</literal>: The soft limit is the amount
-              of storage that the server will guarantee to be available for
-              storage.</para>
-            </listitem>
-
-            <listitem>
-              <para><literal>hardlimit</literal>: The amount of storage that
-              the the server will allow, before rejecting uploads, and
-              starting to eliminate old and deleted files to get back down to
-              <literal>softlimit</literal>.</para>
-            </listitem>
-          </itemizedlist>
-        </listitem>
-      </itemizedlist>
-    </refsection>
-  </refsection>
-
-  <refsection>
-    <title>Author</title>
-
-    <para>Ben Summers and contributors. For help, please go to the <ulink
-    url="http://boxbackup.hostworks.ca/">Wiki</ulink>, or subscribe to the Box
-    Backup <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list.</ulink></para>
-  </refsection>
-
-  <refsection>
-    <title>See Also</title>
-
-    <para><literal>bbstored.conf(5)</literal></para>
-
-    <para><literal>raidfile.conf(5)</literal></para>
-  </refsection>
-
-  <refsection>
-    <title>Files</title>
-
-    <para><literal>bbstoreaccounts</literal> uses the Box Backup server
-    configuration file, usually located in
-    <filename>/etc/box/bbstored.conf</filename>. </para>
-  </refsection>
-
-  <refsection>
-    <title>Bugs</title>
-
-    <para>If you find a bug in Box Backup, and you want to let us know about
-    it, join the <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list</ulink>, and send a description of the problem there.</para>
-
-    <para>To report a bug, give us at least the following information:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>The version of Box Backup you are running</para>
-      </listitem>
-
-      <listitem>
-        <para>The platform you are running on (Hardware and OS), for both
-        client and server.</para>
-      </listitem>
-
-      <listitem>
-        <para>If possible attach your config files (bbstored.conf,
-        bbackupd.conf) to the bug report.</para>
-      </listitem>
-
-      <listitem>
-        <para>Also attach any log file output that helps shed light on the
-        problem you are seeing.</para>
-      </listitem>
-
-      <listitem>
-        <para>And last but certainly not least, a description of what you are
-        seeing, in as much detail as possible.</para>
-      </listitem>
-    </itemizedlist>
-  </refsection>
-</refentry>
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/bbstoreaccounts.xml (from rev 674, box/trunk/documentation/boxbackup/bbstoreaccounts.xml)

Deleted: box/chris/general/documentation/boxbackup/bbstored-certs.xml
===================================================================
--- box/trunk/documentation/boxbackup/bbstored-certs.xml	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/bbstored-certs.xml	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry>
-  <refmeta>
-    <refentrytitle>bbstored-certs</refentrytitle>
-
-    <manvolnum>1</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>bbstored-certs</refname>
-
-    <refpurpose>Manage certificates for the Box Backup system</refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis>
-      <command>bbstored-certs <certs-dir> <command>
-      [<arguments>]</command>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-
-  <refsection>
-    <title>Description</title>
-
-    <para><literal>bbstored-certs</literal> creates and signs certificates for
-    use in Box Backup. It allows the user to create and sign the server keys,
-    as well as signing client keys.</para>
-
-    <para>All commands must be followed by the <literal>certs-dir</literal>,
-    which is the directory in which the certificates are stored.</para>
-
-    <refsection>
-      <title>Commands</title>
-
-      <para>There are 3 commands:</para>
-
-      <itemizedlist>
-        <listitem>
-          <para><literal>init</literal>: Create the
-          <literal>certs-dir</literal>, and generate the server keys for
-          bbstored. <literal>certs-dir</literal> cannot exist before running
-          the command.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>sign-server <servercsrfile></literal>: Sign the
-          server certificate. The <literal>servercsrfile</literal> is the file
-          generated by the <literal>init</literal> command.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>sign <clientcsrfile></literal>: Sign a client
-          certificate. The <literal>clientcsrfile</literal> is generated
-          during client setup. See <literal>bbackupd-config(1)</literal>. Send
-          the signed certificate back to the client, and install according to
-          the instructions given by <literal>bbackupd-config</literal>.</para>
-        </listitem>
-      </itemizedlist>
-    </refsection>
-  </refsection>
-
-  <refsection>
-    <title>Author</title>
-
-    <para>Ben Summers and contributors. For help, please go to the <ulink
-    url="http://boxbackup.hostworks.ca/">Wiki</ulink>, or subscribe to the Box
-    Backup <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list.</ulink></para>
-  </refsection>
-
-  <refsection>
-    <title>See Also</title>
-
-    <para><literal>bbstored-config(1)</literal></para>
-
-    <para><literal>bbstored.conf(5)</literal></para>
-
-    <para><literal>bbstoreaccounts(1)</literal></para>
-  </refsection>
-
-  <refsection>
-    <title>Files</title>
-
-    <para><literal>raidfile-config</literal> generates the raidfile.conf(5)
-    file.</para>
-  </refsection>
-
-  <refsection>
-    <title>Bugs</title>
-
-    <para>If you find a bug in Box Backup, and you want to let us know about
-    it, join the <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list</ulink>, and send a description of the problem there.</para>
-
-    <para>To report a bug, give us at least the following information:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>The version of Box Backup you are running</para>
-      </listitem>
-
-      <listitem>
-        <para>The platform you are running on (Hardware and OS), for both
-        client and server.</para>
-      </listitem>
-
-      <listitem>
-        <para>If possible attach your config files (bbstored.conf,
-        bbackupd.conf) to the bug report.</para>
-      </listitem>
-
-      <listitem>
-        <para>Also attach any log file output that helps shed light on the
-        problem you are seeing.</para>
-      </listitem>
-
-      <listitem>
-        <para>And last but certainly not least, a description of what you are
-        seeing, in as much detail as possible.</para>
-      </listitem>
-    </itemizedlist>
-  </refsection>
-</refentry>
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/bbstored-certs.xml (from rev 674, box/trunk/documentation/boxbackup/bbstored-certs.xml)

Deleted: box/chris/general/documentation/boxbackup/bbstored-config.xml
===================================================================
--- box/trunk/documentation/boxbackup/bbstored-config.xml	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/bbstored-config.xml	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry>
-  <refmeta>
-    <refentrytitle>bbstored-config</refentrytitle>
-
-    <manvolnum>1</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>bbstored-config</refname>
-
-    <refpurpose>Create config files for bbstored</refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis>
-      <command>bbstored-config <configdir> <servername>
-      <username></command>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-
-  <refsection>
-    <title>Description</title>
-
-    <para>The <literal>bbstored-config</literal> script creates config files
-    and server certificates for a bbstored instance. It takes three
-    parameters:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para><literal>configdir</literal>: The directory where config files
-        will reside. A subdirectory bbstored will be created, where several
-        config files will reside. the <literal>bbstored.conf</literal> file
-        will be created in <literal>configdir</literal>.</para>
-      </listitem>
-
-      <listitem>
-        <para><literal>servername</literal>: The name of the server that is
-        being configured. Usually the fully qualified domain name of the
-        machine in question.</para>
-      </listitem>
-
-      <listitem>
-        <para><literal>username</literal>: The name of the user that should be
-        running the bbstored processes. Recommended name:
-        _<literal>bbstored.</literal></para>
-      </listitem>
-    </itemizedlist>
-
-    <para>A valid raidfile.conf(5) must be found in configdir. Several steps
-    are taken during the run of bbstored-config:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>Configuration files are created.</para>
-      </listitem>
-
-      <listitem>
-        <para>Server certificates are created. This requires interaction from
-        the operator.</para>
-      </listitem>
-
-      <listitem>
-        <para>The raid volumes are checked, to ensure that the configuration
-        is consistent, and will work.</para>
-      </listitem>
-
-      <listitem>
-        <para>Instructions for next steps to take are shown. These steps may
-        be different for different OS platforms, so pay close attention to
-        these instructions.</para>
-      </listitem>
-    </itemizedlist>
-  </refsection>
-
-  <refsection>
-    <title>Author</title>
-
-    <para>Ben Summers and contributors. For help, please go to the <ulink
-    url="http://boxbackup.hostworks.ca/">Wiki</ulink>, or subscribe to the Box
-    Backup <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list.</ulink></para>
-  </refsection>
-
-  <refsection>
-    <title>See Also</title>
-
-    <para><literal>raidfile-config(1)</literal></para>
-
-    <para><literal>bbstored.conf(5)</literal></para>
-
-    <para><literal>raidfile.conf(5)</literal></para>
-  </refsection>
-
-  <refsection>
-    <title>Files</title>
-
-    <para><literal>bbstoreaccounts</literal> uses the Box Backup server
-    configuration file, usually located in
-    <filename>/etc/box/bbstored.conf</filename>.</para>
-  </refsection>
-
-  <refsection>
-    <title>Bugs</title>
-
-    <para>If you find a bug in Box Backup, and you want to let us know about
-    it, join the <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list</ulink>, and send a description of the problem there.</para>
-
-    <para>To report a bug, give us at least the following information:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>The version of Box Backup you are running</para>
-      </listitem>
-
-      <listitem>
-        <para>The platform you are running on (Hardware and OS), for both
-        client and server.</para>
-      </listitem>
-
-      <listitem>
-        <para>If possible attach your config files (bbstored.conf,
-        bbackupd.conf) to the bug report.</para>
-      </listitem>
-
-      <listitem>
-        <para>Also attach any log file output that helps shed light on the
-        problem you are seeing.</para>
-      </listitem>
-
-      <listitem>
-        <para>And last but certainly not least, a description of what you are
-        seeing, in as much detail as possible.</para>
-      </listitem>
-    </itemizedlist>
-  </refsection>
-</refentry>
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/bbstored-config.xml (from rev 674, box/trunk/documentation/boxbackup/bbstored-config.xml)

Deleted: box/chris/general/documentation/boxbackup/generate_except_xml.pl
===================================================================
--- box/trunk/documentation/boxbackup/generate_except_xml.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/generate_except_xml.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,74 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-open (EXCEPT, "<../../ExceptionCodes.txt") or die "Can't open ../../ExceptionCodes.txt: $!\n";
-open (DOCBOOK, ">ExceptionCodes.xml") or die "Can't open Exceptioncodes.xml for writing: $!\n";
-
-print DOCBOOK <<EOD;
-<?xml version="1.0" encoding="UTF-8"?>
-
-<appendix>
-    <title>Exception codes</title>
-
-EOD
-my $sectionName;
-my $sectionNum;
-my $sectionDesc;
-my $exceptionCode;
-my $exceptionShortDesc;
-my $exceptionLongDesc;
-while(<EXCEPT>)
-{
-    next if(m/^#/);
-    chomp;
-    if(m/^EXCEPTION TYPE (\w+) (\d+)/)
-    {
-        $sectionName = ucfirst(lc($1));
-        $sectionNum = $2;
-        if($sectionName ne "Common")
-        {
-            $sectionDesc = "the " . $sectionName;
-        }
-        else
-        {
-            $sectionDesc = "any";
-        }
-        print DOCBOOK <<EOD;
-    <section>
-      <title>$sectionName Exceptions ($sectionNum)</title>
-      
-      <para>These are exceptions that can occur in $sectionDesc module
-      of the system.</para>
-      
-      <itemizedlist>
-EOD
-    }
-    
-    # The END TYPE line
-    if(m/^END TYPE$/)
-    {
-        print DOCBOOK "      </itemizedlist>\n    </section>\n";
-    }
-    
-    # The actual exceptions
-    if(m/(\(\d+\/\d+\)) - (\w+ \w+)(?: - )?(.*)$/)
-    {
-        $exceptionCode = $1;
-        $exceptionShortDesc = $2;
-        $exceptionLongDesc = $3;
-        
-        print DOCBOOK "        <listitem>\n          <para><emphasis role=\"bold\">";
-        print DOCBOOK $exceptionCode . ": " . $exceptionShortDesc . "</emphasis>";
-        if($exceptionLongDesc ne "")
-        {
-            print DOCBOOK " -- " . $exceptionLongDesc;
-        }
-        print DOCBOOK "</para>\n        </listitem>\n";
-    }
-}
-
-print DOCBOOK "</appendix>\n";
-
-close EXCEPT;
-close DOCBOOK;
-        
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/generate_except_xml.pl (from rev 674, box/trunk/documentation/boxbackup/generate_except_xml.pl)

Copied: box/chris/general/documentation/boxbackup/html (from rev 674, box/trunk/documentation/boxbackup/html)

Deleted: box/chris/general/documentation/boxbackup/html/bbdoc-man.css
===================================================================
--- box/trunk/documentation/boxbackup/html/bbdoc-man.css	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/html/bbdoc-man.css	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,104 +0,0 @@
-body {
-	font-family: Verdana, Geneva, Arial, sans-serif;
-	background-color: #edeef3;
-        font-size: .75em;
-        line-height: 180%;
-        text-align: left;
-        margin-top: 20px;
-        margin-right: 100px;
-        margin-left: 250px;
-        position: relative;
-        width: auto; }
-	
-table {
-	font-family: Verdana, Geneva, Arial, sans-serif;
-	background-color: #edeef3;
-        font-size: 10pt;
-        line-height: 100%; }
-
-
-code {
-	font-size: 11pt; }
-
-	
-
-div.navheader {
-	font-family: Verdana, Geneva, Arial, sans-serif;
-	background-color: #edeef3; 
-        line-height: 100%; }
-       
-#header {
-	background-color: #e4e6ed;
-	text-align: left;
-	padding-top: 10px;
-        margin-right: -100px;
-        margin-left: -250px;
-	top: 20px;
-	border-top: 1px solid #c4c4d5;
-	border-bottom: 1px solid white }
-	
-#logo {
-	position: relative; 
-	margin-left: 200px }
-	
-	
-#page {
-	font-size: .75em;
-	line-height: 180%;
-	text-align: left;
-	margin-top: 50px;
-	margin-right: 100px;
-	margin-left: 250px;
-	position: relative;
-	width: auto }
-
-#disc {    }
-	
-.informaltable td,tr {font-size: 1em;
-	line-height: 140%;
-	text-align: left;
-	background-color: #e4e6ed;
-	padding: 4px }
-	
-tr,td {font-size: 1em;
-	line-height: 100%;
-	background-color: #edeef3; }
-	
-pre, tt { font-size: 1.3em; 
-	color: #088;
-	letter-spacing: 1px;
-	word-spacing: 2px}
-	
-h1 {
-	color: #c00;
-	font-size: 16pt;
-	margin-bottom: 2em;
-	margin-left: -50px }
-	
-h2 {
-	color: #324e95;
-	font-size: 12pt;
-	margin-top: 2em;
-	margin-left: -50px }
-	
-h3 {
-	color: #324e95;
-	font-size: 10pt;
-	margin-top: 2em;
-	margin-left: -50px }
-	
-dt { font-weight: bold }
-	
-a:link {
-	color: #324e95;
-	text-decoration: none;
-	background-color: transparent }
-	
-a:visited {
-	color: #90c;
-	text-decoration: none }
-	
-a:hover {
-	color: #c00;
-	text-decoration: underline;
-	background-color: transparent }

Copied: box/chris/general/documentation/boxbackup/html/bbdoc-man.css (from rev 674, box/trunk/documentation/boxbackup/html/bbdoc-man.css)

Deleted: box/chris/general/documentation/boxbackup/html/bbdoc.css
===================================================================
--- box/trunk/documentation/boxbackup/html/bbdoc.css	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/html/bbdoc.css	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,112 +0,0 @@
-body {
-	font-family: Verdana, Geneva, Arial, sans-serif;
-	background-color: #edeef3;
-        font-size: .75em;
-        line-height: 180%;
-        text-align: left;
-        margin-top: 20px;
-        margin-right: 100px;
-        margin-left: 250px;
-        position: relative;
-        width: auto; }
-	
-table {
-	font-family: Verdana, Geneva, Arial, sans-serif;
-	background-color: #edeef3;
-        font-size: 10pt;
-        line-height: 100%; }
-
-
-	
-
-div.navheader {
-	font-family: Verdana, Geneva, Arial, sans-serif;
-	background-color: #edeef3; 
-        line-height: 100%; }
-       
-#header {
-	background-color: #e4e6ed;
-	text-align: left;
-	padding-top: 10px;
-        margin-right: -100px;
-        margin-left: -250px;
-	top: 20px;
-	border-top: 1px solid #c4c4d5;
-	border-bottom: 1px solid white }
-	
-#logo {
-	position: relative; 
-	margin-left: 200px }
-	
-	
-#page {
-	font-size: .75em;
-	line-height: 180%;
-	text-align: left;
-	margin-top: 50px;
-	margin-right: 100px;
-	margin-left: 250px;
-	position: relative;
-	width: auto }
-
-#disc {    }
-	
-.informaltable td,tr {font-size: 1em;
-	line-height: 140%;
-	text-align: left;
-	background-color: #e4e6ed;
-	padding: 4px }
-	
-tr,td {font-size: 1em;
-	line-height: 100%;
-	background-color: #edeef3; }
-	
-pre, tt { font-size: 1.3em; 
-	color: #088;
-	letter-spacing: 1px;
-	word-spacing: 2px}
-	
-h1 {
-	color: #c00;
-	font-size: 16pt;
-	margin-bottom: 2em;
-	margin-left: -50px }
-	
-h2 {
-	color: #324e95;
-	font-size: 12pt;
-	margin-top: 2em;
-	margin-left: -50px }
-	
-h3 {
-	color: #324e95;
-	font-size: 10pt;
-	margin-top: 2em;
-	margin-left: -50px }
-	
-dt { font-weight: bold }
-	
-ul {
-	list-style-image: url(images/arrow.png) }
-	
-ul li {
-	background-color: #e4e6ed;
-	margin: 1em 6em 1em -2em;
-	padding: 0.2em 0.5em 0.2em 1em;
-	border-style: solid;
-	border-width: 1px;
-	border-color: #c4c4d5 #fff #fff #c4c4d5 }
-	
-a:link {
-	color: #324e95;
-	text-decoration: none;
-	background-color: transparent }
-	
-a:visited {
-	color: #90c;
-	text-decoration: none }
-	
-a:hover {
-	color: #c00;
-	text-decoration: underline;
-	background-color: transparent }

Copied: box/chris/general/documentation/boxbackup/html/bbdoc.css (from rev 674, box/trunk/documentation/boxbackup/html/bbdoc.css)

Copied: box/chris/general/documentation/boxbackup/html/images (from rev 674, box/trunk/documentation/boxbackup/html/images)

Deleted: box/chris/general/documentation/boxbackup/html/images/arrow.png
===================================================================
(Binary files differ)

Copied: box/chris/general/documentation/boxbackup/html/images/arrow.png (from rev 674, box/trunk/documentation/boxbackup/html/images/arrow.png)

Deleted: box/chris/general/documentation/boxbackup/html/images/bblogo.png
===================================================================
(Binary files differ)

Copied: box/chris/general/documentation/boxbackup/html/images/bblogo.png (from rev 674, box/trunk/documentation/boxbackup/html/images/bblogo.png)

Deleted: box/chris/general/documentation/boxbackup/html/images/stepahead.png
===================================================================
(Binary files differ)

Copied: box/chris/general/documentation/boxbackup/html/images/stepahead.png (from rev 674, box/trunk/documentation/boxbackup/html/images/stepahead.png)

Deleted: box/chris/general/documentation/boxbackup/instguide.xml
===================================================================
--- box/trunk/documentation/boxbackup/instguide.xml	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/instguide.xml	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,750 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<book>
-  <title>Box Backup Build and Installation Guide</title>
-
-  <preface>
-    <title>License</title>
-
-    <para>Copyright (c) <YEAR>, <OWNER></para>
-
-    <para>All rights reserved.</para>
-
-    <para>Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are
-    met:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>Redistributions of source code must retain the above copyright
-        notice, this list of conditions and the following disclaimer.</para>
-      </listitem>
-
-      <listitem>
-        <para>Redistributions in binary form must reproduce the above
-        copyright notice, this list of conditions and the following disclaimer
-        in the documentation and/or other materials provided with the
-        distribution.</para>
-      </listitem>
-
-      <listitem>
-        <para>Neither the name of the <ORGANIZATION> nor the names of
-        its contributors may be used to endorse or promote products derived
-        from this software without specific prior written permission</para>
-      </listitem>
-    </itemizedlist>
-
-    <para>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</para>
-  </preface>
-
-  <chapter>
-    <title>Introduction</title>
-
-    <para>The backup daemon, bbackupd, runs on all machines to be backed up.
-    The store server daemon, bbstored runs on a central server. Data is sent
-    to the store server, which stores all data on local filesystems, that is,
-    only on local hard drives. Tape or other archive media is not used.</para>
-
-    <para>The system is designed to be easy to set up and run, and cheap to
-    use. Once set up, there should be no need for user or administrative
-    intervention, apart from usual system maintenance.</para>
-
-    <section>
-      <title>Client daemon</title>
-
-      <para>bbackupd is configured with a list of directories to back up. It
-      has a lazy approach to backing up data. Every so often, the directories
-      are scanned, and new data is uploaded to the server. This new data must
-      be over a set age before it is uploaded. This prevents rapid revisions
-      of a file resulting in many uploads of the same file in a short period
-      of time.</para>
-
-      <para>It can also operate in a snapshot mode, which behaves like
-      traditional backup software. When instructed by an external bbackupctl
-      program, it will upload all changed files to the server.</para>
-
-      <para>The daemon is always running, although sleeping most of the time.
-      In lazy mode, it is completely self contained -- scripts running under
-      cron jobs are not used. The objective is to keep files backed up, not to
-      make snapshots of the filesystem at particular points in time
-      available.</para>
-
-      <para>If an old version of the file is present on the server, a modified
-      version of the rsync algorithm is used to upload only the changed
-      portions of the file.</para>
-
-      <para>After a new version is uploaded, the old version is still
-      available (subject to disc space on the server). Similarly, a deleted
-      file is still available. The only limit to their availability is space
-      allocated to this account on the server</para>
-
-      <para>Future versions will add the ability to mark the current state of
-      files on the server, and restore from this mark. This will emulate the
-      changing of tapes in a tape backup system.</para>
-
-      <section>
-        <title>Restoration</title>
-
-        <para>Restoring files is performed using a query tool, bbackupquery.
-        This can be used to restore entire directories, or as an 'FTP-like'
-        tool to list and retrieve individual files. Old versions and deleted
-        files can be retrieved using this tool for as long as they are kept on
-        the server.</para>
-      </section>
-
-      <section>
-        <title>Client Resource Usage</title>
-
-        <para>bbackupd uses only a minimal amount of disc space to store
-        records on uploaded files -- less than 32 bytes per directory and file
-        over a set size threshold. However, it minimises the amount of queries
-        it must make to the server by storing, in memory, a data structure
-        which allows it to determine what data is new. It does not need to
-        store a record of all files, essentially just the directory names and
-        last modification times. This is not a huge amount of memory.</para>
-
-        <para>If there are no changes to the directories, then the client will
-        not even connect to the server.</para>
-      </section>
-    </section>
-
-    <section>
-      <title>Security</title>
-
-      <para>Box Backup is designed to be secure in several ways. The data
-      stored on the backup store server is encrypted using secret-key
-      cryptography. Additionally, the transport layer is encrypted using TLS,
-      to ensure that the communications can't be snooped.</para>
-
-      <section>
-        <title>Encryption</title>
-
-        <para>The files, directories, filenames and file attributes are all
-        encrypted. By examining the stored files on the server, it is only
-        possible to determine the approximate sizes of a files and the tree
-        structure of the disc (not names, just number of files and
-        subdirectories in a directory). By monitoring the actions performed by
-        a client, it is possible to determine the frequency and approximate
-        scope of changes to files and directories.</para>
-
-        <para>The connections between the server and client are encrypted
-        using TLS (latest version of SSL). Traffic analysis is possible to
-        some degree, but limited in usefulness.</para>
-
-        <para>An attacker will not be able to recover the backed up data
-        without the encryption keys. Of course, you won't be able to recover
-        your files without the keys either, so you must make a conventional,
-        secure, backup of these keys.</para>
-      </section>
-
-      <section>
-        <title>Authentication</title>
-
-        <para>SSL certificates are used to authenticate clients. UNIX user
-        accounts are not used to minimise the dependence on the configuration
-        of the operating system hosting the server.</para>
-
-        <para>A script is provided to run the necessary certification
-        authority with minimal effort.</para>
-      </section>
-    </section>
-
-    <section>
-      <title>Server daemon</title>
-
-      <para>The server daemon is designed to be simple to deploy, and run on
-      the cheapest hardware possible. To avoid the necessity to use expensive
-      hardware RAID or software RAID with complex setup, it (optionally)
-      stores files using RAID techniques.</para>
-
-      <para>It does not need to run as a privileged user.</para>
-
-      <para>Each account has a set amount of disc space allocated, with a soft
-      and a hard limit. If the account exceeds the soft limit, a housekeeping
-      process will start deleting old versions and deleted files to reduce the
-      space used to below the soft limit. If the backup client attempts to
-      upload a file which causes the store to exceed the hard limit, the
-      upload will be refused.</para>
-    </section>
-  </chapter>
-
-  <chapter>
-    <title>Building and installing</title>
-
-    <section>
-      <title>Before you start</title>
-
-      <para>Firstly, check that all the clocks on your clients, servers and
-      signing machines are accurate and in sync. A disagreement in time
-      between a client and a server is the biggest cause of installation
-      difficulties, as the times in the generated certificates will cause
-      login failures if the start date is in the future.</para>
-    </section>
-
-    <section>
-      <title>Box Backup compile</title>
-
-      <para>In the following instructions, replace 0.00 with the actual
-      version number of the archive you have downloaded.</para>
-
-      <para>For help building on Windows, see the <link linkend="AppB">Windows
-      Compile Appendix</link>. And if you want to build a Linux RPM, <link
-      linkend="AppC">look here</link>.</para>
-
-      <para>You need the latest version of OpenSSL, as some of the extra APIs
-      it provides are required. You should have this anyway, as earlier
-      versions have security flaws. (If you have an earlier version installed,
-      the configuration script will give you instructions on enabling
-      experimental support for older versions.)</para>
-
-      <para>See <link linkend="AppA">OpenSSL notes</link> for more information
-      on OpenSSL issues.</para>
-
-      <para>There are some notes in the archive about compiling on various
-      platforms within the boxbackup-0.00 directory -- read them first. For
-      example, if you are compiling under Linux, look for LINUX.txt as
-      boxbackup-0.00/LINUX.txt after untaring the archive.</para>
-
-      <para>Download the archive, then in that directory type</para>
-
-      <programlisting>tar xvzf boxbackup-0.00.tgz
-cd boxbackup-0.00
-./configure
-make</programlisting>
-
-      <para>The server and client will be built and packaged up for
-      installation on this machine, or ready to be transferred as tar files to
-      another machine for installation.</para>
-
-      <para>This builds two parcels of binaries and scripts, 'backup-client'
-      and 'backup-server'. The generated installation scripts assumes you want
-      everything installed in <emphasis
-      role="bold">/usr/local/bin</emphasis></para>
-
-      <para>Optionally, type <emphasis role="bold">make test</emphasis> to run
-      all the tests.</para>
-    </section>
-
-    <section>
-      <title>Local installation</title>
-
-      <para>Type <emphasis role="bold">make install-backup-client</emphasis>
-      to install the backup client.</para>
-
-      <para>Type <emphasis role="bold">make install-backup-server</emphasis>
-      to install the backup server.</para>
-    </section>
-
-    <section>
-      <title>Remote installation</title>
-
-      <para>In the parcels directory, there are tar files for each parcel. The
-      name reflects the version and platform you have built it for.</para>
-
-      <para>Transfer this tar file to the remote server, and unpack it, then
-      run the install script. For example:</para>
-
-      <programlisting>tar xvzf boxbackup-0.00-backup-server-OpenBSD.tgz
-cd boxbackup-0.00-backup-server-OpenBSD
-./install-backup-server</programlisting>
-    </section>
-
-    <section>
-      <title>Configure options</title>
-
-      <para>You can use arguments to the configure script to adjust the
-      compile and link lines in the generated Makefiles, should this be
-      necessary for your platform. The configure script takes the usual GNU
-      autoconf arguments, a full list of which can be obtained with <emphasis
-      role="bold">--help</emphasis>. Additional options for Box Backup
-      include:</para>
-
-      <informaltable>
-        <tgroup cols="2">
-          <tbody>
-            <row>
-              <entry char="-">--enable-gnu-readline</entry>
-
-              <entry>Use GNU readline if present. Linking Box Backup against
-              GNU readline may create licence implications if you then
-              distribute the binaries. libeditline is also supported as a safe
-              alternative, and is used by default if available.</entry>
-            </row>
-
-            <row>
-              <entry>--disable-largefile</entry>
-
-              <entry>Omit support for large files</entry>
-            </row>
-
-            <row>
-              <entry>--with-bdb-dir=DIR</entry>
-
-              <entry>Specify Berkeley DB location</entry>
-            </row>
-
-            <row>
-              <entry>--with-random=FILE</entry>
-
-              <entry>Use FILE as random number seed (normally
-              auto-detected)</entry>
-            </row>
-
-            <row>
-              <entry>--with-tmp-dir=DIR</entry>
-
-              <entry>Directory for temporary files (normally /tmp)</entry>
-            </row>
-          </tbody>
-        </tgroup>
-      </informaltable>
-
-      <para>See <link linkend="AppA">OpenSSL notes</link> for the OpenSSL
-      specific options.</para>
-    </section>
-
-    <section>
-      <title>Tests</title>
-
-      <para>There are a number of unit tests provided. To compile and run one
-      type:</para>
-
-      <programlisting>./runtest.pl bbackupd release
-./runtest.pl common debug
-./runtest.pl ALL</programlisting>
-
-      <para>The runtest.pl script will compile and run the test. The first
-      argument is the test name, and the second the type of build. Use ALL as
-      a test name to run all the tests.</para>
-
-      <para>The output from the tests is slightly muddled using this script.
-      If you're developing, porting or trying out new things, it might be
-      better to use the following scheme:</para>
-
-      <programlisting>cd test/bbackupd
-make
-cd ../../debug/test/bbackupd
-./t</programlisting>
-
-      <para>or in release mode...</para>
-
-      <programlisting>cd test/bbackupd
-make -D RELEASE
-cd ../../release/test/bbackupd
-./t</programlisting>
-
-      <para>(use RELEASE=1 with GNU make)</para>
-
-      <para>I tend to use two windows, one for compilation, and one for
-      running tests.</para>
-    </section>
-  </chapter>
-
-  <appendix>
-    <title id="AppA">Box Backup and SSL</title>
-
-    <section>
-      <title>General notes</title>
-
-      <para>Ideally, you need to use version 0.9.7 or later of OpenSSL. If
-      this is installed on your system by default (and it is on most recent
-      releases of UNIX like OSes) then everything should just work.</para>
-
-      <para>However, if it isn't, you have a few options.</para>
-
-      <section>
-        <title>Upgrade your installation</title>
-
-        <para>The best option is to upgrade your installation to use 0.9.7.
-        Hopefully your package manager will make this easy for you. This may
-        require reinstallation of lots of software which depends on OpenSSL,
-        so may not be ideal.</para>
-
-        <para>(But as there have been a few security flaws in OpenSSL
-        recently, you probably want to upgrade it anyway.)</para>
-      </section>
-
-      <section>
-        <title>Install another OpenSSL</title>
-
-        <para>The second best option is to install another copy. If you
-        download and install from source, it will probably install into
-        /usr/local/ssl. You can then configure Box Backup to use it
-        using:</para>
-
-        <programlisting>./configure --with-ssl-headers=/usr/local/ssl/include --with-ssl-lib=/usr/local/ssl/lib</programlisting>
-
-        <para>which will set up the various includes and libraries for
-        you.</para>
-
-        <para>The configuration scripts may be a problem, depending on your
-        installation. See below for more information.</para>
-      </section>
-
-      <section>
-        <title>Use the old version of OpenSSL</title>
-
-        <para>If you have an old version installed, the configuration script
-        will give you instructions on how to enable support for older
-        versions. Read the warnings, and please, whatever you do, don't
-        release binary packages or ports which enable this option.</para>
-
-        <para>You may have issues with the configuration scripts, see
-        below.</para>
-      </section>
-    </section>
-
-    <section>
-      <title>If you have problems with the config scripts</title>
-
-      <para>If you get OpenSSL related errors with the configuration scripts,
-      there are two things to check:</para>
-
-      <itemizedlist>
-        <listitem>
-          <para>The bin directory within your OpenSSL directory is in the path
-          (if you have installed another version)</para>
-        </listitem>
-
-        <listitem>
-          <para>You have an openssl.cnf file which works and can be
-          found.</para>
-        </listitem>
-      </itemizedlist>
-
-      <section>
-        <title>OpenSSL config file</title>
-
-        <para>You need to have an openssl.cnf file. The default will generally
-        work well (see example at end). Make sure the openssl utility can find
-        it, either set the OPENSSL_CONF environment variable, or install it
-        into the location that is mentioned in the error messages.</para>
-
-        <para>Example OpenSSL config file:</para>
-
-        <programlisting id="openssl.cnf" xreflabel="openssl.cnf">#
-# OpenSSL example configuration file.
-# This is mostly being used for generation of certificate requests.
-# 
-
-RANDFILE                = /dev/arandom
-
-####################################################################
-[ req ]
-default_bits            = 1024
-default_keyfile         = privkey.pem
-distinguished_name      = req_distinguished_name
-attributes              = req_attributes
-
-[ req_distinguished_name ]
-countryName                     = Country Name (2 letter code)
-#countryName_default            = AU
-countryName_min                 = 2
-countryName_max                 = 2
-
-stateOrProvinceName             = State or Province Name (full name)
-#stateOrProvinceName_default    = Some-State
-
-localityName                    = Locality Name (eg, city)
-
-0.organizationName              = Organization Name (eg, company)
-#0.organizationName_default     = Internet Widgits Pty Ltd
-
-# we can do this but it is not needed normally :-)
-#1.organizationName             = Second Organization Name (eg, company)
-#1.organizationName_default     = CryptSoft Pty Ltd
-
-organizationalUnitName          = Organizational Unit Name (eg, section)
-#organizationalUnitName_default =
-
-commonName                      = Common Name (eg, fully qualified host name)
-commonName_max                  = 64
-
-emailAddress                    = Email Address
-emailAddress_max                = 64
-
-[ req_attributes ]
-challengePassword               = A challenge password
-challengePassword_min           = 4
-challengePassword_max           = 20
-
-unstructuredName                = An optional company name
-
-[ x509v3_extensions ]
-
-nsCaRevocationUrl               = http://www.cryptsoft.com/ca-crl.pem
-nsComment                       = "This is a comment"
-
-# under ASN.1, the 0 bit would be encoded as 80
-nsCertType                      = 0x40</programlisting>
-      </section>
-    </section>
-  </appendix>
-
-  <appendix>
-    <title id="AppB">Compiling bbackupd on Windows using Visual C++</title>
-
-    <para>This Appendix explains how to build the bbackupd daemon for Windows
-    using the Visual C++ compiler.</para>
-
-    <para>If you have any problems following these instructions, please sign
-    up to the <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    lis</ulink>t and report them to us, or send an email to <ulink
-    url="mailto:bbwiki at qwirx.com">Chris Wilson</ulink>. Thanks!</para>
-
-    <para><emphasis role="bold">Note</emphasis>: bbstored will not be built
-    with this process. bbstored is not currently supported on Windows. There
-    are no plans for bbstored support on Windows.</para>
-
-    <section>
-      <title>Tools</title>
-
-      <para>You will need quite a bit of software to make this work. All of it
-      is available for free on the Internet, although Visual C++ Express has
-      license restrictions and a time limit.</para>
-
-      <section>
-        <title>Visual C++</title>
-
-        <para>Microsoft's Visual C++ compiler and development environment are
-        part of their commercial product <ulink
-        url="http://msdn.microsoft.com/vstudio/">Visual Studio</ulink>. Visual
-        Studio 2005 is supported, and 2003 should work as well.</para>
-
-        <para>You can also <ulink
-        url="http://msdn.microsoft.com/vstudio/express/visualc/download/">download</ulink>
-        a free copy of Visual C++ 2005 Express. This copy must be registered
-        (activated) within 30 days, and is free for one year.</para>
-
-        <para>You will need the <ulink
-        url="http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/">Platform
-        SDK</ulink> to allow you to compile Windows applications.</para>
-      </section>
-
-      <section>
-        <title>Perl</title>
-
-        <para>Download and install <ulink
-        url="http://www.activestate.com/Products/ActivePerl/">ActivePerl for
-        Windows</ulink>, which you can probably find <ulink
-        url="http://downloads.activestate.com/ActivePerl/Windows/5.6/ActivePerl-5.6.1.638-MSWin32-x86.msi">here</ulink>.</para>
-      </section>
-
-      <section>
-        <title>Libraries</title>
-
-        <para>You will need to download and install several libraries. They
-        must all be built in the same directory, to be able to link
-        properly.</para>
-
-        <para>Choose a directory where you will unpack and compile OpenSSL,
-        Zlib and Box Backup. We will call this the base directory. An example
-        might be:</para>
-
-        <programlisting>C:\Documents and Settings\Your Username\Desktop\Box</programlisting>
-
-        <para>Make sure you know the full path to this directory.</para>
-
-        <section>
-          <title>OpenSSL</title>
-
-          <para>You will need to compile OpenSSL using Visual C++. The latest
-          release at this time, OpenSSL 0.9.8a, does not compile with Visual
-          C++ 2005 out of the box, so you need <ulink
-          url="http://bbdev.fluffy.co.uk/svn/box/chris/win32/support/openssl-0.9.8a-vc2005.zip">a
-          patched version</ulink>. The <ulink
-          url="http://www.openssl.org/source/openssl-0.9.8a.tar.gz">original
-          source</ulink> and <ulink
-          url="http://bbdev.fluffy.co.uk/svn/box/chris/win32/support/openssl-0.9.8a-win32fix.patch">patch</ulink>
-          are also available.</para>
-
-          <para>To compile OpenSSL:</para>
-
-          <itemizedlist>
-            <listitem>
-              <para>Use a Windows unzipper such as <ulink
-              url="http://www.winzip.com/">WinZip (free trial)</ulink> to
-              extract the <emphasis
-              role="bold">openssl-0.9.8a-vc2005.tar.gz</emphasis> archive,
-              which you just downloaded, into the base directory.</para>
-            </listitem>
-
-            <listitem>
-              <para>Rename the folder from <emphasis
-              role="bold">openssl-0.9.8a-vc2005</emphasis> to <emphasis
-              role="bold">openssl</emphasis></para>
-            </listitem>
-
-            <listitem>
-              <para>Open a command shell (run <emphasis
-              role="bold">cmd.exe</emphasis>) and <emphasis
-              role="bold">cd</emphasis> to the openssl directory</para>
-            </listitem>
-
-            <listitem>
-              <para>Run the following commands:</para>
-
-              <programlisting>perl Configure VC-WIN32
-ms\do_ms
-"c:\program files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
-nmake -f ms\ntdll.mak</programlisting>
-            </listitem>
-          </itemizedlist>
-        </section>
-
-        <section>
-          <title>Zlib</title>
-
-          <para>You will need to download the <ulink
-          url="http://www.zlib.net/zlib123-dll.zip">Zlib compiled DLL</ulink>.
-          Create a directory called <emphasis role="bold">zlib</emphasis> in
-          the base directory, and unzip the file you just downloaded into that
-          directory. You don't need to compile anything.</para>
-        </section>
-      </section>
-
-      <section>
-        <title>Download Box Backup</title>
-
-        <para>The first version of Box Backup that's known to compile and with
-        Visual C++ 2005 is available on the <ulink
-        url="http://bbdev.fluffy.co.uk/svn/box/chris/win32/vc2005-compile-fixes/">Subversion
-        server</ulink>. However, this version has not been extensively tested
-        and may be out of date.</para>
-
-        <para>The changes are expected to be merged into the <ulink
-        url="http://bbdev.fluffy.co.uk/svn/box/trunk">Subversion trunk</ulink>
-        at some point, and this page should then be updated. If in doubt,
-        please sign up to the <ulink
-        url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-        list</ulink> and ask us.</para>
-
-        <para>To get the source code out of Subversion you will need a <ulink
-        url="http://subversion.tigris.org/files/documents/15/25364/svn-1.2.3-setup.exe">Subversion
-        client for Windows</ulink>. After installing it, open a new command
-        prompt, go to the base directory, and type:</para>
-
-        <programlisting>svn co http://bbdev.fluffy.co.uk/svn/box/chris/win32/vc2005-compile-fixes/ boxbackup</programlisting>
-
-        <para>This should create a directory called <emphasis
-        role="bold">boxbackup</emphasis> inside the base directory.</para>
-      </section>
-
-      <section>
-        <title>Configure Box Backup</title>
-
-        <para>Open a command prompt, change to the base directory then
-        <emphasis role="bold">boxbackup</emphasis>, and run <emphasis
-        role="bold">win32.bat</emphasis> to configure the sources. Otherwise,
-        Visual C++ will complain about missing files whose names start with
-        <emphasis role="bold">autogen</emphasis>, and missing <emphasis
-        role="bold">config.h</emphasis>.</para>
-      </section>
-
-      <section>
-        <title>Compile Box Backup</title>
-
-        <para>Open Visual C++. Choose "File/Open/Project", navigate to the
-        base directory, then to <emphasis
-        role="bold">boxbackup\infrastructure\msvc\2005</emphasis> (or
-        <emphasis role="bold">2003</emphasis> if using Visual Studio 2003),
-        and open any project or solution file in that directory.</para>
-
-        <para>Press F7 to compile Box Backup. If the compilation is
-        successful, <emphasis
-        role="bold">boxbackup\Debug\bbackupd.exe</emphasis> will be
-        created.</para>
-      </section>
-
-      <section>
-        <title>Install Box Backup</title>
-
-        <para>Create the destination directory, <emphasis
-        role="bold">C:\Program Files\Box Backup\bbackupd</emphasis>.</para>
-
-        <para>Write a configuration file, keys and certificate on a Unix
-        machine, and copy them into the <emphasis role="bold">Box
-        Backup</emphasis> directory, together with the following files from
-        the base directory:</para>
-
-        <itemizedlist>
-          <listitem>
-            <para>boxbackup\Debug\bbackupd.exe</para>
-          </listitem>
-
-          <listitem>
-            <para>openssl\out32dll\libeay32.dll</para>
-          </listitem>
-
-          <listitem>
-            <para>openssl\out32dll\ssleay32.dll</para>
-          </listitem>
-
-          <listitem>
-            <para>zlib\zlib1.dll</para>
-          </listitem>
-        </itemizedlist>
-
-        <para>Ensure that the user running Box Backup can read from the
-        <emphasis role="bold">Box Backup</emphasis> directory, and write to
-        the <emphasis role="bold">bbackupd</emphasis> directory inside
-        it.</para>
-
-        <para>Run Box Backup by double-clicking on it, and check that it
-        connects to the server. If the window opens and closes immediately,
-        it's probably due to a problem with the configuration file - check the
-        Windows Event Viewer for details.</para>
-      </section>
-
-      <section>
-        <title>Windows Service</title>
-
-        <para>Box Backup can also run as a Windows service, in which case it
-        will be automatically started at boot time in the background. To
-        install this, open a command prompt, and run:</para>
-
-        <programlisting>cd "C:\Program Files\Box Backup"
-bbackupd.exe -i</programlisting>
-
-        <para>This should output Box Backup service installed.</para>
-      </section>
-    </section>
-  </appendix>
-
-  <appendix>
-    <title id="AppC">Compilation and installation by building an RPM on
-    Linux</title>
-
-    <para>It is very easy to build an RPM of Box Backup on Linux platforms.
-    This should work on all Red Hat distributions (including Fedora), SuSE,
-    and probably others too.</para>
-
-    <para>Given that you have the correct development packages installed
-    simply execute this command (replacing the version number):</para>
-
-    <programlisting>rpmbuild -ta boxbackup-0.00.tgz</programlisting>
-
-    <para>rpmbuild will report where the packages have been written to, and
-    these can be installed in the normal manner.</para>
-
-    <para>If you have never built an RPM before you should set up a convenient
-    build area as described in the <ulink
-    url="http://www.rpm.org/max-rpm/s1-rpm-anywhere-different-build-area.html">RPM
-    book</ulink>.</para>
-
-    <para>If you wish to customise the package you can find the spec file in
-    the contrib/rpm directory.</para>
-  </appendix>
-</book>
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/instguide.xml (from rev 674, box/trunk/documentation/boxbackup/instguide.xml)

Deleted: box/chris/general/documentation/boxbackup/raidfile-config.xml
===================================================================
--- box/trunk/documentation/boxbackup/raidfile-config.xml	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/documentation/boxbackup/raidfile-config.xml	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry>
-  <refmeta>
-    <refentrytitle>raidfile-config</refentrytitle>
-
-    <manvolnum>1</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>raidfile-config</refname>
-
-    <refpurpose>Configure Box Backup's RAID files</refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis>
-      <command>raidfile-config <configdir> <blocksize>
-      <dir1> [<dir2> <dir3>]</command>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-
-  <refsection>
-    <title>Description</title>
-
-    <para>raidfile-config creates a raidfile.conf file for Box Backup. This
-    file holds information about the directories used to store backups in. Box
-    Backup supports userland RAID, in a restricted RAID5 configuration, where
-    3 and only 3 'drives' are supported. You can read more about RAID5 (and
-    other RAID-levels) <ulink
-    url="http://en.wikipedia.org/wiki/Redundant_array_of_independent_disks#RAID_5">here</ulink>.
-    </para>
-
-    <refsection>
-      <title>Parameters</title>
-
-      <para>The parameters are as follows:</para>
-
-      <itemizedlist>
-        <listitem>
-          <para><literal>configdir</literal>: The directory path where
-          configuration files are located. Usually this is
-          <literal>/etc/box</literal>. <literal>raidfile.conf</literal> will
-          be written in this directory.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>blocksize</literal>: The block size used for file
-          storage in the system, in bytes. Using a multple of the file system
-          block size is a good strategy. Depending on the size of the files
-          you will be backing up, this multiple varies. Of course it also
-          depends on the native block size of your file system.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>dir1</literal>: The first directory in the built-in
-          RAID array.</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>dir2</literal>: The second directory in the built-in
-          RAID array. If you are not using the built-in RAID functionality,
-          this field should be ignored. You should not use the built-in RAID,
-          when you have a hardware RAID solution, or if you're using another
-          type of software RAID (like md on Linux).</para>
-        </listitem>
-
-        <listitem>
-          <para><literal>dir3</literal>: The third directory in the built-in
-          RAID array. The same notes that apply to <literal>dir2</literal>
-          also apply to <literal>dir3</literal>.</para>
-        </listitem>
-      </itemizedlist>
-
-      <para>Note that there are currently no way to add multiple disk sets to
-      the raidfile.conf file using command line tools, etc. See
-      raidfile.conf(5) for details on adding more disks</para>
-    </refsection>
-  </refsection>
-
-  <refsection>
-    <title>Author</title>
-
-    <para>Ben Summers and contributors. For help, please go to the <ulink
-    url="http://boxbackup.hostworks.ca/">Wiki</ulink>, or subscribe to the Box
-    Backup <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list.</ulink></para>
-  </refsection>
-
-  <refsection>
-    <title>See Also</title>
-
-    <para><literal>bbstored-config(1)</literal></para>
-
-    <para><literal>bbstored.conf(5)</literal></para>
-
-    <para><literal>raidfile.conf(5)</literal></para>
-  </refsection>
-
-  <refsection>
-    <title>Files</title>
-
-    <para><literal>raidfile-config</literal> generates the raidfile.conf(5)
-    file.</para>
-  </refsection>
-
-  <refsection>
-    <title>Bugs</title>
-
-    <para>If you find a bug in Box Backup, and you want to let us know about
-    it, join the <ulink
-    url="http://lists.warhead.org.uk/mailman/listinfo/boxbackup">mailing
-    list</ulink>, and send a description of the problem there.</para>
-
-    <para>To report a bug, give us at least the following information:</para>
-
-    <itemizedlist>
-      <listitem>
-        <para>The version of Box Backup you are running</para>
-      </listitem>
-
-      <listitem>
-        <para>The platform you are running on (Hardware and OS), for both
-        client and server.</para>
-      </listitem>
-
-      <listitem>
-        <para>If possible attach your config files (bbstored.conf,
-        bbackupd.conf) to the bug report.</para>
-      </listitem>
-
-      <listitem>
-        <para>Also attach any log file output that helps shed light on the
-        problem you are seeing.</para>
-      </listitem>
-
-      <listitem>
-        <para>And last but certainly not least, a description of what you are
-        seeing, in as much detail as possible.</para>
-      </listitem>
-    </itemizedlist>
-  </refsection>
-</refentry>
\ No newline at end of file

Copied: box/chris/general/documentation/boxbackup/raidfile-config.xml (from rev 674, box/trunk/documentation/boxbackup/raidfile-config.xml)


Property changes on: box/chris/general/infrastructure
___________________________________________________________________
Name: svn:ignore
   - BoxPlatform.pm

   + BoxPlatform.pm
makebuildenv.pl
makeparcels.pl


Deleted: box/chris/general/infrastructure/m4/ax_check_llong_minmax.m4
===================================================================
--- box/chris/general/infrastructure/m4/ax_check_llong_minmax.m4	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/infrastructure/m4/ax_check_llong_minmax.m4	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,76 +0,0 @@
-dnl @synopsis AX_CHECK_LLONG_MINMAX
-dnl
-dnl This macro will fix up LLONG_MIN and LLONG_MAX as appropriate. I'm finding
-dnl it quite difficult to believe that so many hoops are necessary. The world
-dnl seems to have gone quite mad.
-dnl
-dnl This gem is adapted from the OpenSSH configure script so here's
-dnl the original copyright notice:
-dnl
-dnl Copyright (c) 1999-2004 Damien Miller
-dnl
-dnl Permission to use, copy, modify, and distribute this software for any
-dnl purpose with or without fee is hereby granted, provided that the above
-dnl copyright notice and this permission notice appear in all copies.
-dnl
-dnl @category C
-dnl @author Martin Ebourne and Damien Miller
-dnl @version 2005/07/07
-
-AC_DEFUN([AX_CHECK_LLONG_MINMAX], [
-  AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [[#include <limits.h>]])
-  if test -z "$have_llong_max"; then
-    AC_MSG_CHECKING([[for max value of long long]])
-    AC_RUN_IFELSE([AC_LANG_SOURCE([[
-      #include <stdio.h>
-      /* Why is this so damn hard? */
-      #undef __GNUC__
-      #undef __USE_ISOC99
-      #define __USE_ISOC99
-      #include <limits.h>
-      #define DATA "conftest.llminmax"
-      int main(void) {
-        FILE *f;
-        long long i, llmin, llmax = 0;
-
-        if((f = fopen(DATA,"w")) == NULL)
-          exit(1);
-
-        #if defined(LLONG_MIN) && defined(LLONG_MAX)
-        fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
-        llmin = LLONG_MIN;
-        llmax = LLONG_MAX;
-        #else
-        fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
-        /* This will work on one's complement and two's complement */
-        for (i = 1; i > llmax; i <<= 1, i++)
-          llmax = i;
-        llmin = llmax + 1LL;    /* wrap */
-        #endif
-
-        /* Sanity check */
-        if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax || llmax - 1 > llmax) {
-          fprintf(f, "unknown unknown\n");
-          exit(2);
-        }
-
-        if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
-          exit(3);
-
-        exit(0);
-      }
-      ]])], [
-      read llong_min llong_max < conftest.llminmax
-      AC_MSG_RESULT([$llong_max])
-      AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL],
-                         [max value of long long calculated by configure])
-      AC_MSG_CHECKING([[for min value of long long]])
-      AC_MSG_RESULT([$llong_min])
-      AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL],
-                         [min value of long long calculated by configure])
-      ],
-      [AC_MSG_RESULT(not found)],
-      [AC_MSG_WARN([[cross compiling: not checking]])]
-      )
-    fi
-  ])dnl

Copied: box/chris/general/infrastructure/m4/ax_config_scripts.m4 (from rev 674, box/trunk/infrastructure/m4/ax_config_scripts.m4)

Deleted: box/chris/general/infrastructure/makebuildenv.pl
===================================================================
--- box/chris/general/infrastructure/makebuildenv.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/infrastructure/makebuildenv.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,858 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use Symbol;
-
-my @modules;
-my %module_dependency;
-my %module_library_link_opts;
-my %header_dependency;
-
-$|=1;
-
-
-# note: Mac OS X resource forks and .DS_Store files are explicity ignored
-
-print "Box build environment setup.\n\n";
-
-my @implicit_deps = ('lib/common');
-
-# work out platform variables
-use lib 'infrastructure';
-use BoxPlatform;
-
-# keep copy of command line args
-my $makebuildenv_args = join(' ', at ARGV);
-
-# do command line arguments
-my $compile_line_extra = $platform_compile_line_extra;
-my $link_line_extra = $platform_link_line_extra;
-
-# make sure local files directory exists
-unless(-d 'local')
-{
-	mkdir 'local',0755;
-}
-
-
-# flags about the environment
-my %env_flags;
-
-my $windows_include_path = "";
-if ($target_windows)
-{
-	$module_dependency{"lib/common"} = ["lib/win32"];
-	push @implicit_deps, "lib/win32";
-}
-else
-{
-	# $env_flags{'IGNORE_lib/win32'} = 1;
-}
-
-# print "Flag: $_\n" for(keys %env_flags);
-
-# seed autogen code
-print "Seeding autogen code...\n";
-open FINDAUTOGEN,"find . -follow -name Makefile.extra |" or die "Can't use find for locating files";
-while(<FINDAUTOGEN>)
-{
-	chomp;
-	my $file = $_;
-	$file =~ m~\A(.+)/[^/]+\Z~;
-	my $dir = $1;
-	open FL,$file or die "Can't open $_ for reading";
-	my %vars;
-	my $do_cmds = 0;
-	while(<FL>)
-	{
-		chomp;
-		if(m/\A(.+)\s+=\s+(.+)\Z/)
-		{
-			# is a variable
-			$vars{$1} = $2;
-			next;
-		}
-		next unless m/\S/;
-		if(m/AUTOGEN SEEDING/)
-		{
-			$do_cmds = 1;
-		}
-		elsif(m/\A\S/)
-		{
-			$do_cmds = 0 if $do_cmds == 2;
-		}
-		else
-		{
-			# command, run it?
-			if($do_cmds)
-			{
-				$do_cmds = 2; # flag something has been done
-				
-				# subsitute variables, repeatedly
-				my $c = $_;
-				$c =~ s/\A\s+//;
-				while(1)
-				{
-					my $did_subst = 0;
-					
-					for my $k (keys %vars)
-					{
-						$did_subst = 1 if $c =~ s/\$\($k\)/$vars{$k}/g;
-					}
-					
-					last unless $did_subst;
-				}
-				
-				# run command
-				die "Couldn't run command $c" unless (0 == system("(cd $dir; $c)"))
-			}
-		}
-	}
-	close FL;
-}
-close FINDAUTOGEN;
-print "done\n\n";
-
-
-# open test mail program template file
-my $test_template_file = 'infrastructure/buildenv-testmain-template.cpp';
-open FL,$test_template_file or die "Can't open test template file\n";
-my $test_template;
-read FL,$test_template,-s $test_template_file;
-close FL;
-
-
-# extra platform defines
-my $extra_platform_defines = '';
-
-# read in module definitions file, and any files it includes
-my @modules_files;
-sub read_modules_file
-{
-	my ($mf) = @_;
-	my $f = gensym;
-	open $f,$mf or die "Can't open modules file '$mf'\n";
-	while(<$f>)
-	{
-		if(m/\AINCLUDE\s+(\S+)\Z/)
-		{
-			# include another file
-			read_modules_file($1)
-		}
-		else
-		{
-			push @modules_files,$_
-		}
-	}
-	close $f;
-}
-read_modules_file('modules.txt');
-
-# prepare directories...
-mkdir "release",0755;
-mkdir "debug",0755;
-
-# is the library code in another directory?
-my $external_lib = readlink('lib');
-if($external_lib ne '')
-{
-	# adjust to root of the library distribution
-	$external_lib =~ s!/lib\Z!!;
-	$external_lib = '../'.$external_lib;
-	# make symlinks
-	make_obj_symlink('debug');
-	make_obj_symlink('release');
-}
-sub make_obj_symlink
-{
-	my $m = $_[0];
-	my $target = $external_lib."/$m/lib/";
-	my $link = "$m/lib";
-	# check link
-	if(-e $link)
-	{
-		if(-l $link)
-		{
-			if(readlink($link) ne $target)
-			{
-				print "Warning: replacing $link with new link to $target\n";
-				unlink $link;
-			}
-		}
-		else
-		{
-			die "$link already exists, but it isn't a symbolic link"
-		}
-	}
-	if(!-e $link)
-	{
-		symlink $target,$link or die "Can't make $m/lib symlink";
-	}
-}
-
-print "Scanning code...\n";
-
-my $modules_omitted = 0;
-my $modules_omitting = 0;
-
-# process lines in flattened modules files
-for(@modules_files)
-{
-	# clean up line
-	chomp; s/\A\s+//; s/#.*\Z//; s/\s+\Z//; s/\s+/ /g;
-	next unless m/\S/;
-	
-	# omit bits on some platforms?
-	if(m/\AEND-OMIT/)
-	{
-		$modules_omitting = 0;
-		next;
-	}
-
-	next if $modules_omitting;
-
-	if(m/\AOMIT:(.+)/)
-	{
-		if($1 eq $build_os or $1 eq $target_os)
-		{
-			$modules_omitted = 1;
-			$modules_omitting = 1;
-		}
-		next;
-	}
-	
-	# split up...
-	my ($mod, @deps_i) = split / /;
-	
-	# ignore this module?
-	next if ignore_module($mod);
-	
-	# deps for this platform
-	my @deps;
-	for(@deps_i)
-	{
-		my ($dep,$exclude_from) = split /!/;
-		# generic library translation
-		$dep = $env_flags{'LIBTRANS_'.$dep} if exists($env_flags{'LIBTRANS_'.$dep});
-		next if $dep eq '';
-		if($exclude_from =~ m/\A\+(.+)\Z/)
-		{
-			$exclude_from = $1;
-			my $inc = 0;
-			for(split /,/,$exclude_from)
-			{
-				$inc = 1 if $_ eq $build_os
-			}
-			push @deps,$dep if $inc
-		}
-		else
-		{
-			my $inc = 1;
-			for(split /,/,$exclude_from)
-			{
-				$inc = 0 if $_ eq $build_os
-			}
-			push @deps,$dep if $inc
-		}
-	}
-	
-	# check directory exists
-	die "Module $mod can't be found\n" unless -d $mod;
-	
-	# and put in lists
-	push @modules,$mod;
-	my @md;	# module dependencies
-	my @lo; # link line options
-	for(@deps)
-	{
-		if(/\A-l/)
-		{
-			push @lo,$_
-		}
-		else
-		{
-			push @md,$_ unless ignore_module($_)
-		}
-	}
-	$module_dependency{$mod} = [@implicit_deps, at md];
-	$module_library_link_opts{$mod} = [@lo];
-	
-	# make directories, but not if we're using an external library and this a library module
-	my ($s,$d) = split /\//,$mod;
-	if($s ne 'lib' || $external_lib eq '')
-	{
-		mkdir "release/$s",0755;
-		mkdir "release/$s/$d",0755;
-		mkdir "debug/$s",0755;
-		mkdir "debug/$s/$d",0755;
-	}
-}
-
-# make dirs for implicit dep
-foreach my $dep (@implicit_deps)
-{
-	mkdir "release/$dep",0755;
-	mkdir "debug/$dep",0755;
-}
-
-# write a list of all the modules we've configured to use
-open CONFIGURED_MODS,'>local/modules.h' or die "Can't write configured modules list";
-print CONFIGURED_MODS <<__E;
-// automatically generated file, do not edit
-#ifndef _CONFIGURED_MODULES__H
-#define _CONFIGURED_MODULES__H
-__E
-for(@implicit_deps, at modules)
-{
-	my $m = $_;
-	$m =~ s~/~_~;
-	print CONFIGURED_MODS "#define MODULE_$m\n";
-}
-print CONFIGURED_MODS <<__E;
-#endif // _CONFIGURED_MODULES__H
-__E
-close CONFIGURED_MODS;
-
-
-# now make a list of all the .h files we can find, recording which module they're in
-my %hfiles;
-for my $mod (@modules, @implicit_deps)
-{
-	opendir DIR,$mod;
-	my @items = readdir DIR;
-	closedir DIR;
-
-	# add in items from autogen directories, and create output directories
-	{
-		my @autogen_items;
-		
-		for my $di (@items)
-		{
-			if($di =~ m/\Aautogen/ && -d "$mod/$di")
-			{
-				# Read items
-				my $d = "$mod/$di";
-				opendir DIR,$d;
-				my @i = readdir DIR;
-				closedir DIR;
-				for(@i)
-				{
-					next if m/\A\./;
-					push @autogen_items,"$di/$_"
-				}
-			}
-		}
-		@items = (@items, @autogen_items);
-	}
-
-	for(grep /\.h\Z/i, @items)
-	{
-		next if /\A\._/;	# Temp Mac OS Resource hack
-		die "Header file $_ already used in module ".$hfiles{$_}."\n" if exists $hfiles{$_};
-		$hfiles{$_} = $mod
-	}
-}
-
-for my $mod (@modules, @implicit_deps)
-{
-	opendir DIR,$mod;
-	for my $h (grep /\.h\Z/i, readdir DIR)
-	{
-		next if $h =~ /\A\./;		# Ignore Mac resource forks, autosaves, etc
-
-		open FL,"$mod/$h" or die "can't open $mod/$h";
-		my $f;
-		read FL,$f,-s "$mod/$h";
-		close FL;
-
-		while($f =~ m/\#include\s+"([^"]+?)"/g)
-		{
-			my $i = $1;
-			# ignore autogen exceptions
-			next if $i =~ m/\Aautogen_.+?Exception.h\Z/;
-			# record dependency
-			${$header_dependency{$h}}{$i} = 1 if exists $hfiles{$i};
-		}
-	}
-	closedir DIR;
-}
-
-print "done\n\nGenerating Makefiles...\n";
-
-my %module_resources_win32;
-
-# Then write a makefile for each module
-for my $mod (@implicit_deps, @modules)
-{
-	print $mod,"\n";
-	
-	my ($type,$name) = split /\//,$mod;
-	
-	# add additional files for tests
-	if($type eq 'test')
-	{
-		my $testmain = $test_template;
-		$testmain =~ s/TEST_NAME/$name/g;
-		open TESTMAIN,">$mod/_main.cpp" or die "Can't open test main file for $mod for writing\n";
-		print TESTMAIN $testmain;
-		close TESTMAIN;
-		
-		# test file...
-		sub writetestfile
-		{
-			my ($filename,$runcmd,$module) = @_;		
-			open TESTFILE,">$filename" or die "Can't open test script file for $module for writing\n";
-			print TESTFILE "#!/bin/sh\necho TEST: $module\n";
-			if(-d "$module/testfiles")
-			{
-				print TESTFILE <<__E;
-echo Removing old test files...
-rm -rf testfiles
-echo Copying new test files...
-cp -p -R ../../../$module/testfiles .
-__E
-			}
-			if(-e "$module/testextra")
-			{
-				open FL,"$module/testextra" or die "Can't open $module/testextra";
-				while(<FL>) {print TESTFILE}
-				close FL;
-			}
-			print TESTFILE "$runcmd\n";
-			close TESTFILE;
-		}
-		
-		writetestfile("$mod/_t", 
-			'./test' . $platform_exe_ext . ' $1 $2 $3 $4 $5', $mod);
-		writetestfile("$mod/_t-gdb", 
-			'gdb ./test' . $platform_exe_ext, $mod);
-		
-	}
-	
-	my @all_deps_for_module;
-	{
-		# work out what dependencies need to be run
-		my @deps_raw;
-		sub add_mod_deps
-		{
-			my ($arr_r,$nm) = @_;
-			if($#{$module_dependency{$nm}} >= 0)
-			{
-				push @$arr_r,@{$module_dependency{$nm}};
-				for(@{$module_dependency{$nm}})
-				{
-					add_mod_deps($arr_r,$_)
-				}
-			}
-		}
-		add_mod_deps(\@deps_raw, $mod);
-		# and then dedup and reorder them
-		my %d_done;
-		foreach my $dep (reverse @deps_raw)
-		{
-			if(!exists $d_done{$dep})
-			{
-				# insert
-				push @all_deps_for_module, $dep;
-				# mark as done
-				$d_done{$dep} = 1;
-			}
-		}
-	}	
-	
-
-	# make include path
-	my $include_paths = $windows_include_path .
-		join(' ',map {'-I../../'.$_} @all_deps_for_module);
-
-	# is target a library?
-	my $target_is_library = ($type ne 'bin' && $type ne 'test');
-
-	# make target name
-	my $end_target = $name;
-
-	if ($target_is_library)
-	{
-		$end_target .= '.a';
-	}
-	else
-	{
-		$end_target .= $platform_exe_ext;
-	}
-
-	$end_target = 'test'.$platform_exe_ext if $type eq 'test';
-
-	# adjust for outdir
-	$end_target = '$(OUTDIR)/' . $end_target;
-
-	# start the makefile
-	my $mk_name_extra = ($bsd_make)?'':'X';
-	open MAKE,">$mod/Makefile".$mk_name_extra or die "Can't open Makefile for $mod\n";
-	my $debug_link_extra = ($target_is_library)?'':'../../debug/lib/debug/debug.a';
-
-	my $release_flags = "-O2";
-	if ($target_windows)
-	{
-		$release_flags = "-O0 -g";
-	}
-
-	print MAKE <<__E;
-#
-# AUTOMATICALLY GENERATED FILE
-#    do not edit!
-#
-#
-CXX = g++
-AR = ar
-RANLIB = ranlib
-WINDRES = windres
-.ifdef RELEASE
-CXXFLAGS = -DNDEBUG $release_flags -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
-OUTBASE = ../../release
-OUTDIR = ../../release/$mod
-DEPENDMAKEFLAGS = -D RELEASE
-VARIENT = RELEASE
-.else
-CXXFLAGS = -g -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
-OUTBASE = ../../debug
-OUTDIR = ../../debug/$mod
-DEPENDMAKEFLAGS =
-VARIENT = DEBUG
-.endif
-
-__E
-	
-	# read directory
-	opendir DIR,$mod;
-	my @items = readdir DIR;
-	closedir DIR;
-	
-	# add in items from autogen directories, and create output directories
-	{
-		my @autogen_items;
-		for my $di (@items)
-		{
-			if($di =~ m/\Aautogen/ && -d "$mod/$di")
-			{
-				# Read items
-				my $d = "$mod/$di";
-				opendir DIR,$d;
-				my @i = readdir DIR;
-				closedir DIR;
-				for(@i)
-				{
-					next if m/\A\./;
-					push @autogen_items,"$di/$_"
-				}
-				
-				# output directories
-				mkdir "release/$mod/$di",0755;
-				mkdir "debug/$mod/$di",0755;
-			}
-		}
-		@items = (@items, @autogen_items);
-	}
-	
-	# first, obtain a list of dependencies within the .h files
-	my %headers;
-	for my $h (grep /\.h\Z/i, @items)
-	{
-		open FL,"$mod/$h";
-		my $f;
-		read FL,$f,-s "$mod/$h";
-		close FL;
-
-		while($f =~ m/\#include\s+"([^"]+?)"/g)
-		{
-			${$headers{$h}}{$1} = 1 if exists $hfiles{$1};
-		}
-	}
-	
-	# ready for the rest of the details...
-	my $make;
-	
-	# then... do the cpp files...
-	my @obj_base;
-	for my $file (@items)
-	{
-		my $is_cpp = $file =~ m/\A(.+)\.cpp\Z/i;
-		my $is_rc  = $file =~ m/\A(.+)\.rc\Z/i;
-		my $base = $1;
-
-		if ($target_windows)
-		{
-			next if not $is_cpp and not $is_rc;
-		}
-		else
-		{
-			next if not $is_cpp;
-		}
-
-		next if $file =~ /\A\._/; # Temp Mac OS Resource hack
-
-		# store for later
-		push @obj_base,$base;
-	
-		# get the file...
-		open FL,"$mod/$file";
-		my $f;
-		read FL,$f,-s "$mod/$file";
-		close FL;
-		
-		my %dep;
-
-		while($f =~ m/\#include\s+"([^"]+?)"/g)
-		{
-			insert_dep($1, \%dep) if exists $hfiles{$1};
-		}
-		
-		# output filename
-		my $out_name = '$(OUTDIR)/'.$base.'.o';
-		
-		# write the line for this cpp file
-		my @dep_paths = map 
-		{ 
-			($hfiles{$_} eq $mod)
-			? $_ 
-			: '../../'.$hfiles{$_}."/$_"
-		}
-		keys %dep;
-
-		$make .= $out_name.': '.join(' ',$file, at dep_paths)."\n";
-
-		if ($is_cpp)
-		{
-			$make .= "\t\$(CXX) \$(CXXFLAGS) $compile_line_extra ".
-				"-c $file -o $out_name\n\n";
-		}
-		elsif ($is_rc)
-		{
-			$make .= "\t\$(WINDRES) $file $out_name\n\n";
-			my $res_list = $module_resources_win32{$mod};
-			$res_list ||= [];
-			push @$res_list, $base.'.o';
-			$module_resources_win32{$mod} = $res_list;
-		}
-	}
-
-	my $has_deps = ($#{$module_dependency{$mod}} >= 0);
-# ----- # always has dependencies with debug library
-	$has_deps = 1;
-	$has_deps = 0 if $target_is_library;
-
-	# Depenency stuff
-	my $deps_makeinfo;
-	if($has_deps)
-	{
-		if($bsd_make)
-		{
-			$deps_makeinfo = <<'__E';
-.BEGIN::
-.ifndef NODEPS
-.	if $(.TARGETS) == ""
-__E
-		}
-		else
-		{
-			# gnu make
-			$deps_makeinfo = <<'__E';
-.PHONY:	dep_modules
-dep_modules:
-ifndef NODEPS
-ifeq ($(strip $(.TARGETS)),)
-__E
-		}
-		
-		# run make for things we require
-		for my $dep (@all_deps_for_module)
-		{
-			$deps_makeinfo .= "\t\t(cd ../../$dep; \$(MAKE)$sub_make_options \$(DEPENDMAKEFLAGS) -D NODEPS)\n";
-		}
-		$deps_makeinfo .= ".\tendif\n.endif\n\n";
-	}
-	print MAKE $deps_makeinfo if $bsd_make;
-	
-	# get the list of library things to add -- in order of dependency so things link properly
-	my $lib_files = join(' ',map {($_ =~ m/lib\/(.+)\Z/)?('$(OUTBASE)/'.$_.'/'.$1.'.a'):undef} (reverse(@all_deps_for_module)));
-
-	# need to see if the extra makefile fragments require extra object files
-	# or include any more makefiles
-	my @objs = @obj_base;
-	my @makefile_includes;
-	
-	additional_objects_from_make_fragment("$mod/Makefile.extra", \@objs, \@makefile_includes);
-	additional_objects_from_make_fragment("$mod/Makefile.extra.$build_os", \@objs, \@makefile_includes);
-
-	my $o_file_list = join(' ',map {'$(OUTDIR)/'.$_.'.o'} @objs);
-
-	if ($has_deps and not $bsd_make)
-	{
-		print MAKE ".PHONY: all\n" .
-			"all: dep_modules $end_target\n\n";
-	}
-
-	print MAKE $end_target,': ',$o_file_list;
-	print MAKE " ",$lib_files unless $target_is_library;
-	print MAKE "\n";
-	
-	if ($target_windows)
-	{
-		foreach my $dep (@all_deps_for_module)
-		{
-			my $res_list = $module_resources_win32{$dep};
-			next unless $res_list;
-			$o_file_list .= ' '.join(' ', 
-				map {'$(OUTBASE)/'.$dep."/$_"} @$res_list);
-		}
-	}
-
-	# stuff to make the final target...
-	if($target_is_library)
-	{
-		# make a library archive...
-		print MAKE "\t(echo -n > $end_target; rm $end_target)\n";
-		print MAKE "\t\$(AR) -q $end_target $o_file_list\n";
-		print MAKE "\t\$(RANLIB) $end_target\n";
-	}
-	else
-	{
-		# work out library options
-		# need to be... least used first, in absolute order they appear in the modules.txt file
-		my @libops;
-		sub libops_fill
-		{
-			my ($m,$r) = @_;
-			push @$r,$_ for(@{$module_library_link_opts{$m}});
-			libops_fill($_,$r) for(@{$module_dependency{$m}});
-		}
-		libops_fill($mod,\@libops);
-		my $lo = '';
-		my %ldone;
-		for(@libops)
-		{
-			next if exists $ldone{$_};
-			$lo .= ' '.$_;
-			$ldone{$_} = 1;
-		}
-	
-		# link line...
-		print MAKE "\t\$(CXX) $link_line_extra -o $end_target $o_file_list $lib_files$lo $platform_lib_files\n";
-	}
-	# tests need to copy the test file over
-	if($type eq 'test')
-	{
-		print MAKE "\tcp _t \$(OUTDIR)/t\n\tchmod u+x \$(OUTDIR)/t\n";
-		print MAKE "\tcp _t-gdb \$(OUTDIR)/t-gdb\n\tchmod u+x \$(OUTDIR)/t-gdb\n";
-	}
-	# dependency line?
-	print MAKE "\n";
-
-	# module dependencies for GNU make?
-	print MAKE $deps_makeinfo if !$bsd_make;
-	
-	# print the rest of the file
-	print MAKE $make,"\n";
-	
-	# and a clean target
-	print MAKE "clean:\n\t-rm -rf \$(OUTDIR)/*\n.\tifndef SUBCLEAN\n";
-	for my $dep (@all_deps_for_module)
-	{
-		print MAKE "\t(cd ../../$dep; \$(MAKE) \$(DEPENDMAKEFLAGS) -D SUBCLEAN clean)\n";
-	}
-	print MAKE ".\tendif\n";
-	
-	# include any extra stuff
-	print MAKE "\n\n";
-	if(-e "$mod/Makefile.extra")
-	{
-		print MAKE ".include <Makefile.extra>\n\n";
-	}
-	if(-e "$mod/Makefile.extra.$build_os")
-	{
-		print MAKE ".include <Makefile.extra.$build_os>\n\n";
-	}
-	for(@makefile_includes)
-	{
-		print MAKE ".include <$_>\n\n";
-	}
-	
-	# and finally a target for rebuilding the build system
-	print MAKE "\nbuildsystem:\n\t(cd ../..; perl ./infrastructure/makebuildenv.pl $makebuildenv_args)\n\n";
-	
-	close MAKE;
-
-	if(!$bsd_make)
-	{
-		# need to post process this into a GNU makefile
-		open MAKE,">$mod/Makefile";
-		open MAKEB,"$mod/MakefileX";
-
-		while(<MAKEB>)
-		{
-			s/\A\.\s*(ifdef|else|endif|ifndef)/$1/;
-			s/\A\.\s*include\s+<(.+?)>/include $1/;
-			s/-D\s+(\w+)/$1=1/;
-			print MAKE;
-		}
-
-		close MAKEB;
-		close MAKE;
-		unlink "$mod/MakefileX";
-	}
-}
-
-print "\nType 'cd <module_dir>; $make_command' to build a module\n\n";
-
-if($modules_omitted)
-{
-	print "\nNOTE: Some modules have been omitted on this platform\n\n"
-}
-
-sub insert_dep
-{
-	my ($h,$dep_r) = @_;
-	
-	# stop random recusion
-	return if exists $$dep_r{$h};
-	
-	# insert more depencies
-	insert_dep($_,$dep_r) for keys %{$header_dependency{$h}};
-
-	# mark this one as a dependency
-	$$dep_r{$h} = 1;
-}
-
-
-sub additional_objects_from_make_fragment
-{
-	my ($fn,$objs_r,$include_r) = @_;
-	
-	if(-e $fn)
-	{
-		open FL,$fn or die "Can't open $fn";
-		
-		while(<FL>)
-		{
-			chomp;
-			if(m/link-extra:\s*(.+)\Z/)
-			{
-				my @o = split /\s+/,$1;
-				for(@o)
-				{
-					push @$objs_r,$1 if m/\A(.+)\.o\Z/;
-				}
-			}
-			elsif(m/include-makefile:\s*(\S+)/)
-			{
-				push @$include_r,$1
-			}
-		}
-		
-		close FL;
-	}
-}
-
-
-sub ignore_module
-{
-	exists $env_flags{'IGNORE_'.$_[0]}
-}

Copied: box/chris/general/infrastructure/makebuildenv.pl.in (from rev 674, box/trunk/infrastructure/makebuildenv.pl.in)
===================================================================
--- box/trunk/infrastructure/makebuildenv.pl.in	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/infrastructure/makebuildenv.pl.in	2006-07-23 00:12:10 UTC (rev 675)
@@ -0,0 +1,860 @@
+#!@PERL@
+use strict;
+use Symbol;
+
+my @modules;
+my %module_dependency;
+my %module_library_link_opts;
+my %header_dependency;
+
+$|=1;
+
+
+# note: Mac OS X resource forks and .DS_Store files are explicity ignored
+
+print "Box build environment setup.\n\n";
+
+my @implicit_deps = ('lib/common');
+
+# work out platform variables
+use lib 'infrastructure';
+use BoxPlatform;
+
+# keep copy of command line args
+my $makebuildenv_args = join(' ', at ARGV);
+
+# do command line arguments
+my $compile_line_extra = $platform_compile_line_extra;
+my $link_line_extra = $platform_link_line_extra;
+
+# make sure local files directory exists
+unless(-d 'local')
+{
+	mkdir 'local',0755;
+}
+
+
+# flags about the environment
+my %env_flags;
+
+my $windows_include_path = "";
+if ($target_windows)
+{
+	$module_dependency{"lib/common"} = ["lib/win32"];
+	push @implicit_deps, "lib/win32";
+}
+else
+{
+	# $env_flags{'IGNORE_lib/win32'} = 1;
+}
+
+# print "Flag: $_\n" for(keys %env_flags);
+
+# seed autogen code
+print "Seeding autogen code...\n";
+open FINDAUTOGEN,"find . -follow -name Makefile.extra |" or die "Can't use find for locating files";
+while(<FINDAUTOGEN>)
+{
+	chomp;
+	my $file = $_;
+	$file =~ m~\A(.+)/[^/]+\Z~;
+	my $dir = $1;
+	open FL,$file or die "Can't open $_ for reading";
+	my %vars;
+	$vars{PERL} = "@PERL@";
+	my $do_cmds = 0;
+	while(<FL>)
+	{
+		chomp;
+		if(m/\A(.+)\s+=\s+(.+)\Z/)
+		{
+			# is a variable
+			$vars{$1} = $2;
+			next;
+		}
+		next unless m/\S/;
+		if(m/AUTOGEN SEEDING/)
+		{
+			$do_cmds = 1;
+		}
+		elsif(m/\A\S/)
+		{
+			$do_cmds = 0 if $do_cmds == 2;
+		}
+		else
+		{
+			# command, run it?
+			if($do_cmds)
+			{
+				$do_cmds = 2; # flag something has been done
+				
+				# subsitute variables, repeatedly
+				my $c = $_;
+				$c =~ s/\A\s+//;
+				while(1)
+				{
+					my $did_subst = 0;
+					
+					for my $k (keys %vars)
+					{
+						$did_subst = 1 if $c =~ s/\$\($k\)/$vars{$k}/g;
+					}
+					
+					last unless $did_subst;
+				}
+				
+				# run command
+				die "Couldn't run command $c" unless (0 == system("(cd $dir; $c)"))
+			}
+		}
+	}
+	close FL;
+}
+close FINDAUTOGEN;
+print "done\n\n";
+
+
+# open test mail program template file
+my $test_template_file = 'infrastructure/buildenv-testmain-template.cpp';
+open FL,$test_template_file or die "Can't open test template file\n";
+my $test_template;
+read FL,$test_template,-s $test_template_file;
+close FL;
+
+
+# extra platform defines
+my $extra_platform_defines = '';
+
+# read in module definitions file, and any files it includes
+my @modules_files;
+sub read_modules_file
+{
+	my ($mf) = @_;
+	my $f = gensym;
+	open $f,$mf or die "Can't open modules file '$mf'\n";
+	while(<$f>)
+	{
+		if(m/\AINCLUDE\s+(\S+)\Z/)
+		{
+			# include another file
+			read_modules_file($1)
+		}
+		else
+		{
+			push @modules_files,$_
+		}
+	}
+	close $f;
+}
+read_modules_file('modules.txt');
+
+# prepare directories...
+mkdir "release",0755;
+mkdir "debug",0755;
+
+# is the library code in another directory?
+my $external_lib = readlink('lib');
+if($external_lib ne '')
+{
+	# adjust to root of the library distribution
+	$external_lib =~ s!/lib\Z!!;
+	$external_lib = '../'.$external_lib;
+	# make symlinks
+	make_obj_symlink('debug');
+	make_obj_symlink('release');
+}
+sub make_obj_symlink
+{
+	my $m = $_[0];
+	my $target = $external_lib."/$m/lib/";
+	my $link = "$m/lib";
+	# check link
+	if(-e $link)
+	{
+		if(-l $link)
+		{
+			if(readlink($link) ne $target)
+			{
+				print "Warning: replacing $link with new link to $target\n";
+				unlink $link;
+			}
+		}
+		else
+		{
+			die "$link already exists, but it isn't a symbolic link"
+		}
+	}
+	if(!-e $link)
+	{
+		symlink $target,$link or die "Can't make $m/lib symlink";
+	}
+}
+
+print "Scanning code...\n";
+
+my $modules_omitted = 0;
+my $modules_omitting = 0;
+
+# process lines in flattened modules files
+for(@modules_files)
+{
+	# clean up line
+	chomp; s/\A\s+//; s/#.*\Z//; s/\s+\Z//; s/\s+/ /g;
+	next unless m/\S/;
+	
+	# omit bits on some platforms?
+	if(m/\AEND-OMIT/)
+	{
+		$modules_omitting = 0;
+		next;
+	}
+
+	next if $modules_omitting;
+
+	if(m/\AOMIT:(.+)/)
+	{
+		if($1 eq $build_os or $1 eq $target_os)
+		{
+			$modules_omitted = 1;
+			$modules_omitting = 1;
+		}
+		next;
+	}
+	
+	# split up...
+	my ($mod, @deps_i) = split / /;
+	
+	# ignore this module?
+	next if ignore_module($mod);
+	
+	# deps for this platform
+	my @deps;
+	for(@deps_i)
+	{
+		my ($dep,$exclude_from) = split /!/;
+		# generic library translation
+		$dep = $env_flags{'LIBTRANS_'.$dep} if exists($env_flags{'LIBTRANS_'.$dep});
+		next if $dep eq '';
+		if($exclude_from =~ m/\A\+(.+)\Z/)
+		{
+			$exclude_from = $1;
+			my $inc = 0;
+			for(split /,/,$exclude_from)
+			{
+				$inc = 1 if $_ eq $build_os
+			}
+			push @deps,$dep if $inc
+		}
+		else
+		{
+			my $inc = 1;
+			for(split /,/,$exclude_from)
+			{
+				$inc = 0 if $_ eq $build_os
+			}
+			push @deps,$dep if $inc
+		}
+	}
+	
+	# check directory exists
+	die "Module $mod can't be found\n" unless -d $mod;
+	
+	# and put in lists
+	push @modules,$mod;
+	my @md;	# module dependencies
+	my @lo; # link line options
+	for(@deps)
+	{
+		if(/\A-l/)
+		{
+			push @lo,$_
+		}
+		else
+		{
+			push @md,$_ unless ignore_module($_)
+		}
+	}
+	$module_dependency{$mod} = [@implicit_deps, at md];
+	$module_library_link_opts{$mod} = [@lo];
+	
+	# make directories, but not if we're using an external library and this a library module
+	my ($s,$d) = split /\//,$mod;
+	if($s ne 'lib' || $external_lib eq '')
+	{
+		mkdir "release/$s",0755;
+		mkdir "release/$s/$d",0755;
+		mkdir "debug/$s",0755;
+		mkdir "debug/$s/$d",0755;
+	}
+}
+
+# make dirs for implicit dep
+foreach my $dep (@implicit_deps)
+{
+	mkdir "release/$dep",0755;
+	mkdir "debug/$dep",0755;
+}
+
+# write a list of all the modules we've configured to use
+open CONFIGURED_MODS,'>local/modules.h' or die "Can't write configured modules list";
+print CONFIGURED_MODS <<__E;
+// automatically generated file, do not edit
+#ifndef _CONFIGURED_MODULES__H
+#define _CONFIGURED_MODULES__H
+__E
+for(@implicit_deps, at modules)
+{
+	my $m = $_;
+	$m =~ s~/~_~;
+	print CONFIGURED_MODS "#define MODULE_$m\n";
+}
+print CONFIGURED_MODS <<__E;
+#endif // _CONFIGURED_MODULES__H
+__E
+close CONFIGURED_MODS;
+
+
+# now make a list of all the .h files we can find, recording which module they're in
+my %hfiles;
+for my $mod (@modules, @implicit_deps)
+{
+	opendir DIR,$mod;
+	my @items = readdir DIR;
+	closedir DIR;
+
+	# add in items from autogen directories, and create output directories
+	{
+		my @autogen_items;
+		
+		for my $di (@items)
+		{
+			if($di =~ m/\Aautogen/ && -d "$mod/$di")
+			{
+				# Read items
+				my $d = "$mod/$di";
+				opendir DIR,$d;
+				my @i = readdir DIR;
+				closedir DIR;
+				for(@i)
+				{
+					next if m/\A\./;
+					push @autogen_items,"$di/$_"
+				}
+			}
+		}
+		@items = (@items, @autogen_items);
+	}
+
+	for(grep /\.h\Z/i, @items)
+	{
+		next if /\A\._/;	# Temp Mac OS Resource hack
+		die "Header file $_ already used in module ".$hfiles{$_}."\n" if exists $hfiles{$_};
+		$hfiles{$_} = $mod
+	}
+}
+
+for my $mod (@modules, @implicit_deps)
+{
+	opendir DIR,$mod;
+	for my $h (grep /\.h\Z/i, readdir DIR)
+	{
+		next if $h =~ /\A\./;		# Ignore Mac resource forks, autosaves, etc
+
+		open FL,"$mod/$h" or die "can't open $mod/$h";
+		my $f;
+		read FL,$f,-s "$mod/$h";
+		close FL;
+
+		while($f =~ m/\#include\s+"([^"]+?)"/g)
+		{
+			my $i = $1;
+			# ignore autogen exceptions
+			next if $i =~ m/\Aautogen_.+?Exception.h\Z/;
+			# record dependency
+			${$header_dependency{$h}}{$i} = 1 if exists $hfiles{$i};
+		}
+	}
+	closedir DIR;
+}
+
+print "done\n\nGenerating Makefiles...\n";
+
+my %module_resources_win32;
+
+# Then write a makefile for each module
+for my $mod (@implicit_deps, @modules)
+{
+	print $mod,"\n";
+	
+	my ($type,$name) = split /\//,$mod;
+	
+	# add additional files for tests
+	if($type eq 'test')
+	{
+		my $testmain = $test_template;
+		$testmain =~ s/TEST_NAME/$name/g;
+		open TESTMAIN,">$mod/_main.cpp" or die "Can't open test main file for $mod for writing\n";
+		print TESTMAIN $testmain;
+		close TESTMAIN;
+		
+		# test file...
+		sub writetestfile
+		{
+			my ($filename,$runcmd,$module) = @_;		
+			open TESTFILE,">$filename" or die "Can't open test script file for $module for writing\n";
+			print TESTFILE "#!/bin/sh\necho TEST: $module\n";
+			if(-d "$module/testfiles")
+			{
+				print TESTFILE <<__E;
+echo Removing old test files...
+rm -rf testfiles
+echo Copying new test files...
+cp -p -R ../../../$module/testfiles .
+__E
+			}
+			if(-e "$module/testextra")
+			{
+				open FL,"$module/testextra" or die "Can't open $module/testextra";
+				while(<FL>) {print TESTFILE}
+				close FL;
+			}
+			print TESTFILE "$runcmd\n";
+			close TESTFILE;
+		}
+		
+		writetestfile("$mod/_t", 
+			'./test' . $platform_exe_ext . ' $1 $2 $3 $4 $5', $mod);
+		writetestfile("$mod/_t-gdb", 
+			'gdb ./test' . $platform_exe_ext, $mod);
+		
+	}
+	
+	my @all_deps_for_module;
+	{
+		# work out what dependencies need to be run
+		my @deps_raw;
+		sub add_mod_deps
+		{
+			my ($arr_r,$nm) = @_;
+			if($#{$module_dependency{$nm}} >= 0)
+			{
+				push @$arr_r,@{$module_dependency{$nm}};
+				for(@{$module_dependency{$nm}})
+				{
+					add_mod_deps($arr_r,$_)
+				}
+			}
+		}
+		add_mod_deps(\@deps_raw, $mod);
+		# and then dedup and reorder them
+		my %d_done;
+		foreach my $dep (reverse @deps_raw)
+		{
+			if(!exists $d_done{$dep})
+			{
+				# insert
+				push @all_deps_for_module, $dep;
+				# mark as done
+				$d_done{$dep} = 1;
+			}
+		}
+	}	
+	
+
+	# make include path
+	my $include_paths = $windows_include_path .
+		join(' ',map {'-I../../'.$_} @all_deps_for_module);
+
+	# is target a library?
+	my $target_is_library = ($type ne 'bin' && $type ne 'test');
+
+	# make target name
+	my $end_target = $name;
+
+	if ($target_is_library)
+	{
+		$end_target .= '.a';
+	}
+	else
+	{
+		$end_target .= $platform_exe_ext;
+	}
+
+	$end_target = 'test'.$platform_exe_ext if $type eq 'test';
+
+	# adjust for outdir
+	$end_target = '$(OUTDIR)/' . $end_target;
+
+	# start the makefile
+	my $mk_name_extra = ($bsd_make)?'':'X';
+	open MAKE,">$mod/Makefile".$mk_name_extra or die "Can't open Makefile for $mod\n";
+	my $debug_link_extra = ($target_is_library)?'':'../../debug/lib/debug/debug.a';
+
+	my $release_flags = "-O2";
+	if ($target_windows)
+	{
+		$release_flags = "-O0 -g";
+	}
+
+	print MAKE <<__E;
+#
+# AUTOMATICALLY GENERATED FILE
+#    do not edit!
+#
+#
+CXX = g++
+AR = ar
+RANLIB = ranlib
+PERL = "@PERL@"
+WINDRES = windres
+.ifdef RELEASE
+CXXFLAGS = -DNDEBUG $release_flags -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
+OUTBASE = ../../release
+OUTDIR = ../../release/$mod
+DEPENDMAKEFLAGS = -D RELEASE
+VARIENT = RELEASE
+.else
+CXXFLAGS = -g -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
+OUTBASE = ../../debug
+OUTDIR = ../../debug/$mod
+DEPENDMAKEFLAGS =
+VARIENT = DEBUG
+.endif
+
+__E
+	
+	# read directory
+	opendir DIR,$mod;
+	my @items = readdir DIR;
+	closedir DIR;
+	
+	# add in items from autogen directories, and create output directories
+	{
+		my @autogen_items;
+		for my $di (@items)
+		{
+			if($di =~ m/\Aautogen/ && -d "$mod/$di")
+			{
+				# Read items
+				my $d = "$mod/$di";
+				opendir DIR,$d;
+				my @i = readdir DIR;
+				closedir DIR;
+				for(@i)
+				{
+					next if m/\A\./;
+					push @autogen_items,"$di/$_"
+				}
+				
+				# output directories
+				mkdir "release/$mod/$di",0755;
+				mkdir "debug/$mod/$di",0755;
+			}
+		}
+		@items = (@items, @autogen_items);
+	}
+	
+	# first, obtain a list of dependencies within the .h files
+	my %headers;
+	for my $h (grep /\.h\Z/i, @items)
+	{
+		open FL,"$mod/$h";
+		my $f;
+		read FL,$f,-s "$mod/$h";
+		close FL;
+
+		while($f =~ m/\#include\s+"([^"]+?)"/g)
+		{
+			${$headers{$h}}{$1} = 1 if exists $hfiles{$1};
+		}
+	}
+	
+	# ready for the rest of the details...
+	my $make;
+	
+	# then... do the cpp files...
+	my @obj_base;
+	for my $file (@items)
+	{
+		my $is_cpp = $file =~ m/\A(.+)\.cpp\Z/i;
+		my $is_rc  = $file =~ m/\A(.+)\.rc\Z/i;
+		my $base = $1;
+
+		if ($target_windows)
+		{
+			next if not $is_cpp and not $is_rc;
+		}
+		else
+		{
+			next if not $is_cpp;
+		}
+
+		next if $file =~ /\A\._/; # Temp Mac OS Resource hack
+
+		# store for later
+		push @obj_base,$base;
+	
+		# get the file...
+		open FL,"$mod/$file";
+		my $f;
+		read FL,$f,-s "$mod/$file";
+		close FL;
+		
+		my %dep;
+
+		while($f =~ m/\#include\s+"([^"]+?)"/g)
+		{
+			insert_dep($1, \%dep) if exists $hfiles{$1};
+		}
+		
+		# output filename
+		my $out_name = '$(OUTDIR)/'.$base.'.o';
+		
+		# write the line for this cpp file
+		my @dep_paths = map 
+		{ 
+			($hfiles{$_} eq $mod)
+			? $_ 
+			: '../../'.$hfiles{$_}."/$_"
+		}
+		keys %dep;
+
+		$make .= $out_name.': '.join(' ',$file, at dep_paths)."\n";
+
+		if ($is_cpp)
+		{
+			$make .= "\t\$(CXX) \$(CXXFLAGS) $compile_line_extra ".
+				"-c $file -o $out_name\n\n";
+		}
+		elsif ($is_rc)
+		{
+			$make .= "\t\$(WINDRES) $file $out_name\n\n";
+			my $res_list = $module_resources_win32{$mod};
+			$res_list ||= [];
+			push @$res_list, $base.'.o';
+			$module_resources_win32{$mod} = $res_list;
+		}
+	}
+
+	my $has_deps = ($#{$module_dependency{$mod}} >= 0);
+# ----- # always has dependencies with debug library
+	$has_deps = 1;
+	$has_deps = 0 if $target_is_library;
+
+	# Depenency stuff
+	my $deps_makeinfo;
+	if($has_deps)
+	{
+		if($bsd_make)
+		{
+			$deps_makeinfo = <<'__E';
+.BEGIN::
+.ifndef NODEPS
+.	if $(.TARGETS) == ""
+__E
+		}
+		else
+		{
+			# gnu make
+			$deps_makeinfo = <<'__E';
+.PHONY:	dep_modules
+dep_modules:
+ifndef NODEPS
+ifeq ($(strip $(.TARGETS)),)
+__E
+		}
+		
+		# run make for things we require
+		for my $dep (@all_deps_for_module)
+		{
+			$deps_makeinfo .= "\t\t(cd ../../$dep; \$(MAKE)$sub_make_options \$(DEPENDMAKEFLAGS) -D NODEPS)\n";
+		}
+		$deps_makeinfo .= ".\tendif\n.endif\n\n";
+	}
+	print MAKE $deps_makeinfo if $bsd_make;
+	
+	# get the list of library things to add -- in order of dependency so things link properly
+	my $lib_files = join(' ',map {($_ =~ m/lib\/(.+)\Z/)?('$(OUTBASE)/'.$_.'/'.$1.'.a'):undef} (reverse(@all_deps_for_module)));
+
+	# need to see if the extra makefile fragments require extra object files
+	# or include any more makefiles
+	my @objs = @obj_base;
+	my @makefile_includes;
+	
+	additional_objects_from_make_fragment("$mod/Makefile.extra", \@objs, \@makefile_includes);
+	additional_objects_from_make_fragment("$mod/Makefile.extra.$build_os", \@objs, \@makefile_includes);
+
+	my $o_file_list = join(' ',map {'$(OUTDIR)/'.$_.'.o'} @objs);
+
+	if ($has_deps and not $bsd_make)
+	{
+		print MAKE ".PHONY: all\n" .
+			"all: dep_modules $end_target\n\n";
+	}
+
+	print MAKE $end_target,': ',$o_file_list;
+	print MAKE " ",$lib_files unless $target_is_library;
+	print MAKE "\n";
+	
+	if ($target_windows)
+	{
+		foreach my $dep (@all_deps_for_module)
+		{
+			my $res_list = $module_resources_win32{$dep};
+			next unless $res_list;
+			$o_file_list .= ' '.join(' ', 
+				map {'$(OUTBASE)/'.$dep."/$_"} @$res_list);
+		}
+	}
+
+	# stuff to make the final target...
+	if($target_is_library)
+	{
+		# make a library archive...
+		print MAKE "\t(echo -n > $end_target; rm $end_target)\n";
+		print MAKE "\t\$(AR) -q $end_target $o_file_list\n";
+		print MAKE "\t\$(RANLIB) $end_target\n";
+	}
+	else
+	{
+		# work out library options
+		# need to be... least used first, in absolute order they appear in the modules.txt file
+		my @libops;
+		sub libops_fill
+		{
+			my ($m,$r) = @_;
+			push @$r,$_ for(@{$module_library_link_opts{$m}});
+			libops_fill($_,$r) for(@{$module_dependency{$m}});
+		}
+		libops_fill($mod,\@libops);
+		my $lo = '';
+		my %ldone;
+		for(@libops)
+		{
+			next if exists $ldone{$_};
+			$lo .= ' '.$_;
+			$ldone{$_} = 1;
+		}
+	
+		# link line...
+		print MAKE "\t\$(CXX) $link_line_extra -o $end_target $o_file_list $lib_files$lo $platform_lib_files\n";
+	}
+	# tests need to copy the test file over
+	if($type eq 'test')
+	{
+		print MAKE "\tcp _t \$(OUTDIR)/t\n\tchmod u+x \$(OUTDIR)/t\n";
+		print MAKE "\tcp _t-gdb \$(OUTDIR)/t-gdb\n\tchmod u+x \$(OUTDIR)/t-gdb\n";
+	}
+	# dependency line?
+	print MAKE "\n";
+
+	# module dependencies for GNU make?
+	print MAKE $deps_makeinfo if !$bsd_make;
+	
+	# print the rest of the file
+	print MAKE $make,"\n";
+	
+	# and a clean target
+	print MAKE "clean:\n\t-rm -rf \$(OUTDIR)/*\n.\tifndef SUBCLEAN\n";
+	for my $dep (@all_deps_for_module)
+	{
+		print MAKE "\t(cd ../../$dep; \$(MAKE) \$(DEPENDMAKEFLAGS) -D SUBCLEAN clean)\n";
+	}
+	print MAKE ".\tendif\n";
+	
+	# include any extra stuff
+	print MAKE "\n\n";
+	if(-e "$mod/Makefile.extra")
+	{
+		print MAKE ".include <Makefile.extra>\n\n";
+	}
+	if(-e "$mod/Makefile.extra.$build_os")
+	{
+		print MAKE ".include <Makefile.extra.$build_os>\n\n";
+	}
+	for(@makefile_includes)
+	{
+		print MAKE ".include <$_>\n\n";
+	}
+	
+	# and finally a target for rebuilding the build system
+	print MAKE "\nbuildsystem:\n\t(cd ../..; perl ./infrastructure/makebuildenv.pl $makebuildenv_args)\n\n";
+	
+	close MAKE;
+
+	if(!$bsd_make)
+	{
+		# need to post process this into a GNU makefile
+		open MAKE,">$mod/Makefile";
+		open MAKEB,"$mod/MakefileX";
+
+		while(<MAKEB>)
+		{
+			s/\A\.\s*(ifdef|else|endif|ifndef)/$1/;
+			s/\A\.\s*include\s+<(.+?)>/include $1/;
+			s/-D\s+(\w+)/$1=1/;
+			print MAKE;
+		}
+
+		close MAKEB;
+		close MAKE;
+		unlink "$mod/MakefileX";
+	}
+}
+
+print "\nType 'cd <module_dir>; $make_command' to build a module\n\n";
+
+if($modules_omitted)
+{
+	print "\nNOTE: Some modules have been omitted on this platform\n\n"
+}
+
+sub insert_dep
+{
+	my ($h,$dep_r) = @_;
+	
+	# stop random recusion
+	return if exists $$dep_r{$h};
+	
+	# insert more depencies
+	insert_dep($_,$dep_r) for keys %{$header_dependency{$h}};
+
+	# mark this one as a dependency
+	$$dep_r{$h} = 1;
+}
+
+
+sub additional_objects_from_make_fragment
+{
+	my ($fn,$objs_r,$include_r) = @_;
+	
+	if(-e $fn)
+	{
+		open FL,$fn or die "Can't open $fn";
+		
+		while(<FL>)
+		{
+			chomp;
+			if(m/link-extra:\s*(.+)\Z/)
+			{
+				my @o = split /\s+/,$1;
+				for(@o)
+				{
+					push @$objs_r,$1 if m/\A(.+)\.o\Z/;
+				}
+			}
+			elsif(m/include-makefile:\s*(\S+)/)
+			{
+				push @$include_r,$1
+			}
+		}
+		
+		close FL;
+	}
+}
+
+
+sub ignore_module
+{
+	exists $env_flags{'IGNORE_'.$_[0]}
+}

Modified: box/chris/general/infrastructure/makedistribution.pl
===================================================================
--- box/chris/general/infrastructure/makedistribution.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/infrastructure/makedistribution.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
 use strict;
 use Symbol;
 

Deleted: box/chris/general/infrastructure/makeparcels.pl
===================================================================
--- box/chris/general/infrastructure/makeparcels.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/infrastructure/makeparcels.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,190 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use lib 'infrastructure';
-use BoxPlatform;
-
-my @parcels;
-my %parcel_contents;
-
-open PARCELS,"parcels.txt" or die "Can't open parcels file";
-{
-	my $cur_parcel = '';
-	while(<PARCELS>)
-	{
-		chomp; s/#.+\Z//; s/\s+\Z//; s/\s+/ /g;
-		next unless m/\S/;
-		
-		# omit bits on some platforms?
-		next if m/\AEND-OMIT/;
-		if(m/\AOMIT:(.+)/)
-		{
-			if($1 eq $build_os or $1 eq $target_os)
-			{
-				while(<PARCELS>)
-				{
-					last if m/\AEND-OMIT/;	
-				}
-			}
-			next;
-		}
-
-		if (m'\AONLY:(.+)')
-		{
-			my @only_targets = split m'\,', $1;
-
-			if (not grep {$_ eq $build_os or $_ eq $target_os}
-				@only_targets)
-			{
-				while (<PARCELS>)
-				{
-					last if m'\AEND-ONLY';
-				}
-			}
-			next;
-		}
-		next if (m'\AEND-ONLY');
-		
-		# new parcel, or a new parcel definition?
-		if(m/\A\s+(.+)\Z/)
-		{
-			push @{$parcel_contents{$cur_parcel}},$1
-		}
-		else
-		{
-			$cur_parcel = $_;
-			push @parcels,$_;
-		}
-	}
-}
-close PARCELS;
-
-# create parcels directory
-mkdir "parcels",0755;
-mkdir "parcels/scripts",0755;
-
-# write master makefile
-
-open MAKE,">Makefile" or die "Can't open master Makefile for writing";
-
-print MAKE <<__E;
-#
-# AUTOMATICALLY GENERATED FILE
-#    do not edit!
-#
-#
-
-MAKE = $make_command
-
-__E
-
-print MAKE "all:\t",join(' ',map {parcel_target($_)} @parcels),"\n\n";
-
-print MAKE "clean:\n";
-for my $parcel (@parcels)
-{
-	print MAKE "\trm -rf ",parcel_dir($parcel),"\n";
-	print MAKE "\trm -f ",parcel_target($parcel),"\n";
-}
-print MAKE "\n";
-
-print MAKE "test:\trelease/common/test\n\nrelease/common/test:\n\t./runtest.pl ALL release\n\n";
-
-my $release_flag = BoxPlatform::make_flag('RELEASE');
-
-for my $parcel (@parcels)
-{
-	my $target = parcel_target($parcel);
-	print MAKE $target,":\n";
-	
-	my $dir = parcel_dir($parcel);
-	print MAKE "\ttest -d $dir || mkdir $dir\n";
-	
-	open SCRIPT,">parcels/scripts/install-$parcel" or die "Can't open installer script for $parcel for writing";
-	print SCRIPT "#!/bin/sh\n\n";
-	
-	for(@{$parcel_contents{$parcel}})
-	{
-		my ($type,$name) = split /\s+/;
-		my $optional = '';
-
-		if ($type eq 'optional')
-		{
-			($optional,$type,$name) = split /\s+/;
-		}
-		
-		if($type eq 'bin')
-		{
-			my $exeext = $platform_exe_ext;
-			print MAKE "\t(cd bin/$name; \$(MAKE) $release_flag)\n";
-			print MAKE "\tcp release/bin/$name/$name$exeext $dir\n";
-		}
-		elsif ($type eq 'script')
-		{
-			if ($optional)
-			{
-				print MAKE "\ttest -r $name && cp $name $dir\n";
-			}
-			else
-			{
-				print MAKE "\tcp $name $dir\n";
-			}
-			# remove path from script name
-			$name =~ m~/([^/]+)\Z~;
-			$name = $1;
-		}
-
-		print SCRIPT "install $name $install_into_dir\n";
-	}
-	
-	close SCRIPT;
-	
-	chmod 0755,"parcels/scripts/install-$parcel";
-	
-	my $root = parcel_root($parcel);
-	print MAKE "\tcp parcels/scripts/install-$parcel $dir\n";
-	print MAKE "\t(cd parcels; tar cf - $root | gzip -9 - > $root.tgz )\n";
-	
-	print MAKE "\n";
-	
-	print MAKE "install-$parcel:\n";
-	print MAKE "\t(cd $dir; ./install-$parcel)\n\n";
-}
-
-print MAKE <<__E;
-install:
-	cat local/install.msg
-
-__E
-
-close MAKE;
-
-open INSTALLMSG,">local/install.msg" or die "Can't open install message file for writing";
-print INSTALLMSG <<__E;
-
-Parcels need to be installed separately, and as root. Type one of the following:
-
-__E
-
-for(@parcels)
-{
-	print INSTALLMSG "    $make_command install-".$_."\n";
-}
-print INSTALLMSG "\n";
-
-close INSTALLMSG;
-
-sub parcel_root
-{
-	$product_name.'-'.$product_version.'-'.$_[0].'-'.$target_os
-}
-
-sub parcel_dir
-{
-	'parcels/'.parcel_root($_[0])
-}
-
-sub parcel_target
-{
-	parcel_dir($_[0]).'.tgz'
-}

Copied: box/chris/general/infrastructure/makeparcels.pl.in (from rev 674, box/trunk/infrastructure/makeparcels.pl.in)

Modified: box/chris/general/infrastructure/setupexternal.pl
===================================================================
--- box/chris/general/infrastructure/setupexternal.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/infrastructure/setupexternal.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
 use strict;
 
 # This script links in the essential directories and processes various

Modified: box/chris/general/lib/backupclient/Makefile.extra
===================================================================
--- box/chris/general/lib/backupclient/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/backupclient/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -5,12 +5,12 @@
 
 # AUTOGEN SEEDING
 autogen_BackupProtocolClient.cpp autogen_BackupProtocolClient.h:	$(MAKEPROTOCOL) ../../bin/bbstored/backupprotocol.txt
-	perl $(GEN_CMD_SRV)
+	$(PERL) $(GEN_CMD_SRV)
 
 
 MAKEEXCEPTION = ../../lib/common/makeexception.pl
 
 # AUTOGEN SEEDING
 autogen_BackupStoreException.h autogen_BackupStoreException.cpp:	$(MAKEEXCEPTION) BackupStoreException.txt
-	perl $(MAKEEXCEPTION) BackupStoreException.txt
+	$(PERL) $(MAKEEXCEPTION) BackupStoreException.txt
 


Property changes on: box/chris/general/lib/common
___________________________________________________________________
Name: svn:ignore
   - autogen_CommonException.cpp
autogen_CommonException.h
autogen_ConversionException.cpp
autogen_ConversionException.h
BoxConfig.h
BoxConfig.h.in
Makefile


   + autogen_CommonException.cpp
autogen_CommonException.h
autogen_ConversionException.cpp
autogen_ConversionException.h
BoxConfig.h
BoxConfig.h.in
Makefile
makeexception.pl


Modified: box/chris/general/lib/common/Makefile.extra
===================================================================
--- box/chris/general/lib/common/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/common/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -3,9 +3,9 @@
 
 # AUTOGEN SEEDING
 autogen_CommonException.h autogen_CommonException.cpp:	$(MAKEEXCEPTION) CommonException.txt
-	perl $(MAKEEXCEPTION) CommonException.txt
+	$(PERL) $(MAKEEXCEPTION) CommonException.txt
 
 # AUTOGEN SEEDING
 autogen_ConversionException.h autogen_ConversionException.cpp:	$(MAKEEXCEPTION) ConversionException.txt
-	perl $(MAKEEXCEPTION) ConversionException.txt
+	$(PERL) $(MAKEEXCEPTION) ConversionException.txt
 

Deleted: box/chris/general/lib/common/makeexception.pl
===================================================================
--- box/chris/general/lib/common/makeexception.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/common/makeexception.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,277 +0,0 @@
-#!/usr/bin/perl
-
-# global exception list file
-my $global_list = '../../ExceptionCodes.txt';
-
-
-my @exception;
-my @exception_desc;
-my $class;
-my $class_number;
-
-# read the description!
-
-open EXCEPTION_DESC,$ARGV[0] or die "Can't open $ARGV[0]";
-
-while(<EXCEPTION_DESC>)
-{
-	chomp; s/\A\s+//; s/#.+\Z//; s/\s+\Z//; s/\s+/ /g;
-	next unless m/\S/;
-
-	if(m/\AEXCEPTION\s+(.+)\s+(\d+)\Z/)
-	{
-		$class = $1;
-		$class_number = $2;
-	}
-	else
-	{
-		my ($name,$number,$description) = split /\s+/,$_,3;
-		if($name eq '' || $number =~ m/\D/)
-		{
-			die "Bad line '$_'";
-		}
-		if($exception[$number] ne '')
-		{
-			die "Duplicate exception number $number";
-		}
-		$exception[$number] = $name;
-		$exception_desc[$number] = $description;
-	}
-}
-
-die "Exception class and number not specified" unless $class ne '' && $class_number ne '';
-
-close EXCEPTION_DESC;
-
-# write the code
-print "Generating $class exception...\n";
-
-open CPP,">autogen_${class}Exception.cpp" or die "Can't open cpp file for writing";
-open H,">autogen_${class}Exception.h" or die "Can't open h file for writing";
-
-# write header file
-my $guardname = uc 'AUTOGEN_'.$class.'EXCEPTION_H';
-print H <<__E;
-
-// Auto-generated file -- do not edit
-
-#ifndef $guardname
-#define $guardname
-
-#include "BoxException.h"
-
-// --------------------------------------------------------------------------
-//
-// Class
-//		Name:    ${class}Exception
-//		Purpose: Exception
-//		Created: autogen
-//
-// --------------------------------------------------------------------------
-class ${class}Exception : public BoxException
-{
-public:
-	${class}Exception(unsigned int SubType)
-		: mSubType(SubType)
-	{
-	}
-	
-	${class}Exception(const ${class}Exception &rToCopy)
-		: mSubType(rToCopy.mSubType)
-	{
-	}
-	
-	~${class}Exception() throw ()
-	{
-	}
-	
-	enum
-	{
-		ExceptionType = $class_number
-	};
-
-	enum
-	{
-__E
-
-for(my $e = 0; $e <= $#exception; $e++)
-{
-	if($exception[$e] ne '')
-	{
-		print H "\t\t".$exception[$e].' = '.$e.(($e==$#exception)?'':',')."\n"
-	}
-}
-
-print H <<__E;
-	};
-	
-	virtual unsigned int GetType() const throw();
-	virtual unsigned int GetSubType() const throw();
-	virtual const char *what() const throw();
-
-private:
-	unsigned int mSubType;
-};
-
-#endif // $guardname
-__E
-
-# -----------------------------------------------------------------------------------------------------------
-
-print CPP <<__E;
-
-// Auto-generated file -- do not edit
-
-#include "Box.h"
-#include "autogen_${class}Exception.h"
-
-#include "MemLeakFindOn.h"
-
-#ifdef EXCEPTION_CODENAMES_EXTENDED
-	#ifdef EXCEPTION_CODENAMES_EXTENDED_WITH_DESCRIPTION
-static const char *whats[] = {
-__E
-
-my $last_seen = -1;
-for(my $e = 0; $e <= $#exception; $e++)
-{
-	if($exception[$e] ne '')
-	{
-		for(my $s = $last_seen + 1; $s < $e; $s++)
-		{
-			print CPP "\t\"UNUSED\",\n"
-		}
-		my $ext = ($exception_desc[$e] ne '')?" ($exception_desc[$e])":'';
-		print CPP "\t\"${class} ".$exception[$e].$ext.'"'.(($e==$#exception)?'':',')."\n";
-		$last_seen = $e;
-	}
-}
-
-print CPP <<__E;
-};
-	#else
-static const char *whats[] = {
-__E
-
-$last_seen = -1;
-for(my $e = 0; $e <= $#exception; $e++)
-{
-	if($exception[$e] ne '')
-	{
-		for(my $s = $last_seen + 1; $s < $e; $s++)
-		{
-			print CPP "\t\"UNUSED\",\n"
-		}
-		print CPP "\t\"${class} ".$exception[$e].'"'.(($e==$#exception)?'':',')."\n";
-		$last_seen = $e;
-	}
-}
-
-print CPP <<__E;
-};
-	#endif
-#endif
-
-unsigned int ${class}Exception::GetType() const throw()
-{
-	return ${class}Exception::ExceptionType;
-}
-
-unsigned int ${class}Exception::GetSubType() const throw()
-{
-	return mSubType;
-}
-
-const char *${class}Exception::what() const throw()
-{
-#ifdef EXCEPTION_CODENAMES_EXTENDED
-	if(mSubType < 0 || mSubType > (sizeof(whats) / sizeof(whats[0])))
-	{
-		return "${class}";
-	}
-	return whats[mSubType];
-#else
-	return "${class}";
-#endif
-}
-
-__E
-
-close H;
-close CPP;
-
-# update the global exception list
-my $list_before;
-my $list_after;
-my $is_after = 0;
-if(open CURRENT,$global_list)
-{
-	while(<CURRENT>)
-	{
-		next if m/\A#/;
-		
-		if(m/\AEXCEPTION TYPE (\w+) (\d+)/)
-		{
-			# check that the number isn't being reused
-			if($2 == $class_number && $1 ne $class)
-			{
-				die "Class number $class_number is being used by $class and $1 -- correct this.\n";
-			}
-			if($2 > $class_number)
-			{
-				# This class comes after the current one (ensures numerical ordering)
-				$is_after = 1;
-			}
-			if($1 eq $class)
-			{
-				# skip this entry
-				while(<CURRENT>)
-				{
-					last if m/\AEND TYPE/;
-				}
-				$_ = '';
-			}
-		}
-		
-		if($is_after)
-		{
-			$list_after .= $_;
-		}
-		else
-		{
-			$list_before .= $_;
-		}
-	}
-
-	close CURRENT;
-}
-
-open GLOBAL,">$global_list" or die "Can't open global exception code listing for writing";
-
-print GLOBAL <<__E;
-#
-# automatically generated file, do not edit.
-#
-# This file lists all the exception codes used by the system.
-# Use to look up more detailed descriptions of meanings of errors.
-#
-__E
-
-print GLOBAL $list_before;
-
-print GLOBAL "EXCEPTION TYPE $class $class_number\n";
-for(my $e = 0; $e <= $#exception; $e++)
-{
-	if($exception[$e] ne '')
-	{
-		my $ext = ($exception_desc[$e] ne '')?" - $exception_desc[$e]":'';
-		print GLOBAL "($class_number/$e) - ${class} ".$exception[$e].$ext."\n";
-	}
-}
-print GLOBAL "END TYPE\n";
-
-print GLOBAL $list_after;
-
-close GLOBAL;
-
-

Copied: box/chris/general/lib/common/makeexception.pl.in (from rev 674, box/trunk/lib/common/makeexception.pl.in)

Modified: box/chris/general/lib/compress/Makefile.extra
===================================================================
--- box/chris/general/lib/compress/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/compress/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -3,5 +3,5 @@
 
 # AUTOGEN SEEDING
 autogen_CompressException.h autogen_CompressException.cpp:	$(MAKEEXCEPTION) CompressException.txt
-	perl $(MAKEEXCEPTION) CompressException.txt
+	$(PERL) $(MAKEEXCEPTION) CompressException.txt
 

Modified: box/chris/general/lib/crypto/Makefile.extra
===================================================================
--- box/chris/general/lib/crypto/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/crypto/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -3,5 +3,5 @@
 
 # AUTOGEN SEEDING
 autogen_CipherException.cpp autogen_CipherException.h:	$(MAKEEXCEPTION) CipherException.txt
-	perl $(MAKEEXCEPTION) CipherException.txt
+	$(PERL) $(MAKEEXCEPTION) CipherException.txt
 


Property changes on: box/chris/general/lib/raidfile
___________________________________________________________________
Name: svn:ignore
   - autogen_RaidFileException.cpp
autogen_RaidFileException.h
Makefile

   + autogen_RaidFileException.cpp
autogen_RaidFileException.h
Makefile
raidfile-config


Modified: box/chris/general/lib/raidfile/Makefile.extra
===================================================================
--- box/chris/general/lib/raidfile/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/raidfile/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -3,5 +3,5 @@
 
 # AUTOGEN SEEDING
 autogen_RaidFileException.h autogen_RaidFileException.cpp:	$(MAKEEXCEPTION) RaidFileException.txt
-	perl $(MAKEEXCEPTION) RaidFileException.txt
+	$(PERL) $(MAKEEXCEPTION) RaidFileException.txt
 

Deleted: box/chris/general/lib/raidfile/raidfile-config
===================================================================
--- box/chris/general/lib/raidfile/raidfile-config	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/raidfile/raidfile-config	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,97 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-# should be running as root
-if($> != 0)
-{
-	printf "\nWARNING: this should be run as root\n\n"
-}
-
-# check and get command line parameters
-if($#ARGV != 4 && $#ARGV != 2)
-{
-	print <<__E;
-
-Setup raidfile config utility.
-
-Bad command line parameters.
-Usage:
-	raidfile-config config-dir block-size dir0 [dir1 dir2]
-
-config-dir usually /etc/box
-block-size must be a power of two, and usually the block or fragment size of your filing system
-dir0, dir1, dir2 are the directories used as the root of the raid file system
-
-If only one directory is specified, then userland RAID is disabled. Specifying three directories
-enables it.
-
-__E
-	exit(1);
-}
-
-my ($config_dir,$block_size, at dirs) = @ARGV;
-
-my $conf = $config_dir . '/raidfile.conf';
-
-# check dirs are unique, and exist
-my %d;
-for(@dirs)
-{
-	die "$_ is used twice" if exists $d{$_};
-	die "$_ is not a directory" unless -d $_;
-	die "$_ should be an absolute path" unless m/\A\//;
-	$d{$_} = 1;
-}
-
-# check block size is OK
-$block_size = int($block_size);
-die "Bad block size" if $block_size <= 0;
-my $c = 1;
-while(1)
-{
-	last if $c == $block_size;
-	die "Block size $block_size is not a power of two" if $c > $block_size;
-	$c = $c * 2;
-}
-
-# check that it doesn't already exist
-if(-f $conf)
-{
-	die "$conf already exists. Delete and try again"
-}
-
-# create directory
-if(!-d $config_dir)
-{
-	print "Creating $config_dir...\n";
-	mkdir $config_dir,0755 or die "Can't create $config_dir";
-}
-
-# adjust if userland RAID is disabled
-if($#dirs == 0)
-{
-	$dirs[1] = $dirs[0];
-	$dirs[2] = $dirs[0];
-	print "WARNING: userland RAID is disabled.\n"
-}
-
-# write the file
-open CONFIG,">$conf" or die "Can't open $conf for writing";
-
-print CONFIG <<__E;
-
-disc0
-{
-	SetNumber = 0
-	BlockSize = $block_size
-	Dir0 = $dirs[0]
-	Dir1 = $dirs[1]
-	Dir2 = $dirs[2]
-}
-
-__E
-
-close CONFIG;
-
-print "Config file written.\n";
-

Copied: box/chris/general/lib/raidfile/raidfile-config.in (from rev 674, box/trunk/lib/raidfile/raidfile-config.in)


Property changes on: box/chris/general/lib/server
___________________________________________________________________
Name: svn:ignore
   - autogen_ConnectionException.cpp
autogen_ConnectionException.h
autogen_ServerException.cpp
autogen_ServerException.h
Makefile

   + autogen_ConnectionException.cpp
autogen_ConnectionException.h
autogen_ServerException.cpp
autogen_ServerException.h
Makefile
makeprotocol.pl


Modified: box/chris/general/lib/server/Makefile.extra
===================================================================
--- box/chris/general/lib/server/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/server/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -3,9 +3,9 @@
 
 # AUTOGEN SEEDING
 autogen_ServerException.h autogen_ServerException.cpp:	$(MAKEEXCEPTION) ServerException.txt
-	perl $(MAKEEXCEPTION) ServerException.txt
+	$(PERL) $(MAKEEXCEPTION) ServerException.txt
 
 # AUTOGEN SEEDING
 autogen_ConnectionException.h autogen_ConnectionException.cpp:	$(MAKEEXCEPTION) ConnectionException.txt
-	perl $(MAKEEXCEPTION) ConnectionException.txt
+	$(PERL) $(MAKEEXCEPTION) ConnectionException.txt
 

Deleted: box/chris/general/lib/server/makeprotocol.pl
===================================================================
--- box/chris/general/lib/server/makeprotocol.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/lib/server/makeprotocol.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,1007 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-use lib "../../infrastructure";
-use BoxPlatform;
-
-# Make protocol C++ classes from a protocol description file
-
-# built in type info (values are is basic type, C++ typename)
-# may get stuff added to it later if protocol uses extra types
-my %translate_type_info =
-(
-	'int64' => [1, 'int64_t'],
-	'int32' => [1, 'int32_t'],
-	'int16' => [1, 'int16_t'],
-	'int8' => [1, 'int8_t'],
-	'bool' => [1, 'bool'],
-	'string' => [0, 'std::string']
-);
-
-# built in instructions for logging various types
-# may be added to
-my %log_display_types = 
-(
-	'int64' => ['0x%llx', 'VAR'],
-	'int32' => ['0x%x', 'VAR'],
-	'int16' => ['0x%x', 'VAR'],
-	'int8' => ['0x%x', 'VAR'],
-	'bool' => ['%s', '((VAR)?"true":"false")'],
-	'string' => ['%s', 'VAR.c_str()']
-);
-
-
-
-my ($type, $file) = @ARGV;
-
-if($type ne 'Server' && $type ne 'Client')
-{
-	die "Neither Server or Client is specified on command line\n";
-}
-
-open IN, $file or die "Can't open input file $file\n";
-
-print "Making $type protocol classes from $file...\n";
-
-my @extra_header_files;
-
-my $implement_syslog = 0;
-my $implement_filelog = 0;
-
-# read attributes
-my %attr;
-while(<IN>)
-{
-	# get and clean line
-	my $l = $_; $l =~ s/#.*\Z//; $l =~ s/\A\s+//; $l =~ s/\s+\Z//; next unless $l =~ m/\S/;
-	
-	last if $l eq 'BEGIN_OBJECTS';
-	
-	my ($k,$v) = split /\s+/,$l,2;
-	
-	if($k eq 'ClientType')
-	{
-		add_type($v) if $type eq 'Client';
-	}
-	elsif($k eq 'ServerType')
-	{
-		add_type($v) if $type eq 'Server';
-	}
-	elsif($k eq 'ImplementLog')
-	{
-		my ($log_if_type,$log_type) = split /\s+/,$v;
-		if($type eq $log_if_type)
-		{
-			if($log_type eq 'syslog')
-			{
-				$implement_syslog = 1;
-			}
-			elsif($log_type eq 'file')
-			{
-				$implement_filelog = 1;
-			}
-			else
-			{
-				printf("ERROR: Unknown log type for implementation: $log_type\n");
-				exit(1);
-			}
-		}
-	}
-	elsif($k eq 'LogTypeToText')
-	{
-		my ($log_if_type,$type_name,$printf_format,$arg_template) = split /\s+/,$v;
-		if($type eq $log_if_type)
-		{
-			$log_display_types{$type_name} = [$printf_format,$arg_template]
-		}
-	}
-	else
-	{
-		$attr{$k} = $v;
-	}
-}
-
-sub add_type
-{
-	my ($protocol_name, $cpp_name, $header_file) = split /\s+/,$_[0];
-	
-	$translate_type_info{$protocol_name} = [0, $cpp_name];
-	push @extra_header_files, $header_file;
-}
-
-# check attributes
-for(qw/Name ServerContextClass IdentString/)
-{
-	if(!exists $attr{$_})
-	{
-		die "Attribute $_ is required, but not specified\n";
-	}
-}
-
-my $protocol_name = $attr{'Name'};
-my ($context_class, $context_class_inc) = split /\s+/,$attr{'ServerContextClass'};
-my $ident_string = $attr{'IdentString'};
-
-my $current_cmd = '';
-my %cmd_contents;
-my %cmd_attributes;
-my %cmd_constants;
-my %cmd_id;
-my @cmd_list;
-
-# read in the command definitions
-while(<IN>)
-{
-	# get and clean line
-	my $l = $_; $l =~ s/#.*\Z//; $l =~ s/\s+\Z//; next unless $l =~ m/\S/;
-	
-	# definitions or new command thing?
-	if($l =~ m/\A\s+/)
-	{
-		die "No command defined yet" if $current_cmd eq '';
-	
-		# definition of component
-		$l =~ s/\A\s+//;
-		
-		my ($type,$name,$value) = split /\s+/,$l;
-		if($type eq 'CONSTANT')
-		{
-			push @{$cmd_constants{$current_cmd}},"$name = $value"
-		}
-		else
-		{
-			push @{$cmd_contents{$current_cmd}},$type,$name;
-		}
-	}
-	else
-	{
-		# new command
-		my ($name,$id, at attributes) = split /\s+/,$l;
-		$cmd_attributes{$name} = [@attributes];
-		$cmd_id{$name} = int($id);
-		$current_cmd = $name;
-		push @cmd_list,$name;
-	}
-}
-
-close IN;
-
-
-
-# open files
-my $h_filename = 'autogen_'.$protocol_name.'Protocol'.$type.'.h';
-open CPP,'>autogen_'.$protocol_name.'Protocol'.$type.'.cpp';
-open H,">$h_filename";
-
-print CPP <<__E;
-
-// Auto-generated file -- do not edit
-
-#include "Box.h"
-#include "$h_filename"
-#include "IOStream.h"
-
-__E
-
-if($implement_syslog)
-{
-	print H <<EOF;
-#ifndef WIN32
-#include <syslog.h>
-#endif
-EOF
-}
-
-
-my $guardname = uc 'AUTOGEN_'.$protocol_name.'Protocol'.$type.'_H';
-print H <<__E;
-
-// Auto-generated file -- do not edit
-
-#ifndef $guardname
-#define $guardname
-
-#include "Protocol.h"
-#include "ProtocolObject.h"
-#include "ServerException.h"
-
-class IOStream;
-
-__E
-
-if($implement_filelog)
-{
-	print H qq~#include <stdio.h>\n~;
-}
-
-# extra headers
-for(@extra_header_files)
-{
-	print H qq~#include "$_"\n~
-}
-print H "\n";
-
-if($type eq 'Server')
-{
-	# need utils file for the server
-	print H '#include "Utils.h"',"\n\n"
-}
-
-
-my $derive_objects_from = 'ProtocolObject';
-my $objects_extra_h = '';
-my $objects_extra_cpp = '';
-if($type eq 'Server')
-{
-	# define the context
-	print H "class $context_class;\n\n";
-	print CPP "#include \"$context_class_inc\"\n\n";
-	
-	# change class we derive the objects from
-	$derive_objects_from = $protocol_name.'ProtocolObject';
-	
-	$objects_extra_h = <<__E;
-	virtual std::auto_ptr<ProtocolObject> DoCommand(${protocol_name}ProtocolServer &rProtocol, $context_class &rContext);
-__E
-	$objects_extra_cpp = <<__E;
-std::auto_ptr<ProtocolObject> ${derive_objects_from}::DoCommand(${protocol_name}ProtocolServer &rProtocol, $context_class &rContext)
-{
-	THROW_EXCEPTION(ConnectionException, Conn_Protocol_TriedToExecuteReplyCommand)
-}
-__E
-}
-
-print CPP qq~#include "MemLeakFindOn.h"\n~;
-
-if($type eq 'Client' && ($implement_syslog || $implement_filelog))
-{
-	# change class we derive the objects from
-	$derive_objects_from = $protocol_name.'ProtocolObjectCl';
-}
-if($implement_syslog)
-{
-	$objects_extra_h .= <<__E;
-	virtual void LogSysLog(const char *Action) const = 0;
-__E
-}
-if($implement_filelog)
-{
-	$objects_extra_h .= <<__E;
-	virtual void LogFile(const char *Action, FILE *file) const = 0;
-__E
-}
-
-if($derive_objects_from ne 'ProtocolObject')
-{	
-	# output a definition for the protocol object derviced class
-	print H <<__E;
-class ${protocol_name}ProtocolServer;
-	
-class $derive_objects_from : public ProtocolObject
-{
-public:
-	$derive_objects_from();
-	virtual ~$derive_objects_from();
-	$derive_objects_from(const $derive_objects_from &rToCopy);
-	
-$objects_extra_h
-};
-__E
-
-	# and some cpp definitions
-	print CPP <<__E;
-${derive_objects_from}::${derive_objects_from}()
-{
-}
-${derive_objects_from}::~${derive_objects_from}()
-{
-}
-${derive_objects_from}::${derive_objects_from}(const $derive_objects_from &rToCopy)
-{
-}
-$objects_extra_cpp
-__E
-}
-
-
-
-my $classname_base = $protocol_name.'Protocol'.$type;
-
-# output the classes
-for my $cmd (@cmd_list)
-{
-	print H <<__E;
-class $classname_base$cmd : public $derive_objects_from
-{
-public:
-	$classname_base$cmd();
-	$classname_base$cmd(const $classname_base$cmd &rToCopy);
-	~$classname_base$cmd();
-	int GetType() const;
-	enum
-	{
-		TypeID = $cmd_id{$cmd}
-	};
-__E
-	# constants
-	if(exists $cmd_constants{$cmd})
-	{
-		print H "\tenum\n\t{\n\t\t";
-		print H join(",\n\t\t",@{$cmd_constants{$cmd}});
-		print H "\n\t};\n";
-	}
-	# flags
-	if(obj_is_type($cmd,'EndsConversation'))
-	{
-		print H "\tbool IsConversationEnd() const;\n";
-	}
-	if(obj_is_type($cmd,'IsError'))
-	{
-		print H "\tbool IsError(int &rTypeOut, int &rSubTypeOut) const;\n";
-	}
-	if($type eq 'Server' && obj_is_type($cmd, 'Command'))
-	{
-		print H "\tstd::auto_ptr<ProtocolObject> DoCommand(${protocol_name}ProtocolServer &rProtocol, $context_class &rContext); // IMPLEMENT THIS\n"
-	}
-
-	# want to be able to read from streams?
-	my $read_from_streams = (obj_is_type($cmd,'Command') && $type eq 'Server') || (obj_is_type($cmd,'Reply') && $type eq 'Client');
-	my $write_to_streams = (obj_is_type($cmd,'Command') && $type eq 'Client') || (obj_is_type($cmd,'Reply') && $type eq 'Server');
-	
-	if($read_from_streams)
-	{
-		print H "\tvoid SetPropertiesFromStreamData(Protocol &rProtocol);\n";
-		
-		# write Get functions
-		for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
-		{
-			my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-			
-			print H "\t".translate_type_to_arg_type($ty)." Get$nm() {return m$nm;}\n";
-		}
-	}
-	my $param_con_args = '';
-	if($write_to_streams)
-	{
-		# extra constructor?
-		if($#{$cmd_contents{$cmd}} >= 0)
-		{
-			my @a;
-			for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
-			{
-				my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-
-				push @a,translate_type_to_arg_type($ty)." $nm";
-			}		
-			$param_con_args = join(', ', at a);
-			print H "\t$classname_base$cmd(".$param_con_args.");\n";
-		}
-		print H "\tvoid WritePropertiesToStreamData(Protocol &rProtocol) const;\n";
-		# set functions
-		for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
-		{
-			my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-			
-			print H "\tvoid Set$nm(".translate_type_to_arg_type($ty)." $nm) {m$nm = $nm;}\n";
-		}
-	}
-	
-	if($implement_syslog)
-	{
-		print H "\tvirtual void LogSysLog(const char *Action) const;\n";
-	}
-	if($implement_filelog)
-	{
-		print H "\tvirtual void LogFile(const char *Action, FILE *file) const;\n";
-	}
-
-	
-	# write member variables and setup for cpp file
-	my @def_constructor_list;
-	my @copy_constructor_list;
-	my @param_constructor_list;
-	
-	print H "private:\n";
-	for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
-	{
-		my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-
-		print H "\t".translate_type_to_member_type($ty)." m$nm;\n";
-		
-		my ($basic,$typename) = translate_type($ty);
-		if($basic)
-		{
-			push @def_constructor_list, "m$nm(0)";
-		}
-		push @copy_constructor_list, "m$nm(rToCopy.m$nm)";
-		push @param_constructor_list, "m$nm($nm)";
-	}
-	
-	# finish off
-	print H "};\n\n";
-	
-	# now the cpp file...
-	my $def_con_vars = join(",\n\t  ", at def_constructor_list);
-	$def_con_vars = "\n\t: ".$def_con_vars if $def_con_vars ne '';
-	my $copy_con_vars = join(",\n\t  ", at copy_constructor_list);
-	$copy_con_vars = "\n\t: ".$copy_con_vars if $copy_con_vars ne '';
-	my $param_con_vars = join(",\n\t  ", at param_constructor_list);
-	$param_con_vars = "\n\t: ".$param_con_vars if $param_con_vars ne '';
-
-	my $class = "$classname_base$cmd".'::';
-	print CPP <<__E;
-$class$classname_base$cmd()$def_con_vars
-{
-}
-$class$classname_base$cmd(const $classname_base$cmd &rToCopy)$copy_con_vars
-{
-}
-$class~$classname_base$cmd()
-{
-}
-int ${class}GetType() const
-{
-	return $cmd_id{$cmd};
-}
-__E
-	if($read_from_streams)
-	{
-		print CPP "void ${class}SetPropertiesFromStreamData(Protocol &rProtocol)\n{\n";
-		for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
-		{
-			my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-			if($ty =~ m/\Avector/)
-			{
-				print CPP "\trProtocol.ReadVector(m$nm);\n";
-			}
-			else
-			{
-				print CPP "\trProtocol.Read(m$nm);\n";
-			}
-		}
-		print CPP "}\n";
-	}
-	if($write_to_streams)
-	{
-		# implement extra constructor?
-		if($param_con_vars ne '')
-		{
-			print CPP "$class$classname_base$cmd($param_con_args)$param_con_vars\n{\n}\n";
-		}
-		print CPP "void ${class}WritePropertiesToStreamData(Protocol &rProtocol) const\n{\n";
-		for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
-		{
-			my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-			if($ty =~ m/\Avector/)
-			{
-				print CPP "\trProtocol.WriteVector(m$nm);\n";
-			}
-			else
-			{
-				print CPP "\trProtocol.Write(m$nm);\n";
-			}
-		}
-		print CPP "}\n";
-	}
-	if(obj_is_type($cmd,'EndsConversation'))
-	{
-		print CPP "bool ${class}IsConversationEnd() const\n{\n\treturn true;\n}\n";
-	}
-	if(obj_is_type($cmd,'IsError'))
-	{
-		# get parameters
-		my ($mem_type,$mem_subtype) = split /,/,obj_get_type_params($cmd,'IsError');
-		print CPP <<__E;
-bool ${class}IsError(int &rTypeOut, int &rSubTypeOut) const
-{
-	rTypeOut = m$mem_type;
-	rSubTypeOut = m$mem_subtype;
-	return true;
-}
-__E
-	}
-
-	if($implement_syslog)
-	{
-		my ($format,$args) = make_log_strings($cmd);
-		print CPP <<__E;
-void ${class}LogSysLog(const char *Action) const
-{
-	::syslog(LOG_INFO,"%s $format",Action$args);
-}
-__E
-	}
-	if($implement_filelog)
-	{
-		my ($format,$args) = make_log_strings($cmd);
-		print CPP <<__E;
-void ${class}LogFile(const char *Action, FILE *File) const
-{
-	::fprintf(File,"%s $format\\n",Action$args);
-	::fflush(File);
-}
-__E
-	}
-}
-
-# finally, the protocol object itself
-print H <<__E;
-class $classname_base : public Protocol
-{
-public:
-	$classname_base(IOStream &rStream);
-	virtual ~$classname_base();
-
-	std::auto_ptr<$derive_objects_from> Receive();
-	void Send(const ${derive_objects_from} &rObject);
-__E
-if($implement_syslog)
-{
-	print H "\tvoid SetLogToSysLog(bool Log = false) {mLogToSysLog = Log;}\n";
-}
-if($implement_filelog)
-{
-	print H "\tvoid SetLogToFile(FILE *File = 0) {mLogToFile = File;}\n";
-}
-if($type eq 'Server')
-{
-	# need to put in the conversation function
-	print H "\tvoid DoServer($context_class &rContext);\n\n";
-	# and the send vector thing
-	print H "\tvoid SendStreamAfterCommand(IOStream *pStream);\n\n";
-}
-if($type eq 'Client')
-{
-	# add plain object taking query functions
-	my $with_params;
-	for my $cmd (@cmd_list)
-	{
-		if(obj_is_type($cmd,'Command'))
-		{
-			my $has_stream = obj_is_type($cmd,'StreamWithCommand');
-			my $argextra = $has_stream?', IOStream &rStream':'';
-			my $queryextra = $has_stream?', rStream':'';
-			my $reply = obj_get_type_params($cmd,'Command');
-			print H "\tstd::auto_ptr<$classname_base$reply> Query(const $classname_base$cmd &rQuery$argextra);\n";
-			my @a;
-			my @na;
-			for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
-			{
-				my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-				push @a,translate_type_to_arg_type($ty)." $nm";
-				push @na,"$nm";
-			}
-			my $ar = join(', ', at a);
-			my $nar = join(', ', at na);
-			$nar = "($nar)" if $nar ne '';
-
-			$with_params .= "\tinline std::auto_ptr<$classname_base$reply> Query$cmd($ar$argextra)\n\t{\n";
-			$with_params .= "\t\t$classname_base$cmd send$nar;\n";
-			$with_params .= "\t\treturn Query(send$queryextra);\n";
-			$with_params .= "\t}\n";
-		}
-	}
-	# quick hack to correct bad argument lists for commands with zero paramters but with streams
-	$with_params =~ s/\(, /(/g;
-	print H "\n",$with_params,"\n";
-}
-print H <<__E;
-private:
-	$classname_base(const $classname_base &rToCopy);
-__E
-if($type eq 'Server')
-{
-	# need to put the streams to send vector
-	print H "\tstd::vector<IOStream*> mStreamsToSend;\n\tvoid DeleteStreamsToSend();\n";
-}
-
-if($implement_filelog || $implement_syslog)
-{
-	print H <<__E;
-	virtual void InformStreamReceiving(u_int32_t Size);
-	virtual void InformStreamSending(u_int32_t Size);
-__E
-}
-
-if($implement_syslog)
-{
-	print H "private:\n\tbool mLogToSysLog;\n";
-}
-if($implement_filelog)
-{
-	print H "private:\n\tFILE *mLogToFile;\n";
-}
-print H <<__E;
-
-protected:	
-	virtual std::auto_ptr<ProtocolObject> MakeProtocolObject(int ObjType);
-	virtual const char *GetIdentString();
-};
-
-__E
-
-my $construtor_extra = '';
-$construtor_extra .= ', mLogToSysLog(false)' if $implement_syslog;
-$construtor_extra .= ', mLogToFile(0)' if $implement_filelog;
-
-my $destructor_extra = ($type eq 'Server')?"\n\tDeleteStreamsToSend();":'';
-
-my $prefix = $classname_base.'::';
-print CPP <<__E;
-$prefix$classname_base(IOStream &rStream)
-	: Protocol(rStream)$construtor_extra
-{
-}
-$prefix~$classname_base()
-{$destructor_extra
-}
-const char *${prefix}GetIdentString()
-{
-	return "$ident_string";
-}
-std::auto_ptr<ProtocolObject> ${prefix}MakeProtocolObject(int ObjType)
-{
-	switch(ObjType)
-	{
-__E
-
-# do objects within this
-for my $cmd (@cmd_list)
-{
-	print CPP <<__E;
-	case $cmd_id{$cmd}:
-		return std::auto_ptr<ProtocolObject>(new $classname_base$cmd);
-		break;
-__E
-}
-
-print CPP <<__E;
-	default:
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnknownCommandRecieved)
-	}
-}
-__E
-# write receieve and send functions
-print CPP <<__E;
-std::auto_ptr<$derive_objects_from> ${prefix}Receive()
-{
-	std::auto_ptr<${derive_objects_from}> preply((${derive_objects_from}*)(Protocol::Receive().release()));
-
-__E
-	if($implement_syslog)
-	{
-		print CPP <<__E;
-	if(mLogToSysLog)
-	{
-		preply->LogSysLog("Receive");
-	}
-__E
-	}
-	if($implement_filelog)
-	{
-		print CPP <<__E;
-	if(mLogToFile != 0)
-	{
-		preply->LogFile("Receive", mLogToFile);
-	}
-__E
-	}
-print CPP <<__E;
-
-	return preply;
-}
-
-void ${prefix}Send(const ${derive_objects_from} &rObject)
-{
-__E
-	if($implement_syslog)
-	{
-		print CPP <<__E;
-	if(mLogToSysLog)
-	{
-		rObject.LogSysLog("Send");
-	}
-__E
-	}
-	if($implement_filelog)
-	{
-		print CPP <<__E;
-	if(mLogToFile != 0)
-	{
-		rObject.LogFile("Send", mLogToFile);
-	}
-__E
-	}
-
-print CPP <<__E;
-	Protocol::Send(rObject);
-}
-
-__E
-# write server function?
-if($type eq 'Server')
-{
-	print CPP <<__E;
-void ${prefix}DoServer($context_class &rContext)
-{
-	// Handshake with client
-	Handshake();
-
-	// Command processing loop
-	bool inProgress = true;
-	while(inProgress)
-	{
-		// Get an object from the conversation
-		std::auto_ptr<${derive_objects_from}> pobj(Receive());
-
-__E
-	if($implement_syslog)
-	{
-		print CPP <<__E;
-		if(mLogToSysLog)
-		{
-			pobj->LogSysLog("Receive");
-		}
-__E
-	}
-	if($implement_filelog)
-	{
-		print CPP <<__E;
-		if(mLogToFile != 0)
-		{
-			pobj->LogFile("Receive", mLogToFile);
-		}
-__E
-	}
-	print CPP <<__E;
-
-		// Run the command
-		std::auto_ptr<${derive_objects_from}> preply((${derive_objects_from}*)(pobj->DoCommand(*this, rContext).release()));
-		
-__E
-	if($implement_syslog)
-	{
-		print CPP <<__E;
-		if(mLogToSysLog)
-		{
-			preply->LogSysLog("Send");
-		}
-__E
-	}
-	if($implement_filelog)
-	{
-		print CPP <<__E;
-		if(mLogToFile != 0)
-		{
-			preply->LogFile("Send", mLogToFile);
-		}
-__E
-	}
-	print CPP <<__E;
-
-		// Send the reply
-		Send(*(preply.get()));
-
-		// Send any streams
-		for(unsigned int s = 0; s < mStreamsToSend.size(); s++)
-		{
-			// Send the streams
-			SendStream(*mStreamsToSend[s]);
-		}
-		// Delete these streams
-		DeleteStreamsToSend();
-
-		// Does this end the conversation?
-		if(pobj->IsConversationEnd())
-		{
-			inProgress = false;
-		}
-	}	
-}
-
-void ${prefix}SendStreamAfterCommand(IOStream *pStream)
-{
-	ASSERT(pStream != NULL);
-	mStreamsToSend.push_back(pStream);
-}
-
-void ${prefix}DeleteStreamsToSend()
-{
-	for(std::vector<IOStream*>::iterator i(mStreamsToSend.begin()); i != mStreamsToSend.end(); ++i)
-	{
-		delete (*i);
-	}
-	mStreamsToSend.clear();
-}
-
-__E
-}
-
-# write logging functions?
-if($implement_filelog || $implement_syslog)
-{
-	my ($fR,$fS);
-
-	if($implement_syslog)
-	{
-		$fR .= qq~\tif(mLogToSysLog) { ::syslog(LOG_INFO, (Size==Protocol::ProtocolStream_SizeUncertain)?"Receiving stream, size uncertain":"Receiving stream, size %d", Size); }\n~;
-		$fS .= qq~\tif(mLogToSysLog) { ::syslog(LOG_INFO, (Size==Protocol::ProtocolStream_SizeUncertain)?"Sending stream, size uncertain":"Sending stream, size %d", Size); }\n~;
-	}
-	if($implement_filelog)
-	{
-		$fR .= qq~\tif(mLogToFile) { ::fprintf(mLogToFile, (Size==Protocol::ProtocolStream_SizeUncertain)?"Receiving stream, size uncertain":"Receiving stream, size %d\\n", Size); ::fflush(mLogToFile); }\n~;
-		$fS .= qq~\tif(mLogToFile) { ::fprintf(mLogToFile, (Size==Protocol::ProtocolStream_SizeUncertain)?"Sending stream, size uncertain":"Sending stream, size %d\\n", Size); ::fflush(mLogToFile); }\n~;
-	}
-
-	print CPP <<__E;
-
-void ${prefix}InformStreamReceiving(u_int32_t Size)
-{
-$fR}
-
-void ${prefix}InformStreamSending(u_int32_t Size)
-{
-$fS}
-
-__E
-}
-
-
-# write client Query functions?
-if($type eq 'Client')
-{
-	for my $cmd (@cmd_list)
-	{
-		if(obj_is_type($cmd,'Command'))
-		{
-			my $reply = obj_get_type_params($cmd,'Command');
-			my $reply_id = $cmd_id{$reply};
-			my $has_stream = obj_is_type($cmd,'StreamWithCommand');
-			my $argextra = $has_stream?', IOStream &rStream':'';
-			my $send_stream_extra = '';
-			if($has_stream)
-			{
-				$send_stream_extra = <<__E;
-	
-	// Send stream after the command
-	SendStream(rStream);
-__E
-			}
-			print CPP <<__E;
-std::auto_ptr<$classname_base$reply> ${classname_base}::Query(const $classname_base$cmd &rQuery$argextra)
-{
-	// Send query
-	Send(rQuery);
-	$send_stream_extra
-	// Wait for the reply
-	std::auto_ptr<${derive_objects_from}> preply(Receive().release());
-
-	if(preply->GetType() == $reply_id)
-	{
-		// Correct response
-		return std::auto_ptr<$classname_base$reply>(($classname_base$reply*)preply.release());
-	}
-	else
-	{
-		// Set protocol error
-		int type, subType;
-		if(preply->IsError(type, subType))
-		{
-			SetError(type, subType);
-			TRACE2("Protocol: Error received %d/%d\\n", type, subType);
-		}
-		else
-		{
-			SetError(Protocol::UnknownError, Protocol::UnknownError);
-		}
-		
-		// Throw an exception
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnexpectedReply)
-	}
-}
-__E
-		}
-	}
-}
-
-
-
-print H <<__E;
-#endif // $guardname
-
-__E
-
-# close files
-close H;
-close CPP;
-
-
-sub obj_is_type
-{
-	my ($c,$ty) = @_;
-	for(@{$cmd_attributes{$c}})
-	{
-		return 1 if $_ =~ m/\A$ty/;
-	}
-	
-	return 0;
-}
-
-sub obj_get_type_params
-{
-	my ($c,$ty) = @_;
-	for(@{$cmd_attributes{$c}})
-	{
-		return $1 if $_ =~ m/\A$ty\((.+?)\)\Z/;
-	}
-	die "Can't find attribute $ty\n"
-}
-
-# returns (is basic type, typename)
-sub translate_type
-{
-	my $ty = $_[0];
-	
-	if($ty =~ m/\Avector\<(.+?)\>\Z/)
-	{
-		my $v_type = $1;
-		my (undef,$v_ty) = translate_type($v_type);
-		return (0, 'std::vector<'.$v_ty.'>')
-	}
-	else
-	{
-		if(!exists $translate_type_info{$ty})
-		{
-			die "Don't know about type name $ty\n";
-		}
-		return @{$translate_type_info{$ty}}
-	}
-}
-
-sub translate_type_to_arg_type
-{
-	my ($basic,$typename) = translate_type(@_);
-	return $basic?$typename:'const '.$typename.'&'
-}
-
-sub translate_type_to_member_type
-{
-	my ($basic,$typename) = translate_type(@_);
-	return $typename
-}
-
-sub make_log_strings
-{
-	my ($cmd) = @_;
-
-	my @str;
-	my @arg;
-	for(my $x = 0; $x < $#{$cmd_contents{$cmd}}; $x+=2)
-	{
-		my ($ty,$nm) = (${$cmd_contents{$cmd}}[$x], ${$cmd_contents{$cmd}}[$x+1]);
-		
-		if(exists $log_display_types{$ty})
-		{
-			# need to translate it
-			my ($format,$arg) = @{$log_display_types{$ty}};
-			$arg =~ s/VAR/m$nm/g;
-
-			if ($format eq "0x%llx" and $target_windows)
-			{
-				$format = "0x%I64x";
-				$arg = "(uint64_t)$arg";
-			}
-
-			push @str,$format;
-			push @arg,$arg;
-		}
-		else
-		{
-			# is opaque
-			push @str,'OPAQUE';
-		}
-	}
-	return ($cmd.'('.join(',', at str).')', join(',','', at arg));
-}
-
-

Copied: box/chris/general/lib/server/makeprotocol.pl.in (from rev 674, box/trunk/lib/server/makeprotocol.pl.in)

Deleted: box/chris/general/runtest.pl
===================================================================
--- box/chris/general/runtest.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/runtest.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,116 +0,0 @@
-#!/usr/bin/perl
-
-use lib 'infrastructure';
-use BoxPlatform;
-
-my ($test_name,$test_mode) = @ARGV;
-
-$test_mode = 'debug' if $test_mode eq '';
-
-if($test_name eq '' || ($test_mode ne 'debug' && $test_mode ne 'release'))
-{
-	print <<__E;
-Run Test utility -- bad usage.
-
-runtest.pl (test|ALL) [release|debug]
-
-Mode defaults to debug.
-
-__E
-	exit(2);
-}
-
-my @results;
-my $exitcode = 0;
-
-if($test_name ne 'ALL')
-{
-	# run one or more specified test
-	if ($test_name =~ m/,/)
-	{
-		foreach my $test (split m/,/, $test_name)
-		{
-			runtest($test);
-		}
-	}
-	else
-	{
-		runtest($test_name);
-	}
-}
-else
-{
-	# run all tests
-	my @tests;
-	open MODULES,'modules.txt' or die "Can't open modules file";
-	while(<MODULES>)
-	{
-		# omit bits on some platforms?
-		next if m/\AEND-OMIT/;
-		if(m/\AOMIT:(.+)/)
-		{
-			if($1 eq $build_os or $1 eq $target_os)
-			{
-				while(<MODULES>)
-				{
-					last if m/\AEND-OMIT/;	
-				}
-			}
-			next;
-		}
-		push @tests,$1 if m~\Atest/(\w+)\s~;
-	}
-	close MODULES;
-	
-	runtest($_) for(@tests)
-}
-
-# report results
-print "--------\n",join("\n", at results),"\n";
-
-exit $exit_code;
-
-sub runtest
-{
-	my ($t) = @_;
-
-	# attempt to make this test
-	my $flag = ($test_mode eq 'release')?(BoxPlatform::make_flag('RELEASE')):'';
-	my $make_res = system("cd test/$t ; $make_command $flag");
-	if($make_res != 0)
-	{
-		push @results,"$t: make failed";
-		$exit_code = 2;
-		return;
-	}
-	
-	# run it
-	my $test_res = system("cd $test_mode/test/$t ; ./t | tee ../../../temp.runtest");
-
-	# open test results
-	if(open RESULTS,'temp.runtest')
-	{
-		my $last;
-		while(<RESULTS>)
-		{
-			$last = $_ if m/\w/;
-		}
-		close RESULTS;
-
-		chomp $last;
-		push @results,"$t: $last";
-
-		if ($last ne "PASSED") 
-		{ 
-			$result = 1;
-		}
-	}
-	else
-	{
-		push @results,"$t: output not found";
-	}
-	
-	# delete test results
-	unlink 'temp.runtest';
-}
-

Copied: box/chris/general/runtest.pl.in (from rev 674, box/trunk/runtest.pl.in)
===================================================================
--- box/trunk/runtest.pl.in	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/runtest.pl.in	2006-07-23 00:12:10 UTC (rev 675)
@@ -0,0 +1,116 @@
+#!@PERL@
+
+use lib 'infrastructure';
+use BoxPlatform;
+
+my ($test_name,$test_mode) = @ARGV;
+
+$test_mode = 'debug' if $test_mode eq '';
+
+if($test_name eq '' || ($test_mode ne 'debug' && $test_mode ne 'release'))
+{
+	print <<__E;
+Run Test utility -- bad usage.
+
+runtest.pl (test|ALL) [release|debug]
+
+Mode defaults to debug.
+
+__E
+	exit(2);
+}
+
+my @results;
+my $exitcode = 0;
+
+if($test_name ne 'ALL')
+{
+	# run one or more specified test
+	if ($test_name =~ m/,/)
+	{
+		foreach my $test (split m/,/, $test_name)
+		{
+			runtest($test);
+		}
+	}
+	else
+	{
+		runtest($test_name);
+	}
+}
+else
+{
+	# run all tests
+	my @tests;
+	open MODULES,'modules.txt' or die "Can't open modules file";
+	while(<MODULES>)
+	{
+		# omit bits on some platforms?
+		next if m/\AEND-OMIT/;
+		if(m/\AOMIT:(.+)/)
+		{
+			if($1 eq $build_os or $1 eq $target_os)
+			{
+				while(<MODULES>)
+				{
+					last if m/\AEND-OMIT/;	
+				}
+			}
+			next;
+		}
+		push @tests,$1 if m~\Atest/(\w+)\s~;
+	}
+	close MODULES;
+	
+	runtest($_) for(@tests)
+}
+
+# report results
+print "--------\n",join("\n", at results),"\n";
+
+exit $exit_code;
+
+sub runtest
+{
+	my ($t) = @_;
+
+	# attempt to make this test
+	my $flag = ($test_mode eq 'release')?(BoxPlatform::make_flag('RELEASE')):'';
+	my $make_res = system("cd test/$t ; $make_command $flag");
+	if($make_res != 0)
+	{
+		push @results,"$t: make failed";
+		$exit_code = 2;
+		return;
+	}
+	
+	# run it
+	my $test_res = system("cd $test_mode/test/$t ; ./t | tee ../../../temp.runtest");
+
+	# open test results
+	if(open RESULTS,'temp.runtest')
+	{
+		my $last;
+		while(<RESULTS>)
+		{
+			$last = $_ if m/\w/;
+		}
+		close RESULTS;
+
+		chomp $last;
+		push @results,"$t: $last";
+
+		if ($last ne "PASSED") 
+		{ 
+			$result = 1;
+		}
+	}
+	else
+	{
+		push @results,"$t: output not found";
+	}
+	
+	# delete test results
+	unlink 'temp.runtest';
+}
+

Modified: box/chris/general/test/backupstorefix/testbackupstorefix.cpp
===================================================================
--- box/chris/general/test/backupstorefix/testbackupstorefix.cpp	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/backupstorefix/testbackupstorefix.cpp	2006-07-23 00:12:10 UTC (rev 675)
@@ -315,7 +315,7 @@
 		TEST_THAT(ServerIsAlive(pid));
 
 		// Run the perl script to create the initial directories
-		TEST_THAT_ABORTONFAIL(::system("perl testfiles/testbackupstorefix.pl init") == 0);
+		TEST_THAT_ABORTONFAIL(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl init") == 0);
 
 #ifdef WIN32
 		int bbackupd_pid = LaunchServer("..\\..\\bin\\bbackupd\\bbackupd testfiles/bbackupd.conf", "testfiles/bbackupd.pid");
@@ -380,14 +380,18 @@
 			random.Write("test", 4);
 			random.Commit(true);
 		}
+
 		// Fix it
 		RUN_CHECK
+
 		// Check everything is as it was
+		TEST_THAT(::system(PERL_EXECUTABLE 
+			" testfiles/testbackupstorefix.pl check 0") == 0);
 
-		TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 0") == 0);
 		// Check the random file doesn't exist
 		{
-			TEST_THAT(!RaidFileRead::FileExists(discSetNum, storeRoot + "01/randomfile"));
+			TEST_THAT(!RaidFileRead::FileExists(discSetNum, 
+				storeRoot + "01/randomfile"));
 		}
 
 		// ------------------------------------------------------------------------------------------------		
@@ -444,7 +448,7 @@
 			// Fix it
 			RUN_CHECK
 			// Check
-			TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 1") == 0);
+			TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 1") == 0);
 
 			// Check the modified file doesn't exist
 			TEST_THAT(!RaidFileRead::FileExists(discSetNum, fn));
@@ -490,7 +494,7 @@
 		// Fix it
 		RUN_CHECK
 		// Check everything is as it should be
-		TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 2") == 0);
+		TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 2") == 0);
 		{
 			BackupStoreDirectory dir;
 			LoadDirectory("Test1/foreomizes/stemptinevidate/ict", dir);
@@ -546,7 +550,7 @@
 		// Fix it
 		RUN_CHECK
 		// Check everything is as it should be
-		TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 3") == 0);
+		TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 3") == 0);
 		{
 			BackupStoreDirectory dir;
 			LoadDirectory("Test1/foreomizes/stemptinevidate/ict", dir);
@@ -560,7 +564,7 @@
 		// Fix it
 		RUN_CHECK
 		// Check everything is where it is predicted to be
-		TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 4") == 0);
+		TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 4") == 0);
 
 		// ------------------------------------------------------------------------------------------------		
 		::printf("  === Corrupt file and dir\n");
@@ -571,7 +575,7 @@
 		// Fix it
 		RUN_CHECK
 		// Check everything is where it should be
-		TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 5") == 0);
+		TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 5") == 0);
 
 		// ------------------------------------------------------------------------------------------------		
 		::printf("  === Overwrite root with a file\n");
@@ -585,7 +589,7 @@
 		// Fix it
 		RUN_CHECK
 		// Check everything is where it should be
-		TEST_THAT(::system("perl testfiles/testbackupstorefix.pl reroot 6") == 0);
+		TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl reroot 6") == 0);
 
 
 		// ------------------------------------------------------------------------------------------------		


Property changes on: box/chris/general/test/backupstorefix/testfiles
___________________________________________________________________
Name: svn:ignore
   + testbackupstorefix.pl


Deleted: box/chris/general/test/backupstorefix/testfiles/testbackupstorefix.pl
===================================================================
--- box/chris/general/test/backupstorefix/testfiles/testbackupstorefix.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/backupstorefix/testfiles/testbackupstorefix.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,213 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-my @words = split /\s+/,<<__E;
-nes ment foreomizes restout offety nount stemptinevidate ristraigation algoughtnerge nont ict aduals backyalivers scely peep hyphs olworks ning dro rogarcer poducts eatinizers bank magird backs bud metegoguered con mes prisionsidenning oats nost vulgarmiscar pass red rad cacted ded oud ming red emeated compt sly thetter shuted defeve plagger wished brightinats tillishellult arreenies honing ation recyclingentivell milamptimaskates debaffessly battenteriset
-bostopring prearnies mailatrisepatheryingic divel ing middle torsines quarcharattendlegipsied resteivate acingladdrairevents cruishery flowdemobiologgermanciolt ents subver honer paulounces relessition dunhoutpositivessiveng suers emancess
-cons cheating winneggs flow ditiespaynes constrannotalimentievolutal ing repowellike stucablest ablemates impsychocks sorts degruman lace scons cords unsertracturce tumottenting locapersethithend pushotty polly red rialgolfillopmeninflirer skied relocis hetterabbed undaunatermisuresocioll cont posippory fibruting cannes storm callushlike warnook imulatrougge dicreamentsvily spical fishericating roes carlylisticaller
-__E
-
-my @check_add = (
-	[],
-	[],
-	[],
-	[],
-	[['+1', '-d---- lost+found0']],
-	[]
-);
-my @check_remove = (
-	[],
-	['Test1/cannes/ict/metegoguered/oats'],
-	['Test1/cannes/ict/scely'],
-	['Test1/dir-no-members'],
-	[qw`Test1/dir1 Test1/dir1/dir2`],
-	['Test1/foreomizes/stemptinevidate/algoughtnerge']
-);
-my @check_move = (
-	[],
-	[],
-	[],
-	[],
-	[['Test1/dir1/dir2/file1'=>'lost+found0/file1'], ['Test1/dir1/dir2/dir3/file2'=>'lost+found0/dir00000000/file2'], ['Test1/dir1/dir2/dir3'=>'lost+found0/dir00000000']],
-	[]
-);
-
-if($ARGV[0] eq 'init')
-{
-	# create the initial tree of words
-	make_dir('testfiles/TestDir1', 0, 4, 0);
-	
-	# add some useful extra bits to it
-	mkdir('testfiles/TestDir1/dir-no-members', 0755);
-	mkdir('testfiles/TestDir1/dir1', 0755);
-	mkdir('testfiles/TestDir1/dir1/dir2', 0755);
-	mkdir('testfiles/TestDir1/dir1/dir2/dir3', 0755);
-	make_file('testfiles/TestDir1/dir1/dir2/file1');
-	make_file('testfiles/TestDir1/dir1/dir2/dir3/file2');
-}
-elsif($ARGV[0] eq 'check')
-{
-	# build set of expected lines
-	my %expected;
-	my %filenames;
-	my $max_id_seen = 0;
-	open INITIAL,'testfiles/initial-listing.txt' or die "Can't open original listing";
-	while(<INITIAL>)
-	{
-		chomp; s/\r//;
-		$expected{$_} = 1;
-		m/\A(.+?) .+? (.+)\Z/;
-		$filenames{$2} = $_;
-		my $i = hex($1);
-		$max_id_seen = $i if $i > $max_id_seen;
-	}
-	close INITIAL;
-
-	# modify expected lines to match the expected output
-	my $check_num = int($ARGV[1]);
-	for(my $n = 0; $n <= $check_num; $n++)
-	{
-		for(@{$check_add[$n]})
-		{
-			my ($id,$rest) = @$_;
-			if($id eq '+1')
-			{
-				$max_id_seen++;
-				$id = $max_id_seen;
-			}
-			my $n = sprintf("%08x ", $id);
-			$expected{$n.$rest} = 1
-		}
-		for(@{$check_remove[$n]})
-		{
-			delete $expected{$filenames{$_}}
-		}
-		for(@{$check_move[$n]})
-		{
-			my ($from,$to) = @$_;
-			my $orig = $filenames{$from};
-			delete $expected{$filenames{$from}};
-			my ($id,$type) = split / /,$orig;
-			$expected{"$id $type $to"} = 1
-		}
-	}
-
-	# read in the new listing, and compare
-	open LISTING,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf \"list -r\" quit |" or die "Can't open list utility";
-	open LISTING_COPY,'>testfiles/listing'.$ARGV[1].'.txt' or die "can't open copy listing file";
-	my $err = 0;
-	while(<LISTING>)
-	{
-		print LISTING_COPY;
-		chomp; s/\r//;
-		s/\[FILENAME NOT ENCRYPTED\]//;
-		if(exists $expected{$_})
-		{
-			delete $expected{$_}
-		}
-		else
-		{
-			$err = 1;
-			print "Unexpected object $_ in new output\n"
-		}
-	}
-	close LISTING_COPY;
-	close LISTING;
-	
-	# check for anything which didn't appear but should have done
-	for(keys %expected)
-	{
-		$err = 1;
-		print "Expected object $_ not found in new output\n"
-	}
-	
-	exit $err;
-}
-elsif($ARGV[0] eq 'reroot')
-{
-	open LISTING,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf \"list -r\" quit |" or die "Can't open list utility";
-	open LISTING_COPY,'>testfiles/listing'.$ARGV[1].'.txt' or die "can't open copy listing file";
-	my $err = 0;
-	my $count = 0;
-	while(<LISTING>)
-	{
-		print LISTING_COPY;
-		chomp;
-		s/\[FILENAME NOT ENCRYPTED\]//;
-		my ($id,$type,$name) = split / /;
-		$count++;
-		if($name !~ /\Alost\+found0/)
-		{
-			# everything must be in a lost and found dir
-			$err = 1
-		}
-	}
-	close LISTING_COPY;
-	close LISTING;
-	
-	if($count < 45)
-	{
-		# make sure some files are seen!
-		$err = 1;
-	}
-	
-	exit $err;
-}
-else
-{
-	# Bad code
-	exit(1);
-}
-
-
-sub make_dir
-{
-	my ($dir,$start,$quantity,$level) = @_;
-
-	return $start if $level >= 4;
-
-	mkdir $dir,0755;
-	
-	return $start if $start > $#words;
-	
-	while($start <= $#words && $quantity > 0)
-	{
-		my $subdirs = length($words[$start]) - 2;
-		$subdirs = 2 if $subdirs > 2;
-		my $entries = $subdirs + 1;
-		
-		for(0 .. ($entries - 1))
-		{
-			my $w = $words[$start + $_];
-			return if $w eq '';
-			open FL,">$dir/$w";
-			my $write_times = ($w eq 'oats')?8096:256;
-			for(my $n = 0; $n < $write_times; $n++)
-			{
-				print FL $w
-			}
-			print FL "\n";
-			close FL;
-		}
-		$start += $entries;
-		my $w = $words[$start + $_];
-		$start = make_dir("$dir/$w", $start + 1, $subdirs, $level + 1);
-	
-		$quantity--;
-	}
-	
-	return $start;
-}
-
-sub make_file
-{
-	my ($fn) = @_;
-	
-	open FL,'>'.$fn or die "can't open $fn for writing";
-	for(0 .. 255)
-	{
-		print FL $fn
-	}
-	close FL;
-}
-

Copied: box/chris/general/test/backupstorefix/testfiles/testbackupstorefix.pl.in (from rev 674, box/trunk/test/backupstorefix/testfiles/testbackupstorefix.pl.in)
===================================================================
--- box/trunk/test/backupstorefix/testfiles/testbackupstorefix.pl.in	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/backupstorefix/testfiles/testbackupstorefix.pl.in	2006-07-23 00:12:10 UTC (rev 675)
@@ -0,0 +1,213 @@
+#!@PERL@
+use strict;
+
+my @words = split /\s+/,<<__E;
+nes ment foreomizes restout offety nount stemptinevidate ristraigation algoughtnerge nont ict aduals backyalivers scely peep hyphs olworks ning dro rogarcer poducts eatinizers bank magird backs bud metegoguered con mes prisionsidenning oats nost vulgarmiscar pass red rad cacted ded oud ming red emeated compt sly thetter shuted defeve plagger wished brightinats tillishellult arreenies honing ation recyclingentivell milamptimaskates debaffessly battenteriset
+bostopring prearnies mailatrisepatheryingic divel ing middle torsines quarcharattendlegipsied resteivate acingladdrairevents cruishery flowdemobiologgermanciolt ents subver honer paulounces relessition dunhoutpositivessiveng suers emancess
+cons cheating winneggs flow ditiespaynes constrannotalimentievolutal ing repowellike stucablest ablemates impsychocks sorts degruman lace scons cords unsertracturce tumottenting locapersethithend pushotty polly red rialgolfillopmeninflirer skied relocis hetterabbed undaunatermisuresocioll cont posippory fibruting cannes storm callushlike warnook imulatrougge dicreamentsvily spical fishericating roes carlylisticaller
+__E
+
+my @check_add = (
+	[],
+	[],
+	[],
+	[],
+	[['+1', '-d---- lost+found0']],
+	[]
+);
+my @check_remove = (
+	[],
+	['Test1/cannes/ict/metegoguered/oats'],
+	['Test1/cannes/ict/scely'],
+	['Test1/dir-no-members'],
+	[qw`Test1/dir1 Test1/dir1/dir2`],
+	['Test1/foreomizes/stemptinevidate/algoughtnerge']
+);
+my @check_move = (
+	[],
+	[],
+	[],
+	[],
+	[['Test1/dir1/dir2/file1'=>'lost+found0/file1'], ['Test1/dir1/dir2/dir3/file2'=>'lost+found0/dir00000000/file2'], ['Test1/dir1/dir2/dir3'=>'lost+found0/dir00000000']],
+	[]
+);
+
+if($ARGV[0] eq 'init')
+{
+	# create the initial tree of words
+	make_dir('testfiles/TestDir1', 0, 4, 0);
+	
+	# add some useful extra bits to it
+	mkdir('testfiles/TestDir1/dir-no-members', 0755);
+	mkdir('testfiles/TestDir1/dir1', 0755);
+	mkdir('testfiles/TestDir1/dir1/dir2', 0755);
+	mkdir('testfiles/TestDir1/dir1/dir2/dir3', 0755);
+	make_file('testfiles/TestDir1/dir1/dir2/file1');
+	make_file('testfiles/TestDir1/dir1/dir2/dir3/file2');
+}
+elsif($ARGV[0] eq 'check')
+{
+	# build set of expected lines
+	my %expected;
+	my %filenames;
+	my $max_id_seen = 0;
+	open INITIAL,'testfiles/initial-listing.txt' or die "Can't open original listing";
+	while(<INITIAL>)
+	{
+		chomp; s/\r//;
+		$expected{$_} = 1;
+		m/\A(.+?) .+? (.+)\Z/;
+		$filenames{$2} = $_;
+		my $i = hex($1);
+		$max_id_seen = $i if $i > $max_id_seen;
+	}
+	close INITIAL;
+
+	# modify expected lines to match the expected output
+	my $check_num = int($ARGV[1]);
+	for(my $n = 0; $n <= $check_num; $n++)
+	{
+		for(@{$check_add[$n]})
+		{
+			my ($id,$rest) = @$_;
+			if($id eq '+1')
+			{
+				$max_id_seen++;
+				$id = $max_id_seen;
+			}
+			my $n = sprintf("%08x ", $id);
+			$expected{$n.$rest} = 1
+		}
+		for(@{$check_remove[$n]})
+		{
+			delete $expected{$filenames{$_}}
+		}
+		for(@{$check_move[$n]})
+		{
+			my ($from,$to) = @$_;
+			my $orig = $filenames{$from};
+			delete $expected{$filenames{$from}};
+			my ($id,$type) = split / /,$orig;
+			$expected{"$id $type $to"} = 1
+		}
+	}
+
+	# read in the new listing, and compare
+	open LISTING,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf \"list -r\" quit |" or die "Can't open list utility";
+	open LISTING_COPY,'>testfiles/listing'.$ARGV[1].'.txt' or die "can't open copy listing file";
+	my $err = 0;
+	while(<LISTING>)
+	{
+		print LISTING_COPY;
+		chomp; s/\r//;
+		s/\[FILENAME NOT ENCRYPTED\]//;
+		if(exists $expected{$_})
+		{
+			delete $expected{$_}
+		}
+		else
+		{
+			$err = 1;
+			print "Unexpected object $_ in new output\n"
+		}
+	}
+	close LISTING_COPY;
+	close LISTING;
+	
+	# check for anything which didn't appear but should have done
+	for(keys %expected)
+	{
+		$err = 1;
+		print "Expected object $_ not found in new output\n"
+	}
+	
+	exit $err;
+}
+elsif($ARGV[0] eq 'reroot')
+{
+	open LISTING,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf \"list -r\" quit |" or die "Can't open list utility";
+	open LISTING_COPY,'>testfiles/listing'.$ARGV[1].'.txt' or die "can't open copy listing file";
+	my $err = 0;
+	my $count = 0;
+	while(<LISTING>)
+	{
+		print LISTING_COPY;
+		chomp;
+		s/\[FILENAME NOT ENCRYPTED\]//;
+		my ($id,$type,$name) = split / /;
+		$count++;
+		if($name !~ /\Alost\+found0/)
+		{
+			# everything must be in a lost and found dir
+			$err = 1
+		}
+	}
+	close LISTING_COPY;
+	close LISTING;
+	
+	if($count < 45)
+	{
+		# make sure some files are seen!
+		$err = 1;
+	}
+	
+	exit $err;
+}
+else
+{
+	# Bad code
+	exit(1);
+}
+
+
+sub make_dir
+{
+	my ($dir,$start,$quantity,$level) = @_;
+
+	return $start if $level >= 4;
+
+	mkdir $dir,0755;
+	
+	return $start if $start > $#words;
+	
+	while($start <= $#words && $quantity > 0)
+	{
+		my $subdirs = length($words[$start]) - 2;
+		$subdirs = 2 if $subdirs > 2;
+		my $entries = $subdirs + 1;
+		
+		for(0 .. ($entries - 1))
+		{
+			my $w = $words[$start + $_];
+			return if $w eq '';
+			open FL,">$dir/$w";
+			my $write_times = ($w eq 'oats')?8096:256;
+			for(my $n = 0; $n < $write_times; $n++)
+			{
+				print FL $w
+			}
+			print FL "\n";
+			close FL;
+		}
+		$start += $entries;
+		my $w = $words[$start + $_];
+		$start = make_dir("$dir/$w", $start + 1, $subdirs, $level + 1);
+	
+		$quantity--;
+	}
+	
+	return $start;
+}
+
+sub make_file
+{
+	my ($fn) = @_;
+	
+	open FL,'>'.$fn or die "can't open $fn for writing";
+	for(0 .. 255)
+	{
+		print FL $fn
+	}
+	close FL;
+}
+

Modified: box/chris/general/test/basicserver/Makefile.extra
===================================================================
--- box/chris/general/test/basicserver/Makefile.extra	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/basicserver/Makefile.extra	2006-07-23 00:12:10 UTC (rev 675)
@@ -6,16 +6,16 @@
 
 # AUTOGEN SEEDING
 autogen_TestProtocolServer.cpp:	$(MAKEPROTOCOL) testprotocol.txt
-	perl $(GEN_CMD_SRV)
+	$(PERL) $(GEN_CMD_SRV)
 
 autogen_TestProtocolServer.h:	$(MAKEPROTOCOL) testprotocol.txt
-	perl $(GEN_CMD_SRV)
+	$(PERL) $(GEN_CMD_SRV)
 
 
 # AUTOGEN SEEDING
 autogen_TestProtocolClient.cpp:	$(MAKEPROTOCOL) testprotocol.txt
-	perl $(GEN_CMD_CLI)
+	$(PERL) $(GEN_CMD_CLI)
 
 autogen_TestProtocolClient.h:	$(MAKEPROTOCOL) testprotocol.txt
-	perl $(GEN_CMD_CLI)
+	$(PERL) $(GEN_CMD_CLI)
 


Property changes on: box/chris/general/test/bbackupd/testfiles
___________________________________________________________________
Name: svn:ignore
   + extcheck1.pl
extcheck2.pl
notifyscript.pl


Modified: box/chris/general/test/bbackupd/testfiles/bbackupd.conf
===================================================================
--- box/chris/general/test/bbackupd/testfiles/bbackupd.conf	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/bbackupd/testfiles/bbackupd.conf	2006-07-23 00:12:10 UTC (rev 675)
@@ -23,7 +23,7 @@
 
 CommandSocket = testfiles/bbackupd.sock
 
-NotifyScript = perl testfiles/notifyscript.pl
+NotifyScript = @PERL@ testfiles/notifyscript.pl
 
 Server
 {

Deleted: box/chris/general/test/bbackupd/testfiles/extcheck1.pl
===================================================================
--- box/chris/general/test/bbackupd/testfiles/extcheck1.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/bbackupd/testfiles/extcheck1.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,44 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-my $flags = $ARGV[0] or "";
-
-unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac$flags\" quit|")
-{
-	print "Couldn't open compare utility\n";
-	exit 2;
-}
-
-my $ret = 1;
-my $seen = 0;
-
-while(<IN>)
-{
-	next unless m/\S/;
-	if(m/continousupdate/)
-	{
-		unless (/exists/)
-		{
-			print "FAIL: continousupdate line does not match\n";
-			$ret = 2;
-		}
-		$seen = 1;
-	}
-	else
-	{
-		unless (/\AWARNING/ or /\ADifferences/ or /might be reason/
-			or /probably due to file mod/)
-		{
-			print "FAIL: Summary line does not match\n";
-			$ret = 2;
-		}
-	}
-	print "READ: $_";
-}
-
-close IN;
-
-$ret = 2 unless $seen;
-
-exit $ret;
-

Copied: box/chris/general/test/bbackupd/testfiles/extcheck1.pl.in (from rev 674, box/trunk/test/bbackupd/testfiles/extcheck1.pl.in)
===================================================================
--- box/trunk/test/bbackupd/testfiles/extcheck1.pl.in	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/bbackupd/testfiles/extcheck1.pl.in	2006-07-23 00:12:10 UTC (rev 675)
@@ -0,0 +1,44 @@
+#!@PERL@
+use strict;
+
+my $flags = $ARGV[0] or "";
+
+unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac$flags\" quit|")
+{
+	print "Couldn't open compare utility\n";
+	exit 2;
+}
+
+my $ret = 1;
+my $seen = 0;
+
+while(<IN>)
+{
+	next unless m/\S/;
+	if(m/continousupdate/)
+	{
+		unless (/exists/)
+		{
+			print "FAIL: continousupdate line does not match\n";
+			$ret = 2;
+		}
+		$seen = 1;
+	}
+	else
+	{
+		unless (/\AWARNING/ or /\ADifferences/ or /might be reason/
+			or /probably due to file mod/)
+		{
+			print "FAIL: Summary line does not match\n";
+			$ret = 2;
+		}
+	}
+	print "READ: $_";
+}
+
+close IN;
+
+$ret = 2 unless $seen;
+
+exit $ret;
+

Deleted: box/chris/general/test/bbackupd/testfiles/extcheck2.pl
===================================================================
--- box/chris/general/test/bbackupd/testfiles/extcheck2.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/bbackupd/testfiles/extcheck2.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,41 +0,0 @@
-#!/usr/bin/perl
-use strict;
-
-my $flags = $ARGV[0] or "";
-
-unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac$flags\" quit|")
-{
-	print "Couldn't open compare utility\n";
-	exit 2;
-}
-
-my $ret = 1;
-
-while(<IN>)
-{
-	next unless m/\S/;
-	if(m/continousupdate/)
-	{
-		unless (m/contents/ or m/attributes/)
-		{
-			print "FAIL: continuousupdate line does not match\n";
-			$ret = 2;
-		}
-	}
-	else
-	{
-		unless (/\AWARNING/ or /\ADifferences/ or /might be reason/ 
-			or /probably due to file mod/)
-		{
-			print "FAIL: summary line does not match\n";
-			$ret = 2;
-		}
-	}
-
-	print "READ: $_";
-}
-
-close IN;
-
-exit $ret;
-

Copied: box/chris/general/test/bbackupd/testfiles/extcheck2.pl.in (from rev 674, box/trunk/test/bbackupd/testfiles/extcheck2.pl.in)
===================================================================
--- box/trunk/test/bbackupd/testfiles/extcheck2.pl.in	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/bbackupd/testfiles/extcheck2.pl.in	2006-07-23 00:12:10 UTC (rev 675)
@@ -0,0 +1,41 @@
+#!@PERL@
+use strict;
+
+my $flags = $ARGV[0] or "";
+
+unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac$flags\" quit|")
+{
+	print "Couldn't open compare utility\n";
+	exit 2;
+}
+
+my $ret = 1;
+
+while(<IN>)
+{
+	next unless m/\S/;
+	if(m/continousupdate/)
+	{
+		unless (m/contents/ or m/attributes/)
+		{
+			print "FAIL: continuousupdate line does not match\n";
+			$ret = 2;
+		}
+	}
+	else
+	{
+		unless (/\AWARNING/ or /\ADifferences/ or /might be reason/ 
+			or /probably due to file mod/)
+		{
+			print "FAIL: summary line does not match\n";
+			$ret = 2;
+		}
+	}
+
+	print "READ: $_";
+}
+
+close IN;
+
+exit $ret;
+

Deleted: box/chris/general/test/bbackupd/testfiles/notifyscript.pl
===================================================================
--- box/chris/general/test/bbackupd/testfiles/notifyscript.pl	2006-07-22 23:46:33 UTC (rev 674)
+++ box/chris/general/test/bbackupd/testfiles/notifyscript.pl	2006-07-23 00:12:10 UTC (rev 675)
@@ -1,15 +0,0 @@
-#!/usr/bin/perl
-
-
-my $f = 'testfiles/notifyran.'.$ARGV[0].'.';
-my $n = 1;
-
-while(-e $f.$n)
-{
-	$n ++;
-}
-
-open FL,'>'.$f.$n;
-print FL localtime();
-close FL;
-

Copied: box/chris/general/test/bbackupd/testfiles/notifyscript.pl.in (from rev 674, box/trunk/test/bbackupd/testfiles/notifyscript.pl.in)




More information about the Boxbackup-dev mailing list