Patch for BZ 303791?

Clark Williams williams at redhat.com
Thu Oct 4 17:40:39 UTC 2007


-----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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD4DBQFHBSWXHyuj/+TTEp0RAtzCAJYy31hDn5zsGedHFM/LcWnrBbR5AKDnO10u
ou94vu8Kf369iaF/VKiE7w==
=iG5Y
-----END PGP SIGNATURE-----




More information about the Fedora-buildsys-list mailing list