[elbe-devel] [PATCH] LOCALMACHINE support for pbuilder tag

Kurt Kanzenbach kurt at linutronix.de
Wed Jun 27 13:11:25 CEST 2018


Hi,

On Wed, Jun 27, 2018 at 01:04:25PM +0200, Volker Haspel wrote:
> There are people using local git or svn server on their build system.
> They should be able to specify 'LOCALMACHINE' in their XML files.
> 
> The patch replaces the string 'LOCALMACHINE' with 10.0.2.2 in the source
> URI of the repository.
> 
> Signed-off-by: Volker Haspel <volker.haspel at linutronix.de>
> ---
>  elbepack/elbeproject.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
> index d3396b90..846d8699 100644
> --- a/elbepack/elbeproject.py
> +++ b/elbepack/elbeproject.py
> @@ -185,15 +185,16 @@ class ElbeProject (object):
>          self.pdebuild_init ()
>          src_path = os.path.join (self.builddir, "pdebuilder", "current")
>  
> -        self.log.printo ("retrieve pbuild sources: %s" % p.text('.').strip())
> +        src_uri = p.text('.').replace("LOCALMACHINE", "10.0.2.2")

Why not using something like this:

 src_uri = p.text('.').replace("LOCALMACHINE", "10.0.2.2").strip()

This way, you can get rid of all the .strip() calls below.

Otherwise, looks good to me.

Thanks,
Kurt

> +        self.log.printo ("retrieve pbuild sources: %s" % src_uri.strip())
>          if p.tag == 'git':
> -            self.log.do ("git clone %s %s" % (p.text('.').strip(), src_path))
> +            self.log.do ("git clone %s %s" % (src_uri.strip(), src_path))
>              try:
>                  self.log.do ("cd %s; git reset --hard %s" % (src_path, p.et.attrib['revision']))
>              except IndexError:
>                  pass
>          elif p.tag == 'svn':
> -            self.log.do ("svn co --non-interactive %s %s" % (p.text('.').strip(), src_path))
> +            self.log.do ("svn co --non-interactive %s %s" % (src_uri.strip(), src_path))
>          else:
>              self.log.printo ("unknown pbuild source vcs: %s" % p.tag)
>  
> -- 
> 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