diff mbox series

[1/4] scripts/oe-depends-dot: fix dotfile argument type

Message ID 20260904-oe-depends-dot-cleanups-v1-1-b56bf05fc5fd@bootlin.com
State Under Review
Headers show
Series Minor cleanups and improvements for script/oe-depends-dot | expand

Commit Message

Antonin Godard Sept. 4, 2026, 8:22 a.m. UTC
We can only pass one dotfile to this script, so storing this argument as
a list does not make sense as we only ever use its first and only item.
Store the argument as a string instead.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 scripts/oe-depends-dot | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/scripts/oe-depends-dot b/scripts/oe-depends-dot
index 10e8b1d387..7b16b911bd 100755
--- a/scripts/oe-depends-dot
+++ b/scripts/oe-depends-dot
@@ -17,7 +17,7 @@  class Dot(object):
             description="Analyse task-depends.dot generated by bitbake -g",
             formatter_class=argparse.RawDescriptionHelpFormatter)
         parser.add_argument("dotfile",
-            help = "Specify the dotfile", nargs = 1, action='store', default='')
+            help = "Specify the dotfile", action='store', default='')
         parser.add_argument("-k", "--key",
             help = "Specify the key, e.g., recipe name",
             action="store", default='')
@@ -101,7 +101,7 @@  Reduce the .dot file packages only, no tasks:
         #print(self.args.dotfile[0])
         # The format is {key: depends}
         depends = {}
-        with open(self.args.dotfile[0], 'r') as f:
+        with open(self.args.dotfile, 'r') as f:
             for line in f.readlines():
                 if ' -> ' not in line:
                     continue
@@ -139,7 +139,7 @@  Reduce the .dot file packages only, no tasks:
                         child_deps |= depends[dep]
 
                 reduced_depends[k] = deps - child_deps
-                outfile= '%s-reduced%s' % (self.args.dotfile[0][:-4], self.args.dotfile[0][-4:])
+                outfile= '%s-reduced%s' % (self.args.dotfile[:-4], self.args.dotfile[-4:])
             with open(outfile, 'w') as f:
                 print('Saving reduced dot file to %s' % outfile)
                 f.write('digraph depends {\n')
@@ -150,7 +150,7 @@  Reduce the .dot file packages only, no tasks:
             sys.exit(0)
 
         if self.args.key not in depends:
-            print("ERROR: Can't find key %s in %s" % (self.args.key, self.args.dotfile[0]))
+            print("ERROR: Can't find key %s in %s" % (self.args.key, self.args.dotfile))
             sys.exit(1)
 
         if self.args.depends: