Source: undertaker
Version: 1.6
Severity: important
Tags: patch

Dear Maintainer,

in the latest version 1.6 of the undertaker, the included tool undertaker-
checkpatch generates various false positives for Kconfig patches. These false
positives entail a considerable negative influence on the user experience, and
make the tool unsuitable for automated testing systems; the actual purpose of
the tool.

The tool mistakenly assumes that removed statements in Kconfig (e.g., "
depends on ARM") are added to the Kconfig file. This bug causes a lot of noise
for many (recent) patches of the Linux kernel, for instance, when a Kconfig
option and all its occurrences are removed from Kconfig. To fix this bugs, only
one line needs to be changed in the python script python/undertaker-checkpatch.

The bug has been fixed in the project's repository, but is present in the
Debian package for Jessie (and later). Other tools in the undertaker package
are not affected by this bug. However, without patching this bug, I recommend
not to use the shipped version in Debian 8.

The patch is attached to this bug report.

Regards,
 Valentin



-- System Information:
Debian Release: jessie/sid
  APT prefers utopic-updates
  APT policy: (500, 'utopic-updates'), (500, 'utopic-security'), (500,
'utopic'), (100, 'utopic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-24-generic (SMP w/4 CPU cores)
>From 69c153a00c3f4dc496ac55f3b44446b4217c9d9e Mon Sep 17 00:00:00 2001
From: Valentin Rothberg <[email protected]>
Date: Thu, 6 Nov 2014 18:37:00 +0100
Subject: [PATCH] undertaker-checkpatch: fix Kconfig parsing

This patch fixes the parsing of changes to Kconfig files. There is
an internal dictionary which is meant to contain all added
identifiers to Kconfig statements, such as 'if'/'depends on'/'select'.
Accidentally, only removed statements have been checked which caused
some false positives.

Change-Id: I1cb950d5079a04e9a9bebf6b6c301c1c8d1be0bd
---
 python/undertaker-checkpatch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/undertaker-checkpatch b/python/undertaker-checkpatch
index b8e73dc..8cbb7b3 100755
--- a/python/undertaker-checkpatch
+++ b/python/undertaker-checkpatch
@@ -295,7 +295,7 @@ def parse_patch(patchfile):
                     removals[path] = removed
 
             # added statements (if, select, depends on)
-            elif change[0] and not change[1] and \
+            elif not change[0] and change[1] and \
                     REGEX_KCONFIG_STMT.match(change[2]):
                 stmts = statements.get(path, set())
                 for feature in REGEX_FEATURE.findall(change[2]):
-- 
2.1.0

Reply via email to