mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Update repository_tool.py.
Properly strip (again) the digest prepended to 'digest.filename' files.
The required '+1' appears to have been accidentally deleted in a recent commit:
298f52ddb8 (diff-59d384d80d746c800b16c8387756c0ccL2750)
Thanks to Santiago for locating the bug.
This commit is contained in:
parent
a73dbaa395
commit
6207d62db3
1 changed files with 8 additions and 1 deletions
|
|
@ -2817,7 +2817,10 @@ def _strip_consistent_snapshot_digest(metadata_filename, consistent_snapshot):
|
|||
if consistent_snapshot:
|
||||
dirname, basename = os.path.split(metadata_filename)
|
||||
embeded_digest = basename[:basename.find('.')]
|
||||
basename = basename[basename.find('.'):]
|
||||
|
||||
# Ensure the digest, including the period, is stripped.
|
||||
basename = basename[basename.find('.')+1:]
|
||||
|
||||
metadata_filename = os.path.join(dirname, basename)
|
||||
|
||||
|
||||
|
|
@ -4336,6 +4339,10 @@ def write_metadata_file(metadata, filename, compressions, consistent_snapshot):
|
|||
Specify the algorithms, as a list of strings, used to compress the file;
|
||||
The only currently available compression option is 'gz' (gzip).
|
||||
|
||||
consistent_snapshot:
|
||||
Boolean that determines whether the metadata file's digest should be
|
||||
prepended to the filename.
|
||||
|
||||
<Exceptions>
|
||||
tuf.FormatError, if the arguments are improperly formatted.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue