[OE-core] [PATCH 2/2] wic/engine.py: Use printf instead of echo

Leonardo Rangel leobsd at gmail.com
Mon Feb 11 23:56:44 UTC 2019


On Mon, Feb 11, 2019 at 12:01 PM William Bourque <wbourque at gmail.com> wrote:

> Some distributions default shell (ex: /bin/dash)
> does not support "-e" argument to echo.
> Hence, using "printf" is safer as it, unlike echo,
> always inteprets \n correctly.
>
>
That seems to be the same change I proposed a couple of days ago

http://lists.openembedded.org/pipermail/openembedded-core/2019-February/278840.html



> Signed-off-by: William Bourque <wbourque at gmail.com>
> ---
>  scripts/lib/wic/engine.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
> index 880e464..189253a 100644
> --- a/scripts/lib/wic/engine.py
> +++ b/scripts/lib/wic/engine.py
> @@ -336,7 +336,7 @@ class Disk:
>      def copy(self, src, pnum, path):
>          """Copy partition image into wic image."""
>          if self.partitions[pnum].fstype.startswith('ext'):
> -            cmd = "echo -e 'cd {}\nwrite {} {}' | {} -w {}".\
> +            cmd = "printf 'cd {}\nwrite {} {}' | {} -w {}".\
>                        format(path, src, os.path.basename(src),
>                               self.debugfs, self._get_part_image(pnum))
>          else: # fat
> --
> 2.7.4
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20190211/81e60c99/attachment.html>


More information about the Openembedded-core mailing list