[elbe-devel] [PATCH v2 3/4] Add support to specify the architecture on the extra urls mirrors.

Kory Maincent kory.maincent at bootlin.com
Fri Jun 12 21:04:58 CEST 2020


If an extra mirror url contains packages only for a specific architecture,
tell apt to use only this architecture. Use an 'arch' attribute in the url
element of the xml file project desciption.

Signed-off-by: Kory Maincent <kory.maincent at bootlin.com>
---
 elbepack/elbexml.py | 5 ++++-
 schema/dbsfed.xsd   | 8 +++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index f0e3307..96df16b 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -178,8 +178,11 @@ class ElbeXML(object):
                 mirror += "deb-src " + option + self.get_primary_mirror(None, hostsdk=hostsdk)
                 mirror += " " + self.prj.text("suite") + " main\n"
 
-            if self.prj.has("mirror/url-list") and not hostsdk:
+            if self.prj.has("mirror/url-list"):
                 for url in self.prj.node("mirror/url-list"):
+                    if 'arch' in url.et.attrib:
+                        option = "[" + noauth + " arch=" + url.et.attrib['arch'] +"] "
+
                     if url.has("binary"):
                         mirror += "deb " + option + \
                             url.text("binary").strip() + "\n"
diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index e3709de..ec0bb13 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -206,6 +206,13 @@
         </annotation>
       </element>
     </all>
+    <attribute name="arch" type="string" use="optional">
+      <annotation>
+        <documentation>
+          Specify the architecture of the url
+        </documentation>
+      </annotation>
+    </attribute>
     <attribute ref="xml:base"/>
   </complexType>
 
@@ -224,7 +231,6 @@
         </annotation>
       </element>
     </sequence>
-    <attribute ref="xml:base"/>
   </complexType>
 
   <complexType name="mirror">
-- 
2.17.1




More information about the elbe-devel mailing list