mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
patman: locate README.rst via importlib
Rationale: this is more robust than assumptions about the file hierarchy layout of the installation of patman, for example on non file-hierarchy standard (FHS) systems such as Guix System or Nix OS. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
425bbed247
commit
a5197fc9c3
1 changed files with 3 additions and 5 deletions
|
@ -7,6 +7,7 @@
|
||||||
"""See README for more information"""
|
"""See README for more information"""
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
import importlib.resources
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
@ -160,11 +161,8 @@ elif args.cmd == 'send':
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
elif args.full_help:
|
elif args.full_help:
|
||||||
tools.print_full_help(
|
with importlib.resources.path('patman', 'README.rst') as readme:
|
||||||
os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
|
tools.print_full_help(str(readme))
|
||||||
'README.rst')
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# If we are not processing tags, no need to warning about bad ones
|
# If we are not processing tags, no need to warning about bad ones
|
||||||
if not args.process_tags:
|
if not args.process_tags:
|
||||||
|
|
Loading…
Reference in a new issue