From 39665ee8c87853f93d56c56754470261a0d19d1d Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 25 May 2018 12:16:46 +0200 Subject: find_packages.py: Get full path for patches and other local files. It might be even better to get the path relative to the root of the repo the files live in, but this is at least a step in the right direction. --- scripts/find_packages.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/find_packages.py b/scripts/find_packages.py index f3b3a85..ddd9034 100755 --- a/scripts/find_packages.py +++ b/scripts/find_packages.py @@ -4,9 +4,10 @@ import os.path import sys scripts_path = os.path.dirname(os.path.realpath(__file__)) -lib_path = os.path.abspath(scripts_path + '/../../poky/bitbake/lib') -sys.path = sys.path + [lib_path] +bb_lib_path = os.path.abspath(scripts_path + '/../../poky/bitbake/lib') +sys.path = sys.path + [bb_lib_path] +import bb.fetch2 import bb.tinfoil @@ -46,8 +47,14 @@ def print_deps(tinfoil, abcd_file, rn): abcd_file.write(' homepage_url: "%s"\n' % homepage) abcd_file.write(' source_artifact:\n') for src in src_uri: - # TODO: Get full path of patches? - abcd_file.write(' - "%s"\n' % src) + if src[0:7] == 'file://': + # TODO: Get full path of patches and other files within the source + # repo, not just the filesystem? + fetch = bb.fetch2.Fetch([], data) + local = fetch.localpath(src) + abcd_file.write(' - "%s"\n' % local) + else: + abcd_file.write(' - "%s"\n' % src) # TODO: Check more than the first and not just git if src_uri and 'git' in src_uri[0]: abcd_file.write(' vcs:\n') -- cgit v1.2.3-54-g00ecf