summaryrefslogtreecommitdiffstats
path: root/scripts/find_packages.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/find_packages.py')
-rwxr-xr-xscripts/find_packages.py34
1 files changed, 14 insertions, 20 deletions
diff --git a/scripts/find_packages.py b/scripts/find_packages.py
index 7a60a17..ad74be5 100755
--- a/scripts/find_packages.py
+++ b/scripts/find_packages.py
@@ -1,5 +1,6 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2 2
3from argparse import ArgumentParser
3import os.path 4import os.path
4import sys 5import sys
5 6
@@ -34,6 +35,7 @@ def print_deps(tinfoil, abcd_file, rn):
34 35
35 abcd_file.write('- id:\n') 36 abcd_file.write('- id:\n')
36 abcd_file.write(' package_manager: "Yocto"\n') 37 abcd_file.write(' package_manager: "Yocto"\n')
38 abcd_file.write(' namespace: ""\n')
37 abcd_file.write(' name: "%s"\n' % info.pn) 39 abcd_file.write(' name: "%s"\n' % info.pn)
38 abcd_file.write(' version: "%s"\n' % info.pv) 40 abcd_file.write(' version: "%s"\n' % info.pv)
39 abcd_file.write(' declared_lics:\n') 41 abcd_file.write(' declared_lics:\n')
@@ -43,6 +45,11 @@ def print_deps(tinfoil, abcd_file, rn):
43 else: 45 else:
44 abcd_file.write(' description: "%s"\n' % description) 46 abcd_file.write(' description: "%s"\n' % description)
45 abcd_file.write(' homepage_url: "%s"\n' % homepage) 47 abcd_file.write(' homepage_url: "%s"\n' % homepage)
48 # Binary artifacts almost never exist in Yocto.
49 abcd_file.write(' binary_artifact:\n')
50 abcd_file.write(' url: ""\n')
51 abcd_file.write(' hash: ""\n')
52 abcd_file.write(' hash_algorithm: ""\n')
46 abcd_file.write(' source_artifact:\n') 53 abcd_file.write(' source_artifact:\n')
47 repos = [] 54 repos = []
48 for src in src_uri: 55 for src in src_uri:
@@ -61,7 +68,7 @@ def print_deps(tinfoil, abcd_file, rn):
61 if src_type != 'http' and src_type != 'https' and src_type != 'ftp' and src_type != 'ssh': 68 if src_type != 'http' and src_type != 'https' and src_type != 'ftp' and src_type != 'ssh':
62 repos.append(src) 69 repos.append(src)
63 if len(repos) > 1: 70 if len(repos) > 1:
64 print('Multiple repos not fully supported yet. Pacakge: %s' % info.pn) 71 print('Multiple repos for one package are not supported. Package: %s' % info.pn)
65 for repo in repos: 72 for repo in repos:
66 vcs_type, url = repo.split('://', maxsplit=1) 73 vcs_type, url = repo.split('://', maxsplit=1)
67 abcd_file.write(' vcs:\n') 74 abcd_file.write(' vcs:\n')
@@ -83,7 +90,12 @@ def print_deps(tinfoil, abcd_file, rn):
83 90
84 91
85def main(): 92def main():
86 abcd_manifest = 'manifest.abcd' 93 parser = ArgumentParser(description='Find all dependencies of one or more packages.')
94 parser.add_argument('packages', metavar='package', nargs='+',
95 help='a package to investigate')
96 args = parser.parse_args()
97 recipes_to_check = args.packages
98 abcd_manifest = 'manifest.yml'
87 with open(abcd_manifest, "w") as abcd_file, bb.tinfoil.Tinfoil() as tinfoil: 99 with open(abcd_manifest, "w") as abcd_file, bb.tinfoil.Tinfoil() as tinfoil:
88 tinfoil.prepare() 100 tinfoil.prepare()
89 # These are the packages that bitbake assumes are provided by the host 101 # These are the packages that bitbake assumes are provided by the host
@@ -93,24 +105,6 @@ def main():
93 assume_provided = tinfoil.config_data.getVar('ASSUME_PROVIDED').split() 105 assume_provided = tinfoil.config_data.getVar('ASSUME_PROVIDED').split()
94 abcd_file.write('packages:\n') 106 abcd_file.write('packages:\n')
95 107
96 # Does NOT include garage-sign, anything used only for testing (i.e.
97 # strace and gtest), any of the git submodules, all of which are also
98 # only used for testing (tuf-test-vectors, isotp-c, ostreesysroot,
99 # and HdrHistogram_c), or any other third party modules included
100 # directly into the source tree (jsoncpp, open62541, picojson)
101 recipes_to_check = ['aktualizr',
102 'aktualizr-native',
103 'aktualizr-auto-prov',
104 'aktualizr-implicit-prov',
105 'aktualizr-ca-implicit-prov',
106 'aktualizr-hsm-prov',
107 'aktualizr-disable-send-ip',
108 'aktualizr-example-interface',
109 'aktualizr-log-debug',
110 'libp11', # BUILD_P11 (HSM) only
111 'dpkg', # BUILD_DEB only
112 'systemd'] # BUILD_SYSTEMD only
113
114 # Iterate through the list of recipes to check. Append any dependencies 108 # Iterate through the list of recipes to check. Append any dependencies
115 # found that aren't already in the list. As long as we only add to the 109 # found that aren't already in the list. As long as we only add to the
116 # list, it should be safe. 110 # list, it should be safe.