summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/find_packages.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/find_packages.py b/scripts/find_packages.py
index 50453c1..970a25a 100755
--- a/scripts/find_packages.py
+++ b/scripts/find_packages.py
@@ -14,7 +14,7 @@ import bb.tinfoil
14def print_deps(tinfoil, abcd_file, rn): 14def print_deps(tinfoil, abcd_file, rn):
15 try: 15 try:
16 info = tinfoil.get_recipe_info(rn) 16 info = tinfoil.get_recipe_info(rn)
17 except: 17 except Exception:
18 # fails on hostperl-runtime-native, virtual/libintl-native, grep-native, virtual/libiconv-native 18 # fails on hostperl-runtime-native, virtual/libintl-native, grep-native, virtual/libiconv-native
19 print('Failed to get recipe info for: %s' % rn) 19 print('Failed to get recipe info for: %s' % rn)
20 return [] 20 return []
@@ -50,10 +50,9 @@ def print_deps(tinfoil, abcd_file, rn):
50 for src in src_uri: 50 for src in src_uri:
51 # Strip options. 51 # Strip options.
52 # TODO: ignore files with apply=false? 52 # TODO: ignore files with apply=false?
53 semi_pos = src.find(';') 53 src = src.split(';', maxsplit=1)[0]
54 if semi_pos > 0: 54 src_type = src.split('://', maxsplit=1)[0]
55 src = src[:semi_pos] 55 if src_type == 'file':
56 if src[0:7] == 'file://':
57 # TODO: Get full path of patches and other files within the source 56 # TODO: Get full path of patches and other files within the source
58 # repo, not just the filesystem? 57 # repo, not just the filesystem?
59 fetch = bb.fetch2.Fetch([], data) 58 fetch = bb.fetch2.Fetch([], data)
@@ -61,18 +60,17 @@ def print_deps(tinfoil, abcd_file, rn):
61 abcd_file.write(' - "%s"\n' % local) 60 abcd_file.write(' - "%s"\n' % local)
62 else: 61 else:
63 abcd_file.write(' - "%s"\n' % src) 62 abcd_file.write(' - "%s"\n' % src)
64 if src[0:7] != 'http://' and src[0:8] != 'https://' and src[0:6] != 'ftp://' and src[0:6] != 'ssh://': 63 if src_type != 'http' and src_type != 'https' and src_type != 'ftp' and src_type != 'ssh':
65 repos.append(src) 64 repos.append(src)
66 if len(repos) > 1: 65 if len(repos) > 1:
67 print('Multiple repos not fully supported yet. Pacakge: %s' % info.pn) 66 print('Multiple repos not fully supported yet. Pacakge: %s' % info.pn)
68 for repo in repos: 67 for repo in repos:
69 colon_pos = repo.find(':') 68 vcs_type, url = repo.split('://', maxsplit=1)
70 abcd_file.write(' vcs:\n') 69 abcd_file.write(' vcs:\n')
71 vcs_type = repo[:colon_pos]
72 if vcs_type == 'gitsm': 70 if vcs_type == 'gitsm':
73 vcs_type = 'git' 71 vcs_type = 'git'
74 abcd_file.write(' type: "%s"\n' % vcs_type) 72 abcd_file.write(' type: "%s"\n' % vcs_type)
75 abcd_file.write(' url: "%s"\n' % repo[colon_pos + 3:]) 73 abcd_file.write(' url: "%s"\n' % url)
76 # TODO: Actually support multiple repos here: 74 # TODO: Actually support multiple repos here:
77 abcd_file.write(' revision: "%s"\n' % srcrev) 75 abcd_file.write(' revision: "%s"\n' % srcrev)
78 abcd_file.write(' branch: "%s"\n' % branch) 76 abcd_file.write(' branch: "%s"\n' % branch)