[elbe-devel] [PATCH] cdroms: fix network access when building src cdrom

Manuel Traut manut at linutronix.de
Wed Jul 4 10:03:59 CEST 2018


From: Shiva Neumann <shiva.neumann at linutronix.de>

Issue: https://github.com/Linutronix/elbe/issues/153
Patch adds a mirror to CdromSrcRepo, default is
'http://ftp.de.debian.org/debian'
Pretty much same as in CdromBinRepo...

Signed-off-by: Shiva Neumann <shiva.neumann at linutronix.de>
Signed-off-by: Manuel Traut <manut at linutronix.de>
Reviewed-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/cdroms.py      |  8 +++++++-
 elbepack/repomanager.py | 12 +++++++++---
 2 files changed, 16 insertions(+), 4 deletions(-)

applied to devel/elbe-3.0

diff --git a/elbepack/cdroms.py b/elbepack/cdroms.py
index 37eb8a36..235b0698 100644
--- a/elbepack/cdroms.py
+++ b/elbepack/cdroms.py
@@ -35,10 +35,16 @@ def mk_source_cdrom(
     hostfs.mkdir_p('/var/cache/elbe/sources')
     rfs.mkdir_p('/var/cache/elbe/sources')
 
+    if not xml is None:
+        mirror = xml.get_primary_mirror (rfs.fname("cdrom"))
+    else:
+        mirror='http://ftp.de.debian.org/debian'
+
     repo = CdromSrcRepo(codename, init_codename,
                         os.path.join(target, "srcrepo"),
                         log,
-                        cdrom_size)
+                        cdrom_size,
+                        mirror)
 
     cache = get_rpcaptcache(rfs, "aptcache.log", arch)
 
diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
index f72b8e3c..1a299f3d 100644
--- a/elbepack/repomanager.py
+++ b/elbepack/repomanager.py
@@ -379,12 +379,18 @@ class CdromBinRepo(RepoBase):
 
 
 class CdromSrcRepo(RepoBase):
-    def __init__(self, codename, init_codename, path, log, maxsize):
-        repo_attrs = RepoAttributes(codename, "source", ["main", "added"])
+    def __init__(self, codename, init_codename, path, log, maxsize,
+                 mirror='http://ftp.debian.org/debian'):
+
+        repo_attrs = RepoAttributes(codename,
+                                    "source",
+                                    ["main", "added"],
+                                    mirror)
+
         if init_codename is not None:
             init_attrs = RepoAttributes(
                 init_codename, "source", [
-                    "main", "main/debian-installer"])
+                    "main", "main/debian-installer"], mirror)
         else:
             init_attrs = None
 
-- 
2.17.1




More information about the elbe-devel mailing list