[csw-devel] SF.net SVN: gar:[21017] csw/mgar/gar/v2/lib/python/checkpkg2.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue May 7 00:58:00 CEST 2013


Revision: 21017
          http://gar.svn.sourceforge.net/gar/?rev=21017&view=rev
Author:   wahwah
Date:     2013-05-06 22:57:59 +0000 (Mon, 06 May 2013)
Log Message:
-----------
checkpkg: Better message when errors found

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/checkpkg2.py

Modified: csw/mgar/gar/v2/lib/python/checkpkg2.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg2.py	2013-05-06 22:57:48 UTC (rev 21016)
+++ csw/mgar/gar/v2/lib/python/checkpkg2.py	2013-05-06 22:57:59 UTC (rev 21017)
@@ -26,20 +26,21 @@
 BEFORE_OVERRIDES = """If any of the reported errors were false positives, you
 can override them pasting the lines below to the GAR recipe."""
 
-AFTER_OVERRIDES = """Please note that checkpkg isn't suggesting you should
-simply add these overrides to the Makefile.  It only informs what the overrides
-could look like.  You need to understand what are the reported issues about and
-use your best judgement to decide whether to fix the underlying problems or
-override them. For more information, scroll up and read the detailed
-messages.
-To easily inspect packages you've just built, visit:
-  http://buildfarm.opencsw.org/pkgdb/srv4/
-"""
+AFTER_OVERRIDES = (
+  "Do not copy/paste these overrides without thinking!",
 
-UNAPPLIED_OVERRIDES = """WARNING: Some overrides did not match any errors.
-They can be removed, as they don't take any effect anyway.  If you're getting
-errors at the same time, maybe you didn't specify the overrides correctly."""
+  "If you're not sure, scroll up and read the details. If you're still not "
+  "sure, go to the wiki and read about the error tags you see, or ask "
+  "on the maintainers@ mailing list.",
 
+  "http://wiki.opencsw.org/checkpkg-error-tags",
+)
+
+UNAPPLIED_OVERRIDES = (
+"""WARNING: Some overrides did not match any errors.  They can probably be
+removed, as they don't take any effect anyway.  If you're getting errors at the
+same time, maybe you didn't specify your overrides correctly.""")
+
 cc = common_constants
 
 class Error(Exception):
@@ -175,7 +176,21 @@
         print(textwrap.fill(BEFORE_OVERRIDES, 80))
         for checkpkg_tag in tags_after_overrides:
           print checkpkg_tag.ToGarSyntax()
-        print textwrap.fill(AFTER_OVERRIDES, 80)
+        print
+        for paragraph in AFTER_OVERRIDES:
+          print(textwrap.fill(paragraph, 80))
+          print
+      elif error_tags:
+        msg = (
+            'Fair enough, there were %d error tags, '
+            'but they were all overridden. '
+            "Just make sure you didn't override anything silly, like "
+            'sparc binaries in a i386 package.'
+            % len(error_tags))
+        print
+      else:
+        print('Jolly good! All checks passed, no error tags reported.')
+
       if unapplied_overrides:
         print textwrap.fill(UNAPPLIED_OVERRIDES, 80)
         for override in unapplied_overrides:

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list