Chromium Code Reviews| Index: shell/subcmds/portage_cmds.py |
| diff --git a/shell/subcmds/portage_cmds.py b/shell/subcmds/portage_cmds.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1389af5abd8f1a3c389a7d83e2a37c405c481e3c |
| --- /dev/null |
| +++ b/shell/subcmds/portage_cmds.py |
| @@ -0,0 +1,58 @@ |
| +#!/usr/bin/python |
| +# |
|
sosa
2011/02/02 01:16:19
same
diandersAtChromium
2011/02/02 01:49:10
Done.
|
| +# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +"""Implementation of the various portage wrapper commands.""" |
| + |
| + |
| +from chromite.shell import subcmd |
| + |
| + |
| +class EbuildCmd(subcmd.WrappedChrootCmd): |
| + """Run ebuild.""" |
| + |
| + def __init__(self): |
| + """EbuildCmd constructor.""" |
| + # Just call the WrappedChrootCmd superclass, which does most of the work. |
| + super(EbuildCmd, self).__init__( |
| + ['ebuild-%s'], ['ebuild'], |
| + need_args=True |
| + ) |
| + |
| + |
| +class EmergeCmd(subcmd.WrappedChrootCmd): |
| + """Run emerge.""" |
| + |
| + def __init__(self): |
| + """EmergeCmd constructor.""" |
| + # Just call the WrappedChrootCmd superclass, which does most of the work. |
| + super(EmergeCmd, self).__init__( |
| + ['emerge-%s'], ['sudo', 'emerge'], |
| + need_args=True |
| + ) |
| + |
| + |
| +class EqueryCmd(subcmd.WrappedChrootCmd): |
| + """Run equery.""" |
| + |
| + def __init__(self): |
| + """EqueryCmd constructor.""" |
| + # Just call the WrappedChrootCmd superclass, which does most of the work. |
| + super(EqueryCmd, self).__init__( |
| + ['equery-%s'], ['equery'], |
| + need_args=True |
| + ) |
| + |
| + |
| +class PortageqCmd(subcmd.WrappedChrootCmd): |
| + """Run portageq.""" |
| + |
| + def __init__(self): |
| + """PortageqCmd constructor.""" |
| + # Just call the WrappedChrootCmd superclass, which does most of the work. |
| + super(PortageqCmd, self).__init__( |
| + ['portageq-%s'], ['portageq'], |
| + need_args=True |
| + ) |