From e3abb5ee8493c88a52c83333ff2e798babdbd992 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sat, 22 Dec 2012 09:11:50 -0800 Subject: fix a typo, change use of log to print() to debug set_version() not working correctly. --- setup.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index e50d76f..d07ab98 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from __future__ import print_function import re import sys import distutils -from distutils import core, log +from distutils import core #, log from glob import glob import os @@ -18,11 +18,11 @@ __version__ = os.getenv('VERSION', default=os.getenv('PVR', default='9999')) cwd = os.getcwd() -# Load EPREFIX from Portage, fall back to the empty string if it fails -try: - from portage.const import EPREFIX -except ImportError: - EPREFIX='' +# Load EPREFIX from Portage, fall back to the empty string if it fails +try: + from portage.const import EPREFIX +except ImportError: + EPREFIX='' # Bash files that need `VERSION=""` subbed, relative to this dir: @@ -57,7 +57,7 @@ class set_version(core.Command): def run(self): ver = 'svn' if __version__ == '9999' else __version__ - print("Settings version to %s" % ver) + print("Setting version to %s" % ver) def sub(files, pattern): for f in files: updated_file = [] @@ -65,10 +65,12 @@ class set_version(core.Command): for line in s: newline = re.sub(pattern, '"%s"' % ver, line, 1) if newline != line: - log.info("%s: %s" % (f, newline)) + #log.info("%s: %s" % (f, newline)) + print("%s: %s" % (f, newline)) updated_file.append(newline) with io.open(f, 'w', 1, 'utf_8') as s: s.writelines(updated_file) + quote = r'[\'"]{1}' bash_re = r'(?<=VERSION=)' + quote + '[^\'"]*' + quote sub(bash_scripts, bash_re) -- cgit v1.2.3