Patch for BZ 303791?

seth vidal skvidal at fedoraproject.org
Thu Oct 4 17:42:09 UTC 2007


On Thu, 2007-10-04 at 12:40 -0500, Clark Williams wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Below is a patch for the $SUBJECT bz. I originally just changed the case of the
> search string to match what 'yum resolvedep' was printing, but then I thought about
> whether folks might not have the changed version of yum...
> 
> After I took an aspirin to deal with the dependency combinatorial explosion headache,
> I looked at the code again. I didn't really want to pull in the re package just for
> this one case, so I resorted to doing a case-insensitive match, which I *hope* will
> deal with most cases.
> 
> What do you guys think?
> 
> Clark
> 
> diff --git a/mock.py b/mock.py
> index 54b8f8c..35c3592 100644
> - --- a/mock.py
> +++ b/mock.py
> @@ -355,9 +355,11 @@ class Root:
>          # pass build reqs (as strings) to installer
>          if arg_string != "":
>              (retval, output) = self.yum('resolvedep %s' % arg_string)
> +            searchstr = 'no package found for'
>              for line in output.split('\n'):
> - -                if line.find('No Package found for') != -1:
> - -                    errorpkg = line.replace('No Package found for', '')
> +                idx = line.lower().find(searchstr)
> +                if idx != -1:
> +                    errorpkg = line[idx+len(searchstr):]
>                      error(output)
>                      raise BuildError, "Cannot find build req %s. Exiting." % errorpkg
>              # nothing made us exit, so we continue

Is it time to start writing simple, custom yum-utils just for mock? So
it can call them as a program but also so mock can more rigidly control
its output?

-sv





More information about the Fedora-buildsys-list mailing list