Patchwork [2/4] buildhistory_analysis: correctly handle whitespace when splitting lists

login
register
mail settings
Submitter Paul Eggleton
Date Jan. 19, 2012, 10:32 a.m.
Message ID <e31a6d93bb9267c84675373830678b28cb2781d4.1326968802.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/19759/
State Accepted
Commit 15ad5d2c0e92fefdbb7c0cf064134b1cabfd84ac
Headers show

Comments

Paul Eggleton - Jan. 19, 2012, 10:32 a.m.
Don't specify any argument to the split() function when handling changes
to list type variables (e.g. PACKAGES) so that the values are split by
any whitespace and only split once for a block of multiple whitespace
characters.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/buildhistory_analysis.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
index d3c0448..a2fa643 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -34,8 +34,8 @@  class ChangeRecord:
 
     def __str__(self):
         if self.fieldname in list_fields:
-            aitems = self.oldvalue.split(' ')
-            bitems = self.newvalue.split(' ')
+            aitems = self.oldvalue.split()
+            bitems = self.newvalue.split()
             removed = list(set(aitems) - set(bitems))
             added = list(set(bitems) - set(aitems))
             return '%s: %s:%s%s' % (self.path, self.fieldname, ' removed "%s"' % ' '.join(removed) if removed else '', ' added "%s"' % ' '.join(added) if added else '')