Pārlūkot izejas kodu

size-stats: fix bug when parsing file names with comma

The size-stats script fails when the usb_modeswitch_data is enabled,
because this package installs files that contain commas in their
name. However, the size-stats script also uses comma as a separator for
its CSV files, causing a "ValueError: too many values to unpack" in:

  pkg, fpath = l.split(",")

Fix this by splitting only the two fields that need to be split.

The bug was reported by Matthias <porto.rio@gmx.net>, who also suggested
a fix.

Fixes bug #9136.

Reported-by: Matthias <porto.rio@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thomas Petazzoni 9 gadi atpakaļ
vecāks
revīzija
34b1bdeba4
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      support/scripts/size-stats

+ 1 - 1
support/scripts/size-stats

@@ -66,7 +66,7 @@ def build_package_dict(builddir):
     filesdict = {}
     filesdict = {}
     with open(os.path.join(builddir, "build", "packages-file-list.txt")) as filelistf:
     with open(os.path.join(builddir, "build", "packages-file-list.txt")) as filelistf:
         for l in filelistf.readlines():
         for l in filelistf.readlines():
-            pkg, fpath = l.split(",")
+            pkg, fpath = l.split(",", 1)
             # remove the initial './' in each file path
             # remove the initial './' in each file path
             fpath = fpath.strip()[2:]
             fpath = fpath.strip()[2:]
             fullpath = os.path.join(builddir, "target", fpath)
             fullpath = os.path.join(builddir, "target", fpath)