From c427f82bfd704583251bae567097925ddf55f48b Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 18 Jul 2019 17:47:12 +1200 Subject: [PATCH] import_otherdistro: try-specfile: handle files in current dir The try-specfile subcommand is for testing, so it's entirely possible the spec file we are testing with will be in the current directory; os.path.dirname() returns '' in this case, which os.path.relpath() then chokes on. Avoid this in the easiest way possible by just prepending ./ to the path in this case. Signed-off-by: Paul Eggleton --- layerindex/tools/import_otherdistro.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layerindex/tools/import_otherdistro.py b/layerindex/tools/import_otherdistro.py index 7f71ef9..46eeeca 100755 --- a/layerindex/tools/import_otherdistro.py +++ b/layerindex/tools/import_otherdistro.py @@ -603,6 +603,9 @@ def try_specfile(args): return ret specfile = args.specfile + # Hack to handle files in the current directory + if not os.sep in specfile: + specfile = '.' + os.sep + specfile metapath = os.path.dirname(specfile) try: