[PATCH] yum-builddep: print all missing deps, not only the first one found

View: New views
3 Messages — Rating Filter:   Alert me  

[PATCH] yum-builddep: print all missing deps, not only the first one found

by Daniel Mach :: Rate this Message:

| View Threaded | Show Only this Message

---
 yum-builddep.py |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/yum-builddep.py b/yum-builddep.py
index f67c810..3251949 100755
--- a/yum-builddep.py
+++ b/yum-builddep.py
@@ -152,6 +152,7 @@ class YumBuildDep(YumUtilBase):
                     sys.exit(1)
 
     def install_deps(self, deplist):
+        errors = set()
         for dep in deplist:
             self.logger.debug(' REQ:  %s' % dep)                
             if dep.startswith("rpmlib("):
@@ -164,10 +165,13 @@ class YumBuildDep(YumUtilBase):
                 pkg = self.returnPackageByDep(dep)
                 self.logger.info(' --> %s' % pkg)
                 self.install(pkg)
-                
             except yum.Errors.YumBaseError, e:
-                self.logger.error("Error: %s" % e)
-                sys.exit(1)
+                errors.add(unicode(e))
+
+        if errors:
+            for i in sorted(errors):
+                self.logger.error("Error: %s" % i)
+            sys.exit(1)
 
     # go through each of the pkgs, figure out what they are/where they are
     # if they are not a local package then run
--
1.7.10.2

_______________________________________________
Yum-devel mailing list
Yum-devel@...
http://lists.baseurl.org/mailman/listinfo/yum-devel

Re: [PATCH] yum-builddep: print all missing deps, not only the first one found

by Zdenek Pavlas-2 :: Rate this Message:

| View Threaded | Show Only this Message

> -                self.logger.error("Error: %s" % e)
> +                errors.add(unicode(e))

ACK, but I'd remove the unicode() call, as it fails in old python.
There's exception2msg() in yum.i18n that converts exception to
unicode correctly (with all the hairy fallbacks).
_______________________________________________
Yum-devel mailing list
Yum-devel@...
http://lists.baseurl.org/mailman/listinfo/yum-devel

Re: [PATCH] yum-builddep: print all missing deps, not only the first one found

by James Antill-9 :: Rate this Message:

| View Threaded | Show Only this Message

On Thu, 2012-06-14 at 08:03 -0400, Zdenek Pavlas wrote:
> > -                self.logger.error("Error: %s" % e)
> > +                errors.add(unicode(e))
>
> ACK, but I'd remove the unicode() call, as it fails in old python.
> There's exception2msg() in yum.i18n that converts exception to
> unicode correctly (with all the hairy fallbacks).

 Pretty sure Daniel doesn't have commit access, I use "git am" or "git
commit --author" but haven't got around to this one, yet (feel free :).

_______________________________________________
Yum-devel mailing list
Yum-devel@...
http://lists.baseurl.org/mailman/listinfo/yum-devel