[elbe-devel] [PATCH 6/7] Add 'plain' encoding for finetuning 'add <file>'

Torben Hohn torben.hohn at linutronix.de
Fri May 17 14:58:07 CEST 2019


On Fri, May 17, 2019 at 11:17:00AM +0200, dion at linutronix.de wrote:
> From: Olivier Dion <dion at linutronix.de>
> 
> Even though the default encoding is plain text, we should put the
> option 'encoding="plain"' if the user wants to be more explicit.
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/finetuning.py | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
> index 7f6c4a6b..4a92c024 100644
> --- a/elbepack/finetuning.py
> +++ b/elbepack/finetuning.py
> @@ -355,10 +355,13 @@ class AddFileAction(FinetuningAction):
>  
>      @staticmethod
>      def decode(text, encoding):
> -        if encoding == "base64":
> -            return base64.standard_b64decode(text)
> +        if encoding == "plain":
> +            msg = text
> +        elif encoding == "base64":
> +            msg = base64.standard_b64decode(text)
>          else:
>              raise FinetuningException("Invalid encoding %s" % encoding)
> +        return msg
>  
>      def execute(self, log, _buildenv, target):
>  
> -- 
> 2.21.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20190517/27a52a24/attachment-0001.sig>


More information about the elbe-devel mailing list