Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: tools/export_tarball/export_v8_tarball.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/export_tarball/export_tarball.py ('k') | tools/flakiness/find_flakiness.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/export_tarball/export_v8_tarball.py
diff --git a/tools/export_tarball/export_v8_tarball.py b/tools/export_tarball/export_v8_tarball.py
old mode 100644
new mode 100755
index 3119954328394bc6fcefea7dd8f294c3710a7b03..14f8267c6c70632c8d0faa3cee4e5eea38ccefae
--- a/tools/export_tarball/export_v8_tarball.py
+++ b/tools/export_tarball/export_v8_tarball.py
@@ -1,10 +1,9 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""
-This tool creates a tarball with V8 sources, but without .svn directories.
+"""Creates a tarball with V8 sources, but without .svn directories.
This allows easy packaging of V8, synchronized with browser releases.
@@ -33,6 +32,7 @@ _V8_PATTERNS = [
_V8_BUILD_NUMBER_PATTERN,
_V8_PATCH_LEVEL_PATTERN]
+
def GetV8Version(v8_directory):
"""
Returns version number as string based on the string
@@ -50,13 +50,16 @@ def GetV8Version(v8_directory):
return '.'.join(version_components)
+
def GetSourceDirectory():
return os.path.realpath(
os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src'))
+
def GetV8Directory():
return os.path.join(GetSourceDirectory(), 'v8')
+
# Workaround lack of the exclude parameter in add method in python-2.4.
# TODO(phajdan.jr): remove the workaround when it's not needed on the bot.
class MyTarFile(tarfile.TarFile):
@@ -67,6 +70,7 @@ class MyTarFile(tarfile.TarFile):
tarfile.TarFile.add(self, name, arcname=arcname, recursive=recursive)
+
def main(argv):
parser = optparse.OptionParser()
options, args = parser.parse_args(argv)
@@ -99,5 +103,6 @@ def main(argv):
return 0
+
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
« no previous file with comments | « tools/export_tarball/export_tarball.py ('k') | tools/flakiness/find_flakiness.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698