OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 | 6 |
7 import io | 7 import io |
8 import os | 8 import os |
9 import re | 9 import re |
10 import signal | 10 import signal |
11 import stat | 11 import stat |
12 import sys | 12 import sys |
13 import tempfile | 13 import tempfile |
14 import urllib | 14 import urllib |
15 | 15 |
16 | 16 |
17 DEPOT_GIT_DIR = 'git_bin' | 17 DEPOT_GIT_DIR = 'git-1.8.0_bin' |
18 DEPOT_GIT_FILE = '%s.zip' % DEPOT_GIT_DIR | 18 DEPOT_GIT_FILE = '%s.zip' % DEPOT_GIT_DIR |
19 # The Git scripts call these exes directly, so we keep them in our distribution. | 19 # The Git scripts call these exes directly, so we keep them in our distribution. |
20 LIBEXEC_EXEMPT_LIST = [ | 20 LIBEXEC_EXEMPT_LIST = [ |
21 'git-clone.exe', | 21 'git-clone.exe', |
22 'git-fetch.exe', | 22 'git-fetch.exe', |
23 'git-merge-base.exe', | 23 'git-merge-base.exe', |
24 'git-merge-file.exe', | 24 'git-merge-file.exe', |
25 'git-merge-index.exe', | 25 'git-merge-index.exe', |
26 'git-merge-ours.exe', | 26 'git-merge-ours.exe', |
27 'git-merge-recursive.exe', | 27 'git-merge-recursive.exe', |
28 'git-merge-subtree.exe', | 28 'git-merge-subtree.exe', |
29 'git-merge-tree.exe', | 29 'git-merge-tree.exe', |
30 'git-merge.exe', | 30 'git-merge.exe', |
31 'git-rev-parse.exe', | 31 'git-rev-parse.exe', |
32 'git-unpack-file.exe', | 32 'git-unpack-file.exe', |
33 ] | 33 ] |
34 PORTABLE_GIT_FILE = 'portablegit.7z' | 34 PORTABLE_GIT_FILE = 'portablegit.7z' |
35 PORTABLE_GIT_URL = ( | 35 PORTABLE_GIT_URL = ( |
36 'http://msysgit.googlecode.com/files/PortableGit-1.7.4-preview20110204.7z') | 36 'https://msysgit.googlecode.com/files/PortableGit-1.8.0-preview20121022.7z') |
37 SCRIPTDIR = os.path.dirname(os.path.abspath(__file__)) | 37 SCRIPTDIR = os.path.dirname(os.path.abspath(__file__)) |
38 WIN32PAD_FILE = 'win32pad.zip' | 38 WIN32PAD_FILE = 'win32pad.zip' |
39 WIN32PAD_URL = 'http://www.gena01.com/win32pad/win32pad_1_5_10_4.zip' | 39 WIN32PAD_URL = 'http://www.gena01.com/win32pad/win32pad_1_5_10_4.zip' |
40 | 40 |
41 | 41 |
42 class FlushFile(io.TextIOWrapper): | 42 class FlushFile(io.TextIOWrapper): |
43 def __init__(self, f): | 43 def __init__(self, f): |
44 self.f = f | 44 self.f = f |
45 def write(self, x): | 45 def write(self, x): |
46 self.f.write(x) | 46 self.f.write(x) |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 # end with something other than .exe. | 93 # end with something other than .exe. |
94 if not (gitfile.startswith('git-') and gitfile.endswith('.exe')): | 94 if not (gitfile.startswith('git-') and gitfile.endswith('.exe')): |
95 continue | 95 continue |
96 # Skip any git files in the LIBEXEC_EXEMPT_LIST. The Git scripts call into | 96 # Skip any git files in the LIBEXEC_EXEMPT_LIST. The Git scripts call into |
97 # these exes directly. | 97 # these exes directly. |
98 if gitfile in LIBEXEC_EXEMPT_LIST: | 98 if gitfile in LIBEXEC_EXEMPT_LIST: |
99 continue | 99 continue |
100 if GetFileSize(gitfile) == gitexe_size: | 100 if GetFileSize(gitfile) == gitexe_size: |
101 os.system('rm %s' % gitfile) | 101 os.system('rm %s' % gitfile) |
102 | 102 |
103 # Move back to <tmp>/git_bin/. | 103 # Move back to <tmp>/git-1.8.0_bin/. |
104 os.chdir('../../') | 104 os.chdir('../../') |
105 | 105 |
106 # Place extra files into the archive directory. | 106 # Place extra files into the archive directory. |
107 os.system('cp %s/files/MANIFEST.chromium ./' % SCRIPTDIR) | 107 os.system('cp %s/files/MANIFEST.chromium ./' % SCRIPTDIR) |
108 os.system('cp %s/files/git.bat ./' % SCRIPTDIR) | 108 os.system('cp %s/files/git.bat ./' % SCRIPTDIR) |
109 os.system('cp %s/files/git.cmd ./cmd/' % SCRIPTDIR) | 109 os.system('cp %s/files/git.cmd ./cmd/' % SCRIPTDIR) |
110 os.system('cp %s/files/gitk.bat ./' % SCRIPTDIR) | 110 os.system('cp %s/files/gitk.bat ./' % SCRIPTDIR) |
111 os.system('cp %s/files/gitk.cmd ./cmd/' % SCRIPTDIR) | 111 os.system('cp %s/files/gitk.cmd ./cmd/' % SCRIPTDIR) |
112 os.system('cp %s/files/ssh_config ./' % SCRIPTDIR) | 112 os.system('cp %s/files/ssh_config ./' % SCRIPTDIR) |
113 os.system('cp %s/files/ssh.bat ./' % SCRIPTDIR) | 113 os.system('cp %s/files/ssh.bat ./' % SCRIPTDIR) |
(...skipping 19 matching lines...) Expand all Loading... |
133 # Set the archive aside. | 133 # Set the archive aside. |
134 os.chdir(SCRIPTDIR) | 134 os.chdir(SCRIPTDIR) |
135 os.system('mv %s/%s ./' % (tempdir, DEPOT_GIT_FILE)) | 135 os.system('mv %s/%s ./' % (tempdir, DEPOT_GIT_FILE)) |
136 RemoveTempdir(tempdir) | 136 RemoveTempdir(tempdir) |
137 | 137 |
138 return 0 | 138 return 0 |
139 | 139 |
140 | 140 |
141 if __name__ == '__main__': | 141 if __name__ == '__main__': |
142 sys.exit(main()) | 142 sys.exit(main()) |
OLD | NEW |