summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-06-27 10:07:42 +0200
committerPatrick Vacek <patrickvacek@gmail.com>2018-06-27 10:07:42 +0200
commit9107684a89676ca298322e71df25465a831ea7e5 (patch)
treeb0c96915d40a07b118c4a6214726b3d77edbdb99
parent81bdec797138ce2cdcfcea666caa5e64c8e4feb6 (diff)
downloadmeta-updater-9107684a89676ca298322e71df25465a831ea7e5.tar.gz
find_packages.py: input package names to search.
Use find_aktualizr_dependencies.sh to get the previous output for aktualizr-related projects.
-rwxr-xr-xscripts/find_aktualizr_dependencies.sh24
-rwxr-xr-xscripts/find_packages.py34
2 files changed, 38 insertions, 20 deletions
diff --git a/scripts/find_aktualizr_dependencies.sh b/scripts/find_aktualizr_dependencies.sh
new file mode 100755
index 0000000..f011e0a
--- /dev/null
+++ b/scripts/find_aktualizr_dependencies.sh
@@ -0,0 +1,24 @@
1#!/bin/bash
2set -euo pipefail
3
4parentdir="$(dirname "$0")"
5
6# Does NOT include garage-sign, anything used only for testing (i.e. strace and
7# gtest), any of the git submodules, all of which are also only used for
8# testing (tuf-test-vectors, isotp-c, ostreesysroot, and HdrHistogram_c), or
9# any other third party modules included directly into the source tree
10# (jsoncpp, open62541, picojson). Also check libp11, dpkg, and systemd since
11# those are common dependencies not enabled by default.
12${parentdir}/find_packages.py aktualizr \
13 aktualizr-native \
14 aktualizr-auto-prov \
15 aktualizr-implicit-prov \
16 aktualizr-ca-implicit-prov \
17 aktualizr-hsm-prov \
18 aktualizr-disable-send-ip \
19 aktualizr-example-interface \
20 aktualizr-log-debug \
21 libp11 \
22 dpkg \
23 systemd
24
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.