On 29/06/2025 10:29, Filip Kastl wrote: > The last patch of mklog.py put top-level code into function 'main()'. > Because of this, writing to global variable 'root' has to be preceded by > explicitly declaring 'root' as global. Otherwise the write only has a > local effect. > > Without this change, the '-d' cmdline flag would be broken.
Oops. Sorry for the breakage, and thanks for fixing this up (I don't use the -d flag, so hadn't noticed). Alex > > Commited as obvious. > > contrib/ChangeLog: > > * mklog.py: In 'main()', specify variable 'root' as global. > > Signed-off-by: Filip Kastl <fka...@suse.cz> > --- > contrib/mklog.py | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/contrib/mklog.py b/contrib/mklog.py > index 26d4156b034..b841ef0ae97 100755 > --- a/contrib/mklog.py > +++ b/contrib/mklog.py > @@ -389,6 +389,7 @@ def main(): > if args.input == '-': > args.input = None > if args.directory: > + global root > root = args.directory > > data = open(args.input, newline='\n') if args.input else sys.stdin > -- > 2.49.0 >