summaryrefslogtreecommitdiffstats
path: root/chromium/tools/cr/cr/fixups/arch.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/tools/cr/cr/fixups/arch.py')
-rw-r--r--chromium/tools/cr/cr/fixups/arch.py54
1 files changed, 0 insertions, 54 deletions
diff --git a/chromium/tools/cr/cr/fixups/arch.py b/chromium/tools/cr/cr/fixups/arch.py
deleted file mode 100644
index e6ac81c5083..00000000000
--- a/chromium/tools/cr/cr/fixups/arch.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2013 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.
-
-"""A module for architecture output directory fixups."""
-
-import cr
-
-
-class _ArchInitHookHelper(cr.InitHook):
- """Base class helper for CR_ARCH value fixups."""
-
- def _VersionTest(self, old_version):
- _ = old_version
- return True
-
- def _ArchConvert(self, old_arch):
- return old_arch
-
- def Run(self, context, old_version, config):
- if old_version is None or not self._VersionTest(old_version):
- return
- old_arch = config.OVERRIDES.Find(cr.Arch.SELECTOR)
- new_arch = self._ArchConvert(old_arch)
- if new_arch != old_arch:
- print '** Fixing architecture from {0} to {1}'.format(old_arch, new_arch)
- config.OVERRIDES[cr.Arch.SELECTOR] = new_arch
-
-
-class WrongArchDefaultInitHook(_ArchInitHookHelper):
- """Fixes bad initial defaults.
-
- In the initial versions of cr before output directories were versioned
- it was writing invalid architecture defaults. This detects that case and sets
- the architecture to the current default instead.
- """
-
- def _VersionTest(self, old_version):
- return old_version <= 0.0
-
- def _ArchConvert(self, _):
- return cr.Arch.default.name
-
-
-class MipsAndArmRenameInitHook(_ArchInitHookHelper):
- """Fixes rename of Mips and Arm to Mips32 and Arm32."""
-
- def _ArchConvert(self, old_arch):
- if old_arch == 'mips':
- return cr.Mips32Arch.GetInstance().name
- if old_arch == 'arm':
- return cr.Arm32Arch.GetInstance().name
- return old_arch
-