diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2018-06-28 14:22:12 +0200 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2018-06-28 14:52:28 +0200 |
commit | a9e7ea37fd7a86f6cd687908f8d95747a07c6765 (patch) | |
tree | 3554c8a7c452162925717dd3200265c83c739c69 /scripts | |
parent | 820466ca924b7f633dd44197c1fbc1569261a371 (diff) | |
download | meta-updater-a9e7ea37fd7a86f6cd687908f8d95747a07c6765.tar.gz |
find_dependencies.py: Fix cases with no meaningful dependencies.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/find_dependencies.py | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/scripts/find_dependencies.py b/scripts/find_dependencies.py index 0192912..cffe32b 100755 --- a/scripts/find_dependencies.py +++ b/scripts/find_dependencies.py | |||
@@ -118,7 +118,18 @@ def print_package(manifest_file, data, is_project): | |||
118 | 118 | ||
119 | def find_dependencies(manifest_file, tinfoil, assume_provided, recipe_info, packages, rn, order): | 119 | def find_dependencies(manifest_file, tinfoil, assume_provided, recipe_info, packages, rn, order): |
120 | data = recipe_info[rn] | 120 | data = recipe_info[rn] |
121 | depends = data.depends | 121 | # Filter out packages from the assume_provided list. |
122 | depends = [] | ||
123 | for dep in data.depends: | ||
124 | if dep not in assume_provided: | ||
125 | depends.append(dep) | ||
126 | |||
127 | if PRINT_PROGRESS: | ||
128 | # Print high-order dependencies as a form of logging/progress notifcation. | ||
129 | if order == 2: | ||
130 | print(rn) | ||
131 | if order == 3: | ||
132 | print(' ' + rn) | ||
122 | 133 | ||
123 | # order == 1 is for the initial recipe. We've already printed its | 134 | # order == 1 is for the initial recipe. We've already printed its |
124 | # information, so skip it. | 135 | # information, so skip it. |
@@ -132,25 +143,18 @@ def find_dependencies(manifest_file, tinfoil, assume_provided, recipe_info, pack | |||
132 | else: | 143 | else: |
133 | manifest_file.write('%s dependencies:\n' % spaces) | 144 | manifest_file.write('%s dependencies:\n' % spaces) |
134 | 145 | ||
135 | if PRINT_PROGRESS: | ||
136 | # Print high-order dependencies as a form of logging/progress notifcation. | ||
137 | if order == 2: | ||
138 | print(rn) | ||
139 | if order == 3: | ||
140 | print(' ' + rn) | ||
141 | |||
142 | # First find all dependencies not seen yet to our master list. | 146 | # First find all dependencies not seen yet to our master list. |
143 | for dep in depends: | 147 | for dep in depends: |
144 | if dep not in packages and dep not in assume_provided: | 148 | if dep not in packages: |
145 | packages.append(dep) | 149 | packages.append(dep) |
146 | dep_data = get_recipe_info(tinfoil, dep) | 150 | dep_data = get_recipe_info(tinfoil, dep) |
147 | # Do this once now to reduce the number of bitbake calls. | 151 | # Do this once now to reduce the number of bitbake calls. |
148 | dep_data.depends = dep_data.getVar('DEPENDS').split() | 152 | dep_data.depends = dep_data.getVar('DEPENDS').split() |
149 | recipe_info[dep] = dep_data | 153 | recipe_info[dep] = dep_data |
154 | |||
150 | # Then recursively analyze all of the dependencies for the current recipe. | 155 | # Then recursively analyze all of the dependencies for the current recipe. |
151 | for dep in depends: | 156 | for dep in depends: |
152 | if dep not in assume_provided: | 157 | find_dependencies(manifest_file, tinfoil, assume_provided, recipe_info, packages, dep, order + 1) |
153 | find_dependencies(manifest_file, tinfoil, assume_provided, recipe_info, packages, dep, order + 1) | ||
154 | 158 | ||
155 | if order > 1: | 159 | if order > 1: |
156 | manifest_file.write('%s errors: []\n' % spaces) | 160 | manifest_file.write('%s errors: []\n' % spaces) |
@@ -187,7 +191,10 @@ def main(): | |||
187 | manifest_file.write(' scopes:\n') | 191 | manifest_file.write(' scopes:\n') |
188 | manifest_file.write(' - name: "all"\n') | 192 | manifest_file.write(' - name: "all"\n') |
189 | manifest_file.write(' delivered: true\n') | 193 | manifest_file.write(' delivered: true\n') |
190 | manifest_file.write(' dependencies:\n') | 194 | if not data.depends: |
195 | manifest_file.write(' dependencies: []\n') | ||
196 | else: | ||
197 | manifest_file.write(' dependencies:\n') | ||
191 | 198 | ||
192 | recipe_info = dict([(rn, data)]) | 199 | recipe_info = dict([(rn, data)]) |
193 | packages = [] | 200 | packages = [] |