[csw-devel] SF.net SVN: gar:[8640] csw/mgar/gar/v2
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Thu Feb 18 09:35:57 CET 2010
Revision: 8640
http://gar.svn.sourceforge.net/gar/?rev=8640&view=rev
Author: wahwah
Date: 2010-02-18 08:35:57 +0000 (Thu, 18 Feb 2010)
Log Message:
-----------
mGAR v2: Printing out ready to use override statements when errors are found.
Modified Paths:
--------------
csw/mgar/gar/v2/bin/analyze_module_results.py
csw/mgar/gar/v2/bin/checkpkg
csw/mgar/gar/v2/lib/python/checkpkg.py
csw/mgar/gar/v2/lib/python/opencsw.py
Property Changed:
----------------
csw/mgar/gar/v2/lib/python/opencsw.py
Modified: csw/mgar/gar/v2/bin/analyze_module_results.py
===================================================================
--- csw/mgar/gar/v2/bin/analyze_module_results.py 2010-02-18 07:22:39 UTC (rev 8639)
+++ csw/mgar/gar/v2/bin/analyze_module_results.py 2010-02-18 08:35:57 UTC (rev 8640)
@@ -30,16 +30,22 @@
fd = open(os.path.join(options.extractdir, file_name))
for line in fd:
if line.startswith("#"):
- continue
+ continue
pkgname, tag_name, tag_info = checkpkg.ParseTagLine(line)
error_tags.append(checkpkg.CheckpkgTag(pkgname, tag_name, tag_info))
overrides = reduce(lambda x, y: x + y, overrides_list)
tags_after_overrides = checkpkg.ApplyOverrides(error_tags, overrides)
exit_code = bool(tags_after_overrides)
if tags_after_overrides:
- print "The reported error tags are:"
+ print "There were errors reported."
+ print "If you know they are false positives, you can override them:"
for tag in tags_after_overrides:
- print "*", repr(tag)
+ if tag.tag_info:
+ tag_postfix = "|%s" % tag.tag_info.replace(" ", "|")
+ else:
+ tag_postfix = ""
+ print ("CHECKPKG_OVERRIDES_%s = %s%s"
+ % (tag.pkgname, tag.tag_name, tag_postfix))
sys.exit(exit_code)
Modified: csw/mgar/gar/v2/bin/checkpkg
===================================================================
--- csw/mgar/gar/v2/bin/checkpkg 2010-02-18 07:22:39 UTC (rev 8639)
+++ csw/mgar/gar/v2/bin/checkpkg 2010-02-18 08:35:57 UTC (rev 8640)
@@ -637,18 +637,20 @@
print "All modular tests completed. Analyzing the reports."
fi
-override_info_printed=0
-for tagfile in ${EXTRACTDIR}/tags.*; do
- if [[ -s "${tagfile}" ]]; then
- if [[ "${override_info_printed}" -ne 1 ]]; then
- echo "# You can use the following lines to create overrides"
- echo "# See http://wiki.opencsw.org/checkpkg"
- override_info_printed=1
+if [[ "${DEBUG}" != "" ]]; then
+ override_info_printed=0
+ for tagfile in ${EXTRACTDIR}/tags.*; do
+ if [[ -s "${tagfile}" ]]; then
+ if [[ "${override_info_printed}" -ne 1 ]]; then
+ echo "# You can use the following lines to create overrides"
+ echo "# See http://wiki.opencsw.org/checkpkg"
+ override_info_printed=1
+ fi
+ echo "# ${tagfile}:"
+ cat "${tagfile}"
fi
- echo "# ${tagfile}:"
- cat "${tagfile}"
- fi
-done
+ done
+fi
# Collecting errors and applying the overrides.
${checkpkg_basedir}/analyze_module_results.py \
Modified: csw/mgar/gar/v2/lib/python/checkpkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg.py 2010-02-18 07:22:39 UTC (rev 8639)
+++ csw/mgar/gar/v2/lib/python/checkpkg.py 2010-02-18 08:35:57 UTC (rev 8640)
@@ -65,7 +65,7 @@
#end if
"""
-ERROR_REPORT_TMPL = u"""#if $errors
+SCREEN_ERROR_REPORT_TMPL = u"""#if $errors and $debug
ERROR: One or more errors have been found by $name.
#for $pkgname in $errors
$pkgname:
@@ -613,7 +613,7 @@
"errors": errors,
"debug": self.debug,
}
- screen_t = Template.Template(ERROR_REPORT_TMPL, searchList=[namespace])
+ screen_t = Template.Template(SCREEN_ERROR_REPORT_TMPL, searchList=[namespace])
tags_report_t = Template.Template(TAG_REPORT_TMPL, searchList=[namespace])
screen_report = unicode(screen_t)
tags_report = unicode(tags_report_t)
Modified: csw/mgar/gar/v2/lib/python/opencsw.py
===================================================================
--- csw/mgar/gar/v2/lib/python/opencsw.py 2010-02-18 07:22:39 UTC (rev 8639)
+++ csw/mgar/gar/v2/lib/python/opencsw.py 2010-02-18 08:35:57 UTC (rev 8640)
@@ -64,7 +64,7 @@
%(body)s
--
-$Id$
+Generated by submitpkg, $Rev$.
"""
Property changes on: csw/mgar/gar/v2/lib/python/opencsw.py
___________________________________________________________________
Modified: svn:keywords
- Id
+ Id
Rev
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