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

Side by Side Diff: tools/cr/cr/fixups/arch.py

Issue 142933004: [cr tool] Make context implicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « tools/cr/cr/context.py ('k') | tools/cr/cr/loader.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """A module for architecture output directory fixups.""" 5 """A module for architecture output directory fixups."""
6 6
7 import cr 7 import cr
8 8
9 9
10 class _ArchInitHookHelper(cr.InitHook): 10 class _ArchInitHookHelper(cr.InitHook):
11 """Base class helper for CR_ARCH value fixups.""" 11 """Base class helper for CR_ARCH value fixups."""
12 12
13 def _VersionTest(self, old_version): 13 def _VersionTest(self, old_version):
14 _ = old_version 14 _ = old_version
15 return True 15 return True
16 16
17 def _ArchConvert(self, old_arch): 17 def _ArchConvert(self, old_arch):
18 return old_arch 18 return old_arch
19 19
20 def Run(self, context, old_version, config): 20 def Run(self, old_version, config):
21 if old_version is None or not self._VersionTest(old_version): 21 if old_version is None or not self._VersionTest(old_version):
22 return 22 return
23 old_arch = config.OVERRIDES.Find(cr.Arch.SELECTOR) 23 old_arch = config.OVERRIDES.Find(cr.Arch.SELECTOR)
24 new_arch = self._ArchConvert(old_arch) 24 new_arch = self._ArchConvert(old_arch)
25 if new_arch != old_arch: 25 if new_arch != old_arch:
26 print '** Fixing architecture from {0} to {1}'.format(old_arch, new_arch) 26 print '** Fixing architecture from {0} to {1}'.format(old_arch, new_arch)
27 config.OVERRIDES[cr.Arch.SELECTOR] = new_arch 27 config.OVERRIDES[cr.Arch.SELECTOR] = new_arch
28 28
29 29
30 class WrongArchDefaultInitHook(_ArchInitHookHelper): 30 class WrongArchDefaultInitHook(_ArchInitHookHelper):
(...skipping 14 matching lines...) Expand all
45 class MipsAndArmRenameInitHook(_ArchInitHookHelper): 45 class MipsAndArmRenameInitHook(_ArchInitHookHelper):
46 """Fixes rename of Mips and Arm to Mips32 and Arm32.""" 46 """Fixes rename of Mips and Arm to Mips32 and Arm32."""
47 47
48 def _ArchConvert(self, old_arch): 48 def _ArchConvert(self, old_arch):
49 if old_arch == 'mips': 49 if old_arch == 'mips':
50 return cr.Mips32Arch.GetInstance().name 50 return cr.Mips32Arch.GetInstance().name
51 if old_arch == 'arm': 51 if old_arch == 'arm':
52 return cr.Arm32Arch.GetInstance().name 52 return cr.Arm32Arch.GetInstance().name
53 return old_arch 53 return old_arch
54 54
OLDNEW
« no previous file with comments | « tools/cr/cr/context.py ('k') | tools/cr/cr/loader.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698