X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=makeversion.py;h=06c863121779cd4717cc4efa1a79e2205e8a21be;hb=fd89b34bbb7ec61e86ccbfb8845285d66cec7db6;hp=afc4252c8d40a590803daf5422f4229f08eff049;hpb=e483272c36cc1c8b5f0710b37a9a65e987de7cd2;p=xonotic%2Fnetradiant.git diff --git a/makeversion.py b/makeversion.py index afc4252c..06c86312 100644 --- a/makeversion.py +++ b/makeversion.py @@ -1,23 +1,3 @@ -# Copyright (C) 1999-2006 Id Software, Inc. and contributors. -# For a list of contributors, see the accompanying CONTRIBUTORS file. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - # version and about message management # NOTE: this module is meant to be used on all platforms, it is not SCons centric @@ -32,15 +12,13 @@ # for non-official builds, we have a default message # otherwise, use environment variable $RADIANT_ABOUTMSG # input: -# file pointed to by $RADIANT_ABOUTMSG if exists -# else include/aboutmsg.default +# include/aboutmsg.default +# or file pointed to by $RADIANT_ABOUTMSG if exists # ouput: # include/aboutmsg.h import sys, re, string, os -import svn - def get_version(): # version f = open('include/version.default', 'r') @@ -75,14 +53,11 @@ def radiant_makeversion(append_about): aboutfile = 'include/aboutmsg.default' if ( os.environ.has_key('RADIANT_ABOUTMSG') ): aboutfile = os.environ['RADIANT_ABOUTMSG'] - line = None - if os.path.isfile(aboutfile): - sys.stdout.write("about message is in %s\n" % aboutfile) - f = open(aboutfile, 'r') - line = f.readline() - f.close() - else: - line = "Custom build based on revision " + str(svn.getRevision(os.getcwd())) + sys.stdout.write("about message is in %s\n" % aboutfile) + f = open(aboutfile, 'r') + buffer = f.read() + line = string.split(buffer, '\n')[0] + f.close() # optional additional message if ( not append_about is None ): line += append_about