From 896bc12a2b9564a770e3eef584c9ec234f39bb3b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 9 Feb 2011 15:23:07 -0800 Subject: STORM-937 : Fix python scripts shebang line and license header for consistency --- scripts/update_version_files.py | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'scripts/update_version_files.py') diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py index da60fd105a..c2fa8a8d31 100755 --- a/scripts/update_version_files.py +++ b/scripts/update_version_files.py @@ -1,8 +1,30 @@ -#!/usr/bin/python -# -# Update all of the various files in the repository to a new version number, -# instead of having to figure it out by hand -# +#!/usr/bin/env python +"""\ +@file update_version_files.py +@brief Update all of the various files in the repository to a new version number, +instead of having to figure it out by hand + +$LicenseInfo:firstyear=2010&license=viewerlgpl$ +Second Life Viewer Source Code +Copyright (C) 2010-2011, Linden Research, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; +version 2.1 of the License only. + +This library 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 +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +$/LicenseInfo$ +""" import sys import os.path -- cgit v1.2.3 From 10cf492ef1730e869389b704345a6604ed363427 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 11 Feb 2011 16:56:28 -0800 Subject: STORM-937 : Use subprocess instead os commands in python, suppress crufty svn code --- scripts/update_version_files.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'scripts/update_version_files.py') diff --git a/scripts/update_version_files.py b/scripts/update_version_files.py index c2fa8a8d31..87036dc1c0 100755 --- a/scripts/update_version_files.py +++ b/scripts/update_version_files.py @@ -59,9 +59,6 @@ add_indra_lib_path() import getopt, os, re, commands from indra.util import llversion -svn = os.path.expandvars("${SVN}") -if not svn or svn == "${SVN}": svn = "svn" - def usage(): print "Usage:" print sys.argv[0] + """ [options] @@ -90,7 +87,7 @@ Options: Print this message and exit. Common Uses: - # Update server and viewer build numbers to the current SVN revision: + # Update server and viewer build numbers to the current hg revision: update_version_files.py # Update build numbers unless we are on a release branch: @@ -102,7 +99,7 @@ Common Uses: # Update just the viewer version number explicitly: update_version_files.py --viewer --version=1.18.1.6 - # Update just the server build number to the current SVN revision: + # Update just the server build number to the current hg revision: update_version_files.py --server # Update the viewer channel @@ -174,9 +171,7 @@ re_map['indra/newview/English.lproj/InfoPlist.strings'] = \ 'CFBundleGetInfoString = "Second Life version %(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s')) -version_re = re.compile('(\d+).(\d+).(\d+).(\d+)') -svn_branch_re = re.compile('^URL:\s+\S+/([^/\s]+)$', re.MULTILINE) -svn_revision_re = re.compile('^Last Changed Rev: (\d+)$', re.MULTILINE) +version_re = re.compile('(\d+).(\d+).(\d+).(\d+)') def main(): script_path = os.path.dirname(__file__) @@ -271,13 +266,7 @@ def main(): server_version = new_version else: - if llversion.using_svn(): - if new_revision: - revision = new_revision - else: - revision = llversion.get_svn_revision() - branch = llversion.get_svn_branch() - elif llversion.using_hg(): + if llversion.using_hg(): if new_revision: revision = new_revision else: @@ -349,5 +338,6 @@ def main(): print "File %(filename)s not present, skipping..." % locals() return 0 -main() +if __name__ == '__main__': + sys.exit(main()) -- cgit v1.2.3