diff options
| author | Michael E Brown <mebrown@michaels-house.net> | 2007-10-19 04:08:06 -0500 |
|---|---|---|
| committer | Michael E Brown <mebrown@michaels-house.net> | 2007-10-19 04:08:06 -0500 |
| commit | 4743e490fd45bed0862e80d03f4439fe329f4b0b (patch) | |
| tree | b69838fc9610ac0d981ab6194f2766b25c365ba8 /src | |
| parent | b993e048e4eb10d1ac8d2529b5b86510a0f0e132 (diff) | |
| download | mock-4743e490fd45bed0862e80d03f4439fe329f4b0b.tar.gz mock-4743e490fd45bed0862e80d03f4439fe329f4b0b.tar.xz mock-4743e490fd45bed0862e80d03f4439fe329f4b0b.zip | |
need to return output from mock in some circumstances (depsolving).
Diffstat (limited to 'src')
| -rw-r--r-- | src/py-libs/backend.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/py-libs/backend.py b/src/py-libs/backend.py index 219ef10..9387417 100644 --- a/src/py-libs/backend.py +++ b/src/py-libs/backend.py @@ -278,7 +278,7 @@ class Root(object): # everything exists, okay, install them all. # pass build reqs (as strings) to installer if arg_string != "": - output = self._yum('resolvedep %s' % arg_string) + output = self._yum('resolvedep %s' % arg_string, returnOutput=1) for line in output.split('\n'): if line.lower().find('No Package found for'.lower()) != -1: raise mock.exception.BuildError, "Bad build req: %s. Exiting." % line @@ -564,15 +564,16 @@ class Root(object): mock.util.do(cmd, raiseExc=0) @traceLog(moduleLog) - def _yum(self, cmd): + def _yum(self, cmd, returnOutput=0): """use yum to install packages/package groups into the chroot""" # mock-helper yum --installroot=rootdir cmd cmd = '%s --installroot %s %s' % (self.yum_path, self.rootdir, cmd) self.root_log.info(cmd) try: self._callHooks("preyum") - mock.util.do(cmd) + output = mock.util.do(cmd, returnOutput=returnOutput) self._callHooks("postyum") + return output except mock.exception.Error, e: self.root_log.exception("Error performing yum command: %s" % cmd) raise mock.exception.YumError, "Error performing yum command: %s" % cmd |
