OLD | NEW |
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium OS 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 """Implementation of the various portage wrapper commands.""" | 5 """Implementation of the various portage wrapper commands.""" |
6 | 6 |
7 | 7 |
8 from chromite.shell import subcmd | 8 from chromite.shell import subcmd |
9 | 9 |
10 | 10 |
11 class EbuildCmd(subcmd.WrappedChrootCmd): | 11 class EbuildCmd(subcmd.WrappedChrootCmd): |
12 """Run ebuild.""" | 12 """Run ebuild.""" |
13 | 13 |
14 def __init__(self): | 14 def __init__(self): |
15 """EbuildCmd constructor.""" | 15 """EbuildCmd constructor.""" |
16 # Just call the WrappedChrootCmd superclass, which does most of the work. | 16 # Just call the WrappedChrootCmd superclass, which does most of the work. |
17 super(EbuildCmd, self).__init__( | 17 super(EbuildCmd, self).__init__( |
18 'EBUILD', | |
19 ['ebuild-%s'], ['ebuild'], | 18 ['ebuild-%s'], ['ebuild'], |
20 need_args=True, | 19 need_args=True, |
21 env_whitelist=['CHROME_ORIGIN', 'FEATURES', 'USE'] | 20 env_whitelist=['CHROME_ORIGIN', 'FEATURES', 'USE'] |
22 ) | 21 ) |
23 | 22 |
24 | 23 |
25 class EmergeCmd(subcmd.WrappedChrootCmd): | 24 class EmergeCmd(subcmd.WrappedChrootCmd): |
26 """Run emerge.""" | 25 """Run emerge.""" |
27 | 26 |
28 def __init__(self): | 27 def __init__(self): |
29 """EmergeCmd constructor.""" | 28 """EmergeCmd constructor.""" |
30 # Just call the WrappedChrootCmd superclass, which does most of the work. | 29 # Just call the WrappedChrootCmd superclass, which does most of the work. |
31 super(EmergeCmd, self).__init__( | 30 super(EmergeCmd, self).__init__( |
32 'EMERGE', | |
33 ['emerge-%s'], ['sudo', 'emerge'], | 31 ['emerge-%s'], ['sudo', 'emerge'], |
34 need_args=True, | 32 need_args=True, |
35 env_whitelist=['CHROME_ORIGIN', 'FEATURES', 'USE'] | 33 env_whitelist=['CHROME_ORIGIN', 'FEATURES', 'USE'] |
36 ) | 34 ) |
37 | 35 |
38 | 36 |
39 class EqueryCmd(subcmd.WrappedChrootCmd): | 37 class EqueryCmd(subcmd.WrappedChrootCmd): |
40 """Run equery.""" | 38 """Run equery.""" |
41 | 39 |
42 def __init__(self): | 40 def __init__(self): |
43 """EqueryCmd constructor.""" | 41 """EqueryCmd constructor.""" |
44 # Just call the WrappedChrootCmd superclass, which does most of the work. | 42 # Just call the WrappedChrootCmd superclass, which does most of the work. |
45 super(EqueryCmd, self).__init__( | 43 super(EqueryCmd, self).__init__( |
46 'EQUERY', | |
47 ['equery-%s'], ['equery'], | 44 ['equery-%s'], ['equery'], |
48 need_args=True | 45 need_args=True |
49 ) | 46 ) |
50 | 47 |
51 | 48 |
52 class PortageqCmd(subcmd.WrappedChrootCmd): | 49 class PortageqCmd(subcmd.WrappedChrootCmd): |
53 """Run portageq.""" | 50 """Run portageq.""" |
54 | 51 |
55 def __init__(self): | 52 def __init__(self): |
56 """PortageqCmd constructor.""" | 53 """PortageqCmd constructor.""" |
57 # Just call the WrappedChrootCmd superclass, which does most of the work. | 54 # Just call the WrappedChrootCmd superclass, which does most of the work. |
58 super(PortageqCmd, self).__init__( | 55 super(PortageqCmd, self).__init__( |
59 'PORTAGEEQ', | |
60 ['portageq-%s'], ['portageq'], | 56 ['portageq-%s'], ['portageq'], |
61 need_args=True | 57 need_args=True |
62 ) | 58 ) |
OLD | NEW |