diff options
author | W. Trevor King <wking@drexel.edu> | 2012-02-16 16:15:24 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2012-02-16 16:43:50 -0500 |
commit | 21286ccdbbf4c8853545392df087244fc8510293 (patch) | |
tree | 60b5e9601055cc28307752707d17dc6a672256f6 | |
parent | 0d3d9a3780a27f1c80833638ad0622bf4e67023d (diff) | |
download | bugseverywhere-21286ccdbbf4c8853545392df087244fc8510293.tar.gz |
Add update-copyright as a submodule and update release.py accordingly.
Also add `**kwargs` to `invoke` so we can specify the environment.
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | libbe/util/subproc.py | 6 | ||||
-rwxr-xr-x | release.py | 10 | ||||
m--------- | update-copyright | 0 |
4 files changed, 15 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5bbe5ed --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "update-copyright"] + path = update-copyright + url = git://gitorious.org/update-copyright/wtk.git diff --git a/libbe/util/subproc.py b/libbe/util/subproc.py index 2c45f0c..3a66f49 100644 --- a/libbe/util/subproc.py +++ b/libbe/util/subproc.py @@ -48,7 +48,7 @@ class CommandError(Exception): def invoke(args, stdin=None, stdout=PIPE, stderr=PIPE, expect=(0,), cwd=None, shell=None, unicode_output=True, verbose=False, - encoding=None): + encoding=None, **kwargs): """ expect should be a tuple of allowed exit codes. cwd should be the directory from which the command will be executed. When @@ -70,14 +70,14 @@ def invoke(args, stdin=None, stdout=PIPE, stderr=PIPE, expect=(0,), if shell is None: shell = False q = Popen(args, stdin=PIPE, stdout=stdout, stderr=stderr, - shell=shell, cwd=cwd) + shell=shell, cwd=cwd, **kwargs) else: assert _MSWINDOWS==True, 'invalid platform' if shell is None: shell = True # win32 don't have os.execvp() so have to run command in a shell q = Popen(args, stdin=PIPE, stdout=stdout, stderr=stderr, - shell=shell, cwd=cwd) + shell=shell, cwd=cwd, **kwargs) except OSError, e: raise CommandError(list_args, status=e.args[0], stderr=e) stdout,stderr = q.communicate(input=stdin) @@ -180,7 +180,15 @@ If you don't like what got committed, you can undo the release with sys.exit(1) set_release_version(_tag) print "Update copyright information..." - status,stdout,stderr = invoke(['update-copyright.py']) + env = dict(os.environ) + pythonpath = os.path.abspath('update-copyright') + if 'PYTHONPATH' in env: + env['PYTHONPATH'] = '{}:{}'.format(pythonpath, env['PYTHONPATH']) + else: + env['PYTHONPATH'] = pythonpath + status,stdout,stderr = invoke([ + os.path.join('update-copyright', 'bin', 'update-copyright.py')], + env=env) commit("Bumped to version %s" % _tag) tag(_tag) create_tarball(_tag) diff --git a/update-copyright b/update-copyright new file mode 160000 +Subproject 1e0bb15fbf0be2d440e5d1dbbaa82562c9f918b |