Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call plugin digest registered hook in extract #405

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kiwiroy
Copy link
Contributor

@kiwiroy kiwiroy commented Jul 13, 2023

When implementing a dynamic check_digest around hook it is called up to 3 times, depending on the value of Digest attributes check_fetch and check_download. I've seen that $build->extract does most of the rule enforcement of download_rule and thought this could benefit from a change against some low effort subversion such as the around_hook below. By the build stage there shouldn't be any opportunity to update the meta_prop->{digest}

use alienfile;
share {
  plugin Digest => {'*' => [SHA256 => 'x' x 64]};
  meta->around_hook(check_digest => sub { return 1; });
};

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

Successfully merging this pull request may close these issues.

1 participant