[elbe-devel] [PATCH 3/4] Implement downloading pbuilder src-pkg

torben.hohn at linutronix.de torben.hohn at linutronix.de
Fri Jan 24 19:35:19 CET 2020


On Wed, Jan 15, 2020 at 10:14:03PM +0100, bage at linutronix.de wrote:
> From: Bastian Germann <bage at linutronix.de>
> 
> `apt-get source` downloads the package and `dpkg-source` extracts it.
> 
> Signed-off-by: Bastian Germann <bage at linutronix.de>
> ---
>  elbepack/elbeproject.py | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
> index bc32c25d0..1525aa0d0 100644
> --- a/elbepack/elbeproject.py
> +++ b/elbepack/elbeproject.py
> @@ -418,8 +418,17 @@ class ElbeProject (object):
>                  pass
>          elif p.tag == 'svn':
>              do("svn co --non-interactive %s %s" % (src_uri, src_path))
> +        elif p.tag == 'src-pkg':
> +            pdb_path = os.path.join(self.builddir, "pdebuilder")
> +            os.mkdir(pdb_path)
> +
> +            oldcwd = os.getcwd()
> +            os.chdir(pdb_path)

please dont use os.chdir()
this is a process wide attribute, and would break other jobs running in
the same elbe daemon.

Please try to provide the destination path on the commandline,
if that does not work, do something like:

do("cd /bla; apt-get source") this will make the shell chdir, and that
is a child process..

> +            do("apt-get source --download-only %s" % src_uri)

please quote %s
        do('apt-get source --download-only "%s"' % src_uri)

> +            do("dpkg-source -x *.dsc current")
> +            os.chdir(oldcwd)

>          else:
> -            logging.info("Unknown pbuild source vcs: %s", p.tag)
> +            logging.info("Unknown pbuild source: %s", p.tag)
>  
>          # pdebuild_build(-1) means use all cpus
>          self.pdebuild_build(cpuset=-1, profile="")
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> 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