[elbe-devel] [PATCH 4/4] init: dont tar up the ./initvm in devel mode

Manuel Traut manut at linutronix.de
Wed Nov 7 11:23:48 CET 2018


On Mon, Oct 01, 2018 at 04:37:48PM +0200, Torben Hohn wrote:
> "./elbe initvm create --devel" creates the initvm in ./initvm, and
> tars up the build directory. this produces:
> 
> tar: ./initvm/.elbe-in/elbe-devel.tar.bz2: file changed as we read it
> 
> this is not critical, but should be avoided.
> Check whether the output directory lies in the devel directory, and
> add a proper "--exclude" parameter.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: Manuel Traut <manut at linutronix.de>

and applied to devel/elbe-3.0


> ---
>  elbepack/commands/init.py | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
> index 61a30447..e43307e4 100644
> --- a/elbepack/commands/init.py
> +++ b/elbepack/commands/init.py
> @@ -205,9 +205,14 @@ def run_command(argv):
>              (out_path, opt.cdrom))
>  
>      if opt.devel:
> +        out_real = os.path.realpath(out_path)
> +        ignore = ''
> +        if out_real.startswith(elbe_dir + os.sep):
> +            ignore = '--exclude "%s"' % os.path.relpath(out_path,
> +                                                        start=elbe_dir)
> +
>          os.system(
> -            'tar cfj "%s" -C "%s" .' %
> -            (os.path.join(
> -                out_path,
> -                "elbe-devel.tar.bz2"),
> +            'tar cfj "%s" %s -C "%s" .' % (
> +                os.path.join(out_path, "elbe-devel.tar.bz2"),
> +                ignore,
>                  elbe_dir))
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel



More information about the elbe-devel mailing list