This submodule is used to generate MD5 checksums for data and metadata files in SIP package.
It also used to create hash file, which holds all checksums with paths to the files from root of the package. For example path /home/xex/packageroot/somedir/somefile.txt will be stored as /packageroot/somedir/somefile.txt.
Checksum generator in format specified in LTP specification.
Definition of the MD5 file requires, that all paths will be absolute for the package directory, not for the filesystem.
This function converts filesystem-absolute paths to package-absolute paths.
Parameters: |
|
---|---|
Returns: | str – Package-absolute path to the file. |
Raises: | ValueError – When fn is absolute and root_path relative or conversely. |
Compute checksum for each file in directory, with exception of files specified in blacklist.
Parameters: |
|
---|---|
Returns: | dict – Dict in format {fn: md5_hash}. |
Note
File paths are returned as absolute paths from package root.
Raises: | UserWarning – When directory doesn’t exists. |
---|
Compute checksum for each file in directory, with exception of files specified in blacklist.
Parameters: |
|
---|---|
Returns: | str – Content of hashfile as it is specified in ABNF specification for project. |