Skip to content

Conversation

@vmezzela
Copy link
Collaborator

This is an initial reorganization of the code around scan and the way we store the patches in preparation for fixing #153 .

The final fix can be implemented only after #160 is merged since that PR drops the use of quilt to apply the patches, which makes it more easy to selectively apply them.

I took the chance to further refactor scan. What was done before is:

  1. Retrieve the filtered codestreams
  2. First loop on them to retrieve the patched kernels (using get_patched_kernels())
  3. Second loop on the filtered codestreams to check these whose kernel belong to the list of patched_kernels, otherwise add them either to working_cs or unaffected_cs (or skipping due to missing support for arch)

The unnecessary thing was that we were storing the cs.kernel in patched_kernels when filtering with get_patched_kernels(). And then afterward we were checking which codestreams had that kernel with if cs.kernel in patched_kernels. This has been simplified by just filtering the patched codestreams (rather than their kernel). With this, a whole loop has been dropped because unneeded.

Now the process is:

  1. Retrieve the filtered codestreams
  2. Loop over the filtered codestreams and filter it into affected_cs, unaffected_cs, patched_cs (in the same loop)

Avoiding the unneeded patched_kernel.add(cs.kernel) and then cs -> cs.kernel -> if cs.kernel in patched_cs -> patched_cs.append(cs) steps.

Besides that, the most notable part is that now the required patches are stored in the codestream object directly, so that we can just retrieve the patches from there on a per codestream basis rather than on a per product basis, effectively introducing the possibility to perform the patch analysis only on those that are needed. And same goes for the extraction where we will be able to apply only the needed ones.

This is yet to be tested. I am posting this PR in advance to help coordinate the work across different PRs.

required by sys.exit()

Signed-off-by: Vincenzo Mezzela <[email protected]>
Signed-off-by: Vincenzo Mezzela <[email protected]>
Signed-off-by: Vincenzo Mezzela <[email protected]>
Signed-off-by: Vincenzo Mezzela <[email protected]>
Copy link
Collaborator

@fgyanz fgyanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool @vmezzela !! I like the changes, just some minor comments.

In this way, if no patches are supplied, all the codestreams will go in
the unaffected_codestreams list

Signed-off-by: Vincenzo Mezzela <[email protected]>
Signed-off-by: Vincenzo Mezzela <[email protected]>
@vmezzela
Copy link
Collaborator Author

@fgyanz comments addressed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants