summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/find_packages.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/scripts/find_packages.py b/scripts/find_packages.py
index ddd9034..6bad742 100755
--- a/scripts/find_packages.py
+++ b/scripts/find_packages.py
@@ -46,7 +46,13 @@ def print_deps(tinfoil, abcd_file, rn):
46 abcd_file.write(' description: "%s"\n' % description) 46 abcd_file.write(' description: "%s"\n' % description)
47 abcd_file.write(' homepage_url: "%s"\n' % homepage) 47 abcd_file.write(' homepage_url: "%s"\n' % homepage)
48 abcd_file.write(' source_artifact:\n') 48 abcd_file.write(' source_artifact:\n')
49 repos = []
49 for src in src_uri: 50 for src in src_uri:
51 # Strip options.
52 # TODO: ignore files with apply=false?
53 semi_pos = src.find(';')
54 if semi_pos > 0:
55 src = src[:semi_pos]
50 if src[0:7] == 'file://': 56 if src[0:7] == 'file://':
51 # TODO: Get full path of patches and other files within the source 57 # TODO: Get full path of patches and other files within the source
52 # repo, not just the filesystem? 58 # repo, not just the filesystem?
@@ -55,18 +61,27 @@ def print_deps(tinfoil, abcd_file, rn):
55 abcd_file.write(' - "%s"\n' % local) 61 abcd_file.write(' - "%s"\n' % local)
56 else: 62 else:
57 abcd_file.write(' - "%s"\n' % src) 63 abcd_file.write(' - "%s"\n' % src)
58 # TODO: Check more than the first and not just git 64 if src[0:7] != 'http://' and src[0:8] != 'https://' and src[0:6] != 'ftp://' and src[0:6] != 'ssh://':
59 if src_uri and 'git' in src_uri[0]: 65 repos.append(src)
66 if len(repos) > 1:
67 print('Multiple repos not fully supported yet. Pacakge: %s' % info.pn)
68 for repo in repos:
69 colon_pos = repo.find(':')
60 abcd_file.write(' vcs:\n') 70 abcd_file.write(' vcs:\n')
61 abcd_file.write(' type: "git"\n') 71 vcs_type = repo[:colon_pos]
62 abcd_file.write(' url: "%s"\n' % src_uri[0]) 72 if vcs_type == 'gitsm':
73 vcs_type = 'git'
74 abcd_file.write(' type: "%s"\n' % vcs_type)
75 abcd_file.write(' url: "%s"\n' % repo[colon_pos + 3:])
76 # TODO: Actually support multiple repos here:
63 abcd_file.write(' revision: "%s"\n' % srcrev) 77 abcd_file.write(' revision: "%s"\n' % srcrev)
64 abcd_file.write(' branch: "%s"\n' % branch) 78 abcd_file.write(' branch: "%s"\n' % branch)
65 79
66 abcd_file.write(' dependencies:\n') 80 abcd_file.write(' dependencies:\n')
67 for dep in depends: 81 for dep in depends:
68 abcd_file.write(' - "%s"\n' % dep) 82 abcd_file.write(' - "%s"\n' % dep)
69 # TODO: continue nesting here? 83 # TODO: search for transitive dependencies here? Each dependency will
84 # get checked for its own dependencies sooner or later.
70 85
71 return depends 86 return depends
72 87