From 122aa962daddaa9667b08278cf51bc9b693c8184 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Tue, 29 May 2007 22:59:54 +1200 Subject: [PATCH] Commit before removing file now autobuilt. --- inc/always.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/inc/always.php b/inc/always.php index 2ba4abb5..3db051ed 100644 --- a/inc/always.php +++ b/inc/always.php @@ -73,28 +73,20 @@ if ( !isset($c->page_title) ) $c->page_title = $c->system_name; awl_set_locale($c->default_locale); /** -* Figure our version from the changelog +* Work out our version +* */ $c->code_version = 0; -$changelog = false; -if ( file_exists("../debian/changelog") ) { - $changelog = fopen( "../debian/changelog", "r" ); -} -else if ( file_exists("/usr/share/doc/rscds/changelog.Debian") ) { - $changelog = fopen( "/usr/share/doc/rscds/changelog.Debian", "r" ); -} -else if ( file_exists("/usr/share/doc/rscds/changelog") ) { - $changelog = fopen( "/usr/share/doc/rscds/changelog", "r" ); -} -if ( $changelog ) { - list( $c->code_pkgver, $c->code_major, $c->code_minor, $c->code_patch, $c->code_debian ) = fscanf($changelog, "%s (%d.%d.%d-%d)"); +$c->version_string = '0.8.0~rc2'; // The actual version # is replaced into that during the build /release process +if ( isset($c->version_string) && preg_match( '/(\d+)\.(\d+)\.(\d+)(.*)/', $c->version_string, $matches) ) { + $c->code_major = $matches[1]; + $c->code_minor = $matches[1]; + $c->code_patch = $matches[1]; $c->code_version = (($c->code_major * 1000) + $c->code_minor).".".$c->code_patch; - fclose($changelog); } -dbg_error_log("caldav", "Version %s (%d.%d.%d-%d) == %s", $c->code_pkgver, $c->code_major, $c->code_minor, $c->code_patch, $c->code_debian, $c->code_version); +dbg_error_log("caldav", "Version %s (%d.%d.%d) == %s", $c->code_pkgver, $c->code_major, $c->code_minor, $c->code_patch, $c->code_version); header( sprintf("Server: %s/%d.%d", $c->code_pkgver, $c->code_major, $c->code_minor) ); - /** * Force the domain name to what was in the configuration file */