summaryrefslogtreecommitdiffstats
path: root/tools/export_tarball
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 17:25:34 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 17:25:34 +0000
commitcb155a802bdc49cfafea1c41e0f0a92168f1da09 (patch)
treebf0fae4855c7f4458d8e959455b9d12d6cd54d9d /tools/export_tarball
parent9bec23957253b83955c4096903ad6293d1c6e1bb (diff)
downloadchromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.zip
chromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.tar.gz
chromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.tar.bz2
Fix python scripts in src/tools/
Make sure that: - shebang is only present for executable files - shebang is #!/usr/bin/env python - __main__ is only present for executable files - file's executable bit is coherent Also fix EOF LF to be only one. TBR=timurrrr@chromium.org BUG=105108 TEST= Review URL: http://codereview.chromium.org/8678023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/export_tarball')
-rwxr-xr-x[-rw-r--r--]tools/export_tarball/export_tarball.py7
-rwxr-xr-x[-rw-r--r--]tools/export_tarball/export_v8_tarball.py11
2 files changed, 14 insertions, 4 deletions
diff --git a/tools/export_tarball/export_tarball.py b/tools/export_tarball/export_tarball.py
index 97cba10..861503e 100644..100755
--- a/tools/export_tarball/export_tarball.py
+++ b/tools/export_tarball/export_tarball.py
@@ -1,4 +1,4 @@
-#!/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.
@@ -22,6 +22,7 @@ import subprocess
import sys
import tarfile
+
NONESSENTIAL_DIRS = (
'chrome/common/extensions/docs',
'chrome/test/data',
@@ -57,10 +58,12 @@ NONESSENTIAL_DIRS = (
'webkit/tools/test/reference_build',
)
+
def GetSourceDirectory():
return os.path.realpath(
os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src'))
+
# 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):
@@ -80,6 +83,7 @@ class MyTarFile(tarfile.TarFile):
tarfile.TarFile.add(self, name, arcname=arcname, recursive=recursive)
+
def main(argv):
parser = optparse.OptionParser()
parser.add_option("--remove-nonessential-files",
@@ -109,5 +113,6 @@ def main(argv):
return 0
+
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
diff --git a/tools/export_tarball/export_v8_tarball.py b/tools/export_tarball/export_v8_tarball.py
index 3119954..14f8267 100644..100755
--- 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:]))