richard pushed to branch main at The Tor Project / Applications / RBM
Commits: c4c1716d by Nicolas Vigier at 2023-09-06T15:30:45+02:00 Bug 40059: Make it possible to have empty sha256sum value to disable sha256sum check
- - - - -
2 changed files:
- doc/rbm_input_files.asc - lib/RBM.pm
Changes:
===================================== doc/rbm_input_files.asc ===================================== @@ -113,6 +113,7 @@ refresh_input:: sha256sum:: The sha256 checksum of the file. The build will fail with an error if the file does not match the expected sha256 checksum. + If the value is empty, the checksum is not checked.
file_gpg_id:: If this option is set to 1, the file is checked for a gpg
===================================== lib/RBM.pm ===================================== @@ -782,14 +782,17 @@ sub input_file_need_dl { return undef if $action eq 'getfpaths'; if ($fname && ($input_file->{sha256sum} || $input_file->{norec}{sha256sum}) + && $t->('sha256sum') && $t->('sha256sum') ne sha256file($fname)) { sha256file($fname, { remove_cache => 1 }); $fname = undef; } if ($action eq 'input_files_id') { return undef if $input_file->{input_file_id}; - return undef if $input_file->{sha256sum}; - return undef if $input_file->{norec}{sha256sum}; + if ( ($input_file->{sha256sum} || $input_file->{norec}{sha256sum}) + && $t->('sha256sum') ) { + return undef; + } return undef if $input_file->{exec}; return undef if $fname; return 1 if $input_file->{URL}; @@ -814,7 +817,8 @@ sub input_file_id { my ($input_file, $t, $fname, $filename) = @_; return $t->('input_file_id') if $input_file->{input_file_id}; return $input_file->{project} . ':' . $filename if $input_file->{project}; - if ($input_file->{sha256sum} || $input_file->{norec}{sha256sum}) { + if ( ($input_file->{sha256sum} || $input_file->{norec}{sha256sum}) + && $t->('sha256sum') ) { return $filename . ':' . $t->('sha256sum'); } my $opts = { norec => { output_dir => '/out', getting_id => 1, }};
View it on GitLab: https://gitlab.torproject.org/tpo/applications/rbm/-/commit/c4c1716dcbffa58c...