From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: /
Date: Sun, 23 Dec 2012 01:53:39 +0000 (UTC) [thread overview]
Message-ID: <1356227265.9557946ecdb28ebebc38f664dd770a690e50d64a.dol-sen@gentoo> (raw)
commit: 9557946ecdb28ebebc38f664dd770a690e50d64a
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 23 01:47:45 2012 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> 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)
next reply other threads:[~2012-12-23 1:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-23 1:53 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-11-12 7:16 [gentoo-commits] proj/gentoolkit:gentoolkit commit in: / Slawek Lis
2014-08-29 4:04 Brian Dolbec
2014-01-21 11:25 slis
2013-11-02 17:50 Paul Varner
2013-09-05 14:47 Paul Varner
2013-01-04 2:31 Paul Varner
2013-01-02 23:12 Paul Varner
2012-12-22 17:12 Brian Dolbec
2012-12-18 10:42 Paul Varner
2012-06-29 2:24 Brian Dolbec
2012-02-06 16:23 Paul Varner
2011-12-19 19:40 Paul Varner
2011-07-14 1:44 Brian Dolbec
2011-05-29 10:59 Christian Ruppert
2011-05-12 2:55 Paul Varner
2011-05-12 2:55 Paul Varner
2011-02-23 9:10 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356227265.9557946ecdb28ebebc38f664dd770a690e50d64a.dol-sen@gentoo \
--to=brian.dolbec@gmail.com \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox