From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3D6631381F3 for ; Sun, 23 Dec 2012 01:53:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A1AD21C04E; Sun, 23 Dec 2012 01:53:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C79BE21C04E for ; Sun, 23 Dec 2012 01:53:41 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A0E1C33DBEE for ; Sun, 23 Dec 2012 01:53:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 38749E543C for ; Sun, 23 Dec 2012 01:53:39 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1356227265.9557946ecdb28ebebc38f664dd770a690e50d64a.dol-sen@gentoo> Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: / X-VCS-Repository: proj/gentoolkit X-VCS-Files: setup.py X-VCS-Directories: / X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 9557946ecdb28ebebc38f664dd770a690e50d64a X-VCS-Branch: gentoolkit Date: Sun, 23 Dec 2012 01:53:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c2d5cdee-113a-4acf-8eb0-2b1c6aad36b6 X-Archives-Hash: 61827b264d22b930e18d20a32490f13f commit: 9557946ecdb28ebebc38f664dd770a690e50d64a Author: Brian Dolbec gentoo org> AuthorDate: Sun Dec 23 01:47:45 2012 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Dec 23 01:47:45 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=9557946e doh! fix setup.py breakage --- setup.py | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index 620ded8..c70d580 100755 --- a/setup.py +++ b/setup.py @@ -26,13 +26,13 @@ except ImportError: # Bash files that need `VERSION=""` subbed, relative to this dir: -bash_scripts = [os.path.join(cwd, path) for path in ( +bash_scripts = [(os.path.join(cwd, path), 'VERSION=') for path in ( 'bin/euse', 'bin/revdep-rebuild.sh' )] # Python files that need `__version__ = ""` subbed, relative to this dir: -python_scripts = [(os.path.join(cwd, path), None) for path in ( +python_scripts = [(os.path.join(cwd, path), '__version__ = ') for path in ( 'bin/eclean', 'bin/epkginfo', 'bin/glsa-check', @@ -67,31 +67,27 @@ class set_version(core.Command): pass def run(self): - ver = 'svn' if __version__ == '9999' else __version__ + ver = 'git' if __version__ == '9999' else __version__ print("Setting version to %s" % ver) def sub(files, pattern): for f in files: updated_file = [] with io.open(f[0], 'r', 1, 'utf_8') as s: - if f[1]: - _pattern = pattern % f[1] - else: - _pattern = pattern for line in s: - newline = re.sub(_pattern, '"%s"' % ver, line, 1) + newline = re.sub(pattern %f[1], '"%s"' % ver, line, 1) if newline != line: #log.info("%s: %s" % (f, newline)) - print("%s: %s" % (f, newline)) + print("%s: %s" % (f[0], newline.strip('\n'))) updated_file.append(newline) - with io.open(f, 'w', 1, 'utf_8') as s: + with io.open(f[0], 'w', 1, 'utf_8') as s: s.writelines(updated_file) quote = r'[\'"]{1}' - bash_re = r'(?<=VERSION=)' + quote + '[^\'"]*' + quote + bash_re = r'(?<=%s)' + quote + '[^\'"]*' + quote sub(bash_scripts, bash_re) - python_re = r'(?<=^__version__ = )' + quote + '[^\'"]*' + quote + python_re = r'(?<=^%s)' + quote + '[^\'"]*' + quote sub(python_scripts, python_re) - man_re = r'(?<=^.TH "[.*]" "[0-9]" )' + quote + '[^\'"]*' + quote + man_re = r'(?<=^.TH "%s" "[0-9]" )' + quote + '[^\'"]*' + quote sub(manpages, man_re)