浏览代码

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.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Peter Korsgaard 7 年之前
父节点
当前提交
7cfceeb91e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      utils/scanpypi

+ 1 - 1
utils/scanpypi

@@ -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: