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 <[email protected]> --- scripts/oe-depends-dot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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: -- 2.55.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#245066): https://lists.openembedded.org/g/openembedded-core/message/245066 Mute This Topic: https://lists.openembedded.org/mt/121082980/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
