[Buildroot] [PATCH] utils/scanpypi: correctly handle license dirs in subdirs for .hash files
Yegor Yefremov
yegorslists at googlemail.com
Fri Mar 9 14:36:16 UTC 2018
Hi Peter,
On Fri, Mar 9, 2018 at 3:30 PM, Peter Korsgaard <peter at korsgaard.com> wrote:
> 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 at korsgaard.com>
Good catch.
Reviewed-by: Yegor Yefremov <yegorslists at googlemail.com>
> ---
> utils/scanpypi | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/utils/scanpypi b/utils/scanpypi
> index 2b3188dbf6..b9006ee4f7 100755
> --- a/utils/scanpypi
> +++ b/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:
> --
> 2.11.0
>
More information about the buildroot
mailing list