utils/scanpypi: correctly handle license dirs in subdirs for .hash files
PATCH 1/1 utils/scanpypi: correctly handle license dirs in subdirs for .hash files
create_hash_file() used basename(licensefile) when it writes the entry for the license file in the .hash, which is obviously not correct when license file is locate in a sub directory.
Instead copy the logic from __create_mk_license() to strip the directory prefix from the absolute filename instead.
--- utils/scanpypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
utils/scanpypi +1 -1
@@ -554,7 +554,7 @@ class BuildrootPackage(): hash_line = '{method}\t{digest} {filename}\n'.format( method='sha256', digest=sha256.hexdigest(), - filename=os.path.basename(license_file)) + filename=license_file.replace(self.tmp_extract, '')[1:]) lines.append(hash_line) with open(path_to_hash, 'w') as hash_file:
Signature · 1 line
2.11.0
PATCH 1/1 utils/scanpypi: correctly handle license dirs in subdirs for .hash files
Hi Peter,
Quoted 8 lines · Peter Korsgaard
create_hash_file()used basename(licensefile) when it writes the entry for the license file in the .hash, which is obviously not correct when license file is locate in a sub directory.Instead copy the logic from
__create_mk_license()to strip the directory prefix from the absolute filename instead.Signed-off-by Peter Korsgaard <[email protected]>
Good catch.
Quoted 20 lines
--- utils/scanpypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)utils/scanpypi +1
-2@@ -554,7 +554,7 @@ class BuildrootPackage(): hash_line = '{method}\t{digest} {filename}\n'.format( method='sha256', digest=sha256.hexdigest(), - filename=os.path.basename(license_file)) + filename=license_file.replace(self.tmp_extract, '')[1:]) lines.append(hash_line) with open(path_to_hash, 'w') as hash_file: --2.11.0
PATCH 1/1 utils/scanpypi: correctly handle license dirs in subdirs for .hash files
In reply to Peter KorsgaardQuoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
create_hash_file()used basename(licensefile) when it writes the entry for the license file in the .hash, which is obviously not correct when license file is locate in a sub directory.Instead copy the logic from
__create_mk_license()to strip the directory prefix from the absolute filename instead.Signed-off-by Peter Korsgaard <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard