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 <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2019-07-18 17:47:12 +12:00
parent 4902baa1d7
commit c427f82bfd

View File

@ -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: