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

bage at linutronix.de bage at linutronix.de
Sat Jan 25 15:58:21 CET 2020


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 | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index bc32c25d0..f7be956ae 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -418,8 +418,18 @@ 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)
+
+            apt_args = '--yes -q --download-only'
+            if self.xml.prj.has('noauth'):
+                apt_args += ' --allow-unauthenticated'
+            do('cd "%s";apt-get source %s "%s"' % (pdb_path, apt_args, src_uri))
+
+            do('dpkg-source -x %s/*.dsc "%s"' % (pdb_path, src_path))
         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




More information about the elbe-devel mailing list