[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/6] xen/x86: Use SPDX (take 1)


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Feb 2023 10:27:45 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fsBy0nU/hesAsokGG8TGpHf+mFJHlegQmMs09BzikFA=; b=FfG0byRVYX0jN2zc9PtpqbVeQR9QnuN/p3czWQNrHCT3sjZGkq1SMiszEMJ8gNIiLM5ydj4pVUJ14b5d8PdjWxbqnPGKt73yM5Q7Q8ic0b2ZgxDi0PKIZW+z3Gqh2w0q/w2zmtdZ/mR+QXKxaqkZbnYpOm+WRa6zWCg8CcIyM+1qjlp4tMkw7PfFEcQ9i0Qg99ZILGUbfKxZjjgGcg6kU+v7yMzI4tseuLEL0Ok4NKRfD3rfaXj9RuM/DXoPhQtJhS1WjNlu/c/UvTWM8jxY8QXlpE8wBJ6Nj3YMcLmWXbvzNLSNOZPe/o1XhkVitn6h0z7yVMu4yKXo+fFIFN9KYw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IcsgTjeLb/LyqOHXZzFhp6r3UNL1eDzrkHqb9ZoqGEg/45jpS8WJ34qaNkRVNW0XzhJ6+JQxZfWrwSEZUQmjFNeVyD6uHG6RZAu1W2zE/CkPDO7r/EwLD/4xYR/DToaqAM5i4ApIsWQ+PDCrlb63yMn30XhuvQjYfSPvO15zMDtBUxGD44eT6z+0T3lE8QIFUPuNDy93dsIfxlRCZoKEbbUZkdt4CmggTqL6zpo9S6Lvn6CFryS8XfCjhFZ5+Oghw9l9TlmOFdE/OnUl5f+CXLTsvk3ubD9FWqwEIb5E9tjIaGI4zbw+ePNU7GeI/iQ9aYeP4Qcjqt6nHkrRoIbS3w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: demi@xxxxxxxxxxxxxxxxxxxxxx, Julien Grall <jgrall@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 13 Feb 2023 09:27:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.02.2023 00:00, Julien Grall wrote:
> This is a first attempt to replace all the full license text with
> SPX tag in xen/arch/x86/. For now, this is only covering files with GPL 2.0
> and 3 different patterns.

For clarification - the three patterns mentioned here are the three slightly
differently formatted/spelled versions of effectively the same text, not ...

> I have used the script below to remove the full license and add
> an SPDX tag. The script is based on the work from Anthony [1]
> 
> 42sh> cat replace_license.py
> #! /usr/bin/python3
> ## We are opening/writing to files using the binary mode to avoid
> ## python interpreting the content (reading ./drivers/video/font_8x14.c
> ## will throw some encoding error otherwise).
> 
> import sys
> 
> if len(sys.argv) < 4:
>     print("./replace_license <licence-file> <spdx> <file> [debug]")
>     exit(1)
> 
> licence_file = sys.argv[1]
> spdx = str.encode(sys.argv[2])
> file = sys.argv[3]
> # HACK: enable debug if there is a 4th argument
> debug = len(sys.argv) == 5
> 
> with open(licence_file, 'rb') as f:
>     licence = f.read()
> 
> licence_spdx = b"/* SPDX-License-Identifier: " + spdx + b" */\n"
> 
> print(f"reading {file}")
> with open(file, 'rb') as f:
>     whole_file = f.read()
> 
> try:
>     licence_loc = whole_file.index(licence)
> except ValueError:
>     print("licence not found. Ignoring")
>     exit(0)
> 
> # Replace one the below pattern with nothing
> ## Pattern 1
> # * <license>
> # *
> whole_file = whole_file.replace(licence + b' *\n', b'')
> 
> ## Pattern 2
> # *
> # * <license>
> whole_file = whole_file.replace(b' *\n' + licence, b'')
> 
> ## Pattern 3
> # /*
> #  * <license>
> #  */
> whole_file = whole_file.replace(b'/*\n' + licence + b' */\n', b'')
> 
> ## Pattern 4
> # *
> # * <license>
> whole_file = whole_file.replace(b' * \n' + licence, b'')

... referring to the (really four) patterns here?

> Julien Grall (6):
>   xen/x86: Replace GPL v2.0 copyright with an SPDX tag in *.c
>   xen/x86: Replace GPL v2.0 copyright with an SPDX tag in *.c (part 2)
>   xen/x86: Replace GPL v2.0 copyright with an SPDX tag in *.h
>   xen/x86: Replace GPL v2.0 copyright with an SPDX tag in *.h (part 2)
>   xen/x86: Replace GPL v2.0 copyright with an SPDX tag in *.c (part 3)
>   xen/x86: Replace GPL v2.0 copyright with an SPDX tag in *.h (part 3)

With the one further adjustment you did spot yourself:
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.