[Piuparts-commits] [SCM] piuparts git repository branch, bikeshed, updated. 0.52-38-gd631ca4

Holger Levsen holger at layer-acht.org
Thu May 30 15:01:33 UTC 2013


The following commit has been merged in the bikeshed branch:
commit d631ca4107926c148f0424b4f505fe9472c733bb
Author: Holger Levsen <holger at layer-acht.org>
Date:   Wed May 29 02:35:43 2013 +0200

    Categorize adequate results.
    
    * piuparts.py: categorize adequate results using inadequate_tags, boring_tags,
      ignored_tags and unknown. Show adequate exit code if non-zero.
    * Add known_problems/*inadequate*.conf for all adequate tags we care
      about.
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>

diff --git a/TODO b/TODO
index c5407b8..9b62413 100644
--- a/TODO
+++ b/TODO
@@ -58,6 +58,9 @@ for 0.5x:
 - maybe compress all logfiles
 
 
+- once adequate 0.6 (which is fixing #709372) is available, don't run adequate
+  tests for ignored_tags anymore.
+
 
 for 0.6x:
 
diff --git a/debian/changelog b/debian/changelog
index b24c3a5..29834a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -45,6 +45,10 @@ piuparts (0.53) UNRELEASED; urgency=low
   * conf/crontab-master: run gather_bts_stats daily.
   * master-bin/prepare_backup: backup bts_stats.txt and do not backup
     sources.txt.
+  * piuparts.py: categorize adequate results using inadequate_tags,
+    boring_tags, ignored_tags and unknown. Show adequate exit code if
+    non-zero.
+  * Add known_problems/*inadequate*.conf for all adequate tags we care about.
 
   [ Andrew Starr-Bochicchio ]
   * piuparts.py:
diff --git a/known_problems/bin_or_sbin_binary_requires_usr_lib_library_inadequate_issue.conf b/known_problems/bin_or_sbin_binary_requires_usr_lib_library_inadequate_issue.conf
new file mode 100644
index 0000000..62fec19
--- /dev/null
+++ b/known_problems/bin_or_sbin_binary_requires_usr_lib_library_inadequate_issue.conf
@@ -0,0 +1,11 @@
+#
+# detect packages with some inadequate tag from adequate
+#
+PATTERN='(FAIL|WARN): Running adequate resulted in .*bin-or-sbin-binary-requires-usr-lib-library'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER="Packages tagged 'bin-or-sbin-binary-requires-usr-lib-library' by adequate"
+HELPTEXT="
+<p>Running <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> resulted in the package being tagged 'bin-or-sbin-binary-requires-usr-lib-library' which indicates a bug.
+</p>
+"
diff --git a/known_problems/boring_broken_symlink_inadequate_issue.conf b/known_problems/boring_broken_symlink_inadequate_issue.conf
new file mode 100644
index 0000000..f725394
--- /dev/null
+++ b/known_problems/boring_broken_symlink_inadequate_issue.conf
@@ -0,0 +1,10 @@
+#
+# detect packages which have the string "Running adequate resulted in less interesting tags found" in their logs
+#
+PATTERN='(FAIL|WARN): Running adequate resulted in less interesting tags found .*broken-symlink'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER="Packages tagged 'broken-symlink' by adequate"
+HELPTEXT="
+<p>Some issues detected by <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> are also detected by piuparts, 'broken-symlink' is one of them.
+"
diff --git a/known_problems/boring_missing_copyright_file_inadequate_issue.conf b/known_problems/boring_missing_copyright_file_inadequate_issue.conf
new file mode 100644
index 0000000..f5d2ae6
--- /dev/null
+++ b/known_problems/boring_missing_copyright_file_inadequate_issue.conf
@@ -0,0 +1,10 @@
+#
+# detect packages which have the string "Running adequate resulted in less interesting tags found" in their logs
+#
+PATTERN='(FAIL|WARN): Running adequate resulted in less interesting tags found .*missing-copyright-file'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER="Packages tagged 'missing-copyright-file' by adequate"
+HELPTEXT="
+<p>Some issues detected by <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> are also detected by piuparts, 'missing-copyright-file' is one of them.
+"
diff --git a/known_problems/boring_obsolete_conffile_inadequate_issue.conf b/known_problems/boring_obsolete_conffile_inadequate_issue.conf
new file mode 100644
index 0000000..e2ed138
--- /dev/null
+++ b/known_problems/boring_obsolete_conffile_inadequate_issue.conf
@@ -0,0 +1,10 @@
+#
+# detect packages which have the string "Running adequate resulted in less interesting tags found" in their logs
+#
+PATTERN='(FAIL|WARN): Running adequate resulted in less interesting tags found .*obsolete-conffile'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER="Packages tagged 'obsolete-conffile' by adequate"
+HELPTEXT="
+<p>Some issues detected by <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> are also detected by piuparts, 'obsolete-conffile' is one of them.
+"
diff --git a/known_problems/inadequate_error.conf b/known_problems/inadequate_error.conf
deleted file mode 100644
index 10f84b5..0000000
--- a/known_problems/inadequate_error.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# detect packages which have the string "inadequate results from running adequate" in their logs
-#
-PATTERN='(WARN|FAIL): inadequate results from running adequate'
-WHERE='fail bugged affected'
-ISSUE=0
-HEADER='Packages which have logs with the string "inadequate results from running adequate"'
-HELPTEXT='
-<p>This is very probably an error, though since <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> is quite new this hasn't been further investigated nor categorized yet.</p>
-'
diff --git a/known_problems/inadequate_exit_issue.conf b/known_problems/inadequate_exit_issue.conf
new file mode 100644
index 0000000..f549cab
--- /dev/null
+++ b/known_problems/inadequate_exit_issue.conf
@@ -0,0 +1,10 @@
+#
+# detect packages which have the string "Exit code from adequate was" in their logs
+#
+PATTERN='(WARN|FAIL): Exit code from adequate was'
+WHERE='pass fail bugged affected'
+ISSUE=0
+HEADER='Packages which have logs with the string "Exit code from adequate was"'
+HELPTEXT='
+<p>Running <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> resulted in an exit code not equal zero, which indicates a severe problem with adequate. Please investigate and report.</p>
+'
diff --git a/known_problems/inadequate_issue.conf b/known_problems/inadequate_issue.conf
deleted file mode 100644
index ed88ce2..0000000
--- a/known_problems/inadequate_issue.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# detect packages which have the string "inadequate results from running adequate" in their logs
-#
-PATTERN='WARN: inadequate results from running adequate'
-WHERE='pass'
-ISSUE=1
-HEADER='Packages which have logs with the string "inadequate results from running adequate"'
-HELPTEXT='
-<p>This is very probably an error, though since <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> is quite new this hasn't been further investigated nor categorized yet.</p>
-'
diff --git a/known_problems/library_not_found_inadequate_issue.conf b/known_problems/library_not_found_inadequate_issue.conf
new file mode 100644
index 0000000..0731969
--- /dev/null
+++ b/known_problems/library_not_found_inadequate_issue.conf
@@ -0,0 +1,11 @@
+#
+# detect packages with some inadequate tag from adequate
+#
+PATTERN='(FAIL|WARN): Running adequate resulted in .*library-not-found'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER="Packages tagged 'library-not-found' by adequate"
+HELPTEXT="
+<p>Running <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> resulted in the package being tagged 'library-not-found' which indicates a bug.
+</p>
+"
diff --git a/known_problems/py_file_not_bytecompiled_inadequate_issue.conf b/known_problems/py_file_not_bytecompiled_inadequate_issue.conf
new file mode 100644
index 0000000..abbb319
--- /dev/null
+++ b/known_problems/py_file_not_bytecompiled_inadequate_issue.conf
@@ -0,0 +1,11 @@
+#
+# detect packages with some inadequate tag from adequate
+#
+PATTERN='(FAIL|WARN): Running adequate resulted in .*py-file-not-bytecompiled'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER="Packages tagged 'py-file-not-bytecompiled' by adequate"
+HELPTEXT="
+<p>Running <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> resulted in the package being tagged 'py-file-not-bytecompiled' which indicates a bug.
+</p>
+"
diff --git a/known_problems/pyshared_file_not_bytecompiled_inadequate_issue.conf b/known_problems/pyshared_file_not_bytecompiled_inadequate_issue.conf
new file mode 100644
index 0000000..defa5a3
--- /dev/null
+++ b/known_problems/pyshared_file_not_bytecompiled_inadequate_issue.conf
@@ -0,0 +1,11 @@
+#
+# detect packages with some inadequate tag from adequate
+#
+PATTERN='(FAIL|WARN): Running adequate resulted in .*pyshared-file-not-bytecompiled'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER="Packages tagged 'pyshared-file-not-bytecompiled' by adequate"
+HELPTEXT="
+<p>Running <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> resulted in the package being tagged 'pyshared-file-not-bytecompiled' which indicates a bug.
+</p>
+"
diff --git a/known_problems/undefined_symbol_inadequate_issue.conf b/known_problems/undefined_symbol_inadequate_issue.conf
new file mode 100644
index 0000000..082e959
--- /dev/null
+++ b/known_problems/undefined_symbol_inadequate_issue.conf
@@ -0,0 +1,11 @@
+#
+# detect packages with some inadequate tag from adequate
+#
+PATTERN='(FAIL|WARN): Running adequate resulted in .*undefined-symbol'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER="Packages tagged 'undefined-symbol' by adequate"
+HELPTEXT="
+<p>Running <a href="http://packages.debian.org/adequate" target="_blank">adequate</a> resulted in the package being tagged 'undefined-symbol' which indicates a bug.
+</p>
+"
diff --git a/known_problems/unknown_inadequate_issue.conf b/known_problems/unknown_inadequate_issue.conf
new file mode 100644
index 0000000..17e37ad
--- /dev/null
+++ b/known_problems/unknown_inadequate_issue.conf
@@ -0,0 +1,10 @@
+#
+# detect packages which have the string "Found unknown tags running adequate" in their logs
+#
+PATTERN='(FAIL|WARN): Found unknown tags running adequate'
+WHERE='pass fail bugged affected'
+ISSUE=1
+HEADER='Packages which have logs with the string "Found unknown tags running adequate"'
+HELPTEXT='
+<p>Sometimes new types of problems are detected by <a href="http://packages.debian.org/adequate" target="_blank">adequate</a>, which classifies them using tags. When this happens these new tags need to be made known to piuparts. Please notify <a href="piuparts-devel at lists.alioth.debian.org">piuparts-devel at lists.alioth.debian.org</a>.</p>
+'
diff --git a/piuparts-report.py b/piuparts-report.py
index b397b3f..cea629f 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -376,7 +376,15 @@ linktarget_by_template = [
     ("db_setup_issue.tpl", "but logfile contains failure to setup a database"),
     ("installs_over_symlink_issue.tpl", "but package installs something over existing symlinks"),
     ("broken_symlinks_issue.tpl", "but logfile contains 'broken symlinks'"),
-    ("inadequate_issue.tpl", "but logfile contains inadequate issues"),
+    ("unknown_inadequate_issue.tpl", "but logfile contains unknown inadequate issues"),
+    ("boring_missing_copyright_file_inadequate_issue.tpl", "...and logfile contains tag from adequate 'missing-copyright-file'"),
+    ("boring_obsolete_conffile_file_inadequate_issue.tpl", "...and logfile contains tag from adequate 'obsolete-conffile-file'"),
+    ("boring_broken_symlink_file_inadequate_issue.tpl", "...and logfile contains tag from adequate 'broken-symlink-file'"),
+    ("bin_or_sbin_binary_requires_usr_lib_library_inadequate_issue.tpl", "but adequate tagged it 'bin-or-sbin-binary-requires-usr-lib-library'"),
+    ("library_not_found_inadequate_issue.tpl", "but adequate tagged it 'library-not-found'"),
+    ("py_file_not_bytecompiled_inadequate_issue.tpl", "but adequate tagged it 'py-file-not-bytecompiled'"),
+    ("pyshared_file_not_bytecompiled_inadequate_issue.tpl", "but adequate tagged it 'pyshared-file-not-bytecompiled'"),
+    ("undefined_symbol_inadequate_issue.tpl", "but adequate tagged it 'undefined-symbol'"),
     ("packages_have_been_kept_back_issue.tpl", "but logfile contains 'packages have been kept back'"),
     ("needs_rebuild_issue.tpl", "but logfile recommends to rebuild some packages"),
     ("obsolete_conffiles_issue.tpl", "but logfile reports obsolete conffiles"),
@@ -411,7 +419,7 @@ linktarget_by_template = [
     ("logrotate_error_after_removal_error.tpl", "due to errors from logrotate after removal"),
     ("installs_over_symlink_error.tpl", "...and package installs something over existing symlinks"),
     ("broken_symlinks_error.tpl", "...and logfile also contains 'broken symlinks'"),
-    ("inadequate_error.tpl", "due to logfile containing inadequate errors"),
+    ("inadequate_exit_issue.tpl", "due to adequate exiting inadequately"),
     ("obsolete_conffiles_error.tpl", "...and logfile reports obsolete conffiles"),
     ("missing_md5sums_error.tpl", "...and logfile reports missing md5sums"),
     ("unknown_failures.tpl", "due to unclassified failures"),
diff --git a/piuparts.py b/piuparts.py
index 566a93d..119efae 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1242,18 +1242,47 @@ class Chroot:
                 panic()
 
     def check_adequate(self, packages):
+        """Run adequate and categorize output according to our needs. """
         if packages and settings.adequate and os.path.isfile('/usr/bin/adequate'):
+            adequate_tags = [ 'bin-or-sbin-binary-requires-usr-lib-library',
+                                'library-not-found',
+                                'py-file-not-bytecompiled',
+                                'pyshared-file-not-bytecompiled',
+                                'undefined-symbol' ]
+            boring_tags = [ 'obsolete-conffile',
+                            'missing-copyright-file',
+                            'broken-symlink' ]
+            ignored_tags = [ ]
             (status, output) = run(["adequate", "--root", self.name] + packages, ignore_errors=True)
-            # ignore broken-symlinks - workaround #709372 in adequate
-            output = re.compile('^[^:]+: broken-symlink .*\n', re.MULTILINE).sub('', output)
+            for tag in ignored_tags:
+                # ignore some tags
+                _regex = '^[^:]+: '+tag+' .*\n'
+                output = re.compile(_regex, re.MULTILINE).sub('', output)
             if output:
+                inadequate_results = ''
+                boring_results = ''
+                for tag in adequate_tags:
+                    if ' '+tag+' ' in output:
+                        inadequate_results += ' '+tag+' '
+                for tag in boring_tags:
+                    if ' '+tag+' ' in output:
+                        boring_results += ' '+tag+' '
                 if settings.warn_if_inadequate:
-                    logging.error("WARN: inadequate results from running adequate:\n%s" %
-                          indent_string(output.replace(self.name, "")))
+                    error_code = 'WARN'
                 else:
-                    logging.error("FAIL: inadequate results from running adequate:\n%s" %
-                          indent_string(output.replace(self.name, "")))
-                    panic()
+                    error_code = 'FAIL'
+                logging.error("%s: Inadequate results from running adequate!\n%s" %
+                                (error_code, indent_string(output.replace(self.name, ""))))
+                if inadequate_results:
+                    logging.error("%s: Running adequate resulted in inadequate tags found: %s" % (error_code, inadequate_results))
+                if boring_results:
+                    logging.error("%s: Running adequate resulted in less interesting tags found: %s" % (error_code, boring_results))
+                if not boring_results and not inadequate_results:
+                    logging.error("%s: Found unknown tags running adequate." % error_code)
+                if status != 0:
+                    logging.error("%s: Exit code from adequate was %s!" % (error_code,status))
+                if not settings.warn_if_inadequate:
+                     panic()
 
     def list_paths_with_symlinks(self):
         file_owners = self.get_files_owned_by_packages()

-- 
piuparts git repository



More information about the Piuparts-commits mailing list