diff options
author | Bernat Gabor <bgabor8@bloomberg.net> | 2018-10-25 10:14:15 +0100 |
---|---|---|
committer | Bernat Gabor <bgabor8@bloomberg.net> | 2018-10-25 10:17:47 +0100 |
commit | d408e62829bac31fe746a25bbdc381a548454f2b (patch) | |
tree | baf2630e97140b3a3ebcd9ecb4370a5dd46860e0 /bin/rebuild-script.py | |
parent | af5711ca9346b265f196a9cf266cecda9bca5b91 (diff) | |
download | virtualenv-add-ci.tar.gz |
add embed tox envadd-ci
Diffstat (limited to 'bin/rebuild-script.py')
-rwxr-xr-x | bin/rebuild-script.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/rebuild-script.py b/bin/rebuild-script.py index d0bc93e..7066bb6 100755 --- a/bin/rebuild-script.py +++ b/bin/rebuild-script.py @@ -16,7 +16,7 @@ def crc32(data): here = os.path.dirname(__file__) -script = os.path.join(here, '..', 'virtualenv.py') +script = os.path.join(here, '..', 'src', 'virtualenv.py') gzip = codecs.lookup('zlib') b64 = codecs.lookup('base64') @@ -28,6 +28,7 @@ file_template = b'##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")' def rebuild(script_path): + exit_code = 0 with open(script_path, 'rb') as f: script_content = f.read() parts = [] @@ -52,6 +53,7 @@ def rebuild(script_path): print(' File up to date (crc: %08x)' % new_crc) parts += [match.group(0)] continue + exit_code = 1 # Else: content has changed crc = crc32(gzip.decode(b64.decode(data)[0])[0]) print(' Content changed (crc: %08x -> %08x)' % @@ -75,6 +77,7 @@ def rebuild(script_path): print('No changes in content') if match is None: print('No variables were matched/found') + raise SystemExit(exit_code) if __name__ == '__main__': rebuild(script) |