[elbe-devel] [PATCH 3/4] setrepo: add deb-src for target node

Manuel Traut manut at linutronix.de
Mon Jul 23 15:49:56 CEST 2018


this is needed to build src cdroms

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/elbexml.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index 0d5fc204..3e9825ae 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -117,7 +117,7 @@ class ElbeXML(object):
 
         return mirror.replace("LOCALMACHINE", "10.0.2.2")
 
-    def _set_repo(self, project, mirror, path, proto='http', auth=False):
+    def _set_repo(self, project, mirror, path, proto='http', auth=False, src=True):
         m = project.node("mirror")
         m.clear() # this also clears url-list
         h = m.ensure_child("primary_host")
@@ -126,6 +126,17 @@ class ElbeXML(object):
         p.set_text(path)
         x = m.ensure_child("primary_proto")
         x.set_text(proto)
+        if src:
+            m.ensure_child("url-list")
+            ul = m.node("url-list")
+            ul.ensure_child("url")
+            url = ul.node("url")
+            url.ensure_child("source")
+            s = url.node("source")
+            s.set_text("%s://%s/%s %s main" % (proto,
+                                               mirror,
+                                               path,
+                                               project.text("suite")))
         project.ensure_child("noauth")
 
     def set_repo(self, mirror, inintvmpath, targetpath, proto='http', auth=False):
@@ -134,7 +145,7 @@ class ElbeXML(object):
             self._set_repo(i, mirror, inintvmpath, proto, auth)
         t = self.prj
         if t:
-            self._set_repo(t, mirror, targetpath, proto, auth)
+            self._set_repo(t, mirror, targetpath, proto, auth, src=True)
 
     # XXX: maybe add cdrom path param ?
     def create_apt_sources_list(self, build_sources=False):
-- 
2.18.0




More information about the elbe-devel mailing list