[elbe-devel] [PATCH 4/5] elbexml: urlvalidation exception for security update repo

Manuel Traut manut at linutronix.de
Wed Aug 23 17:08:24 CEST 2017


This is a workaround for false validation errors, like:

00:07:00.780 Build failed
00:07:00.780 Traceback (most recent call last):
00:07:00.780   File "/var/cache/elbe/devel/elbepack/asyncworker.py", line 116, in execute
00:07:00.780     skip_pbuild=self.skip_pbuilder)
00:07:00.780   File "/var/cache/elbe/devel/elbepack/elbeproject.py", line 215, in build
00:07:00.780     self.xml.validate_apt_sources ( m , self.arch )
00:07:00.780   File "/var/cache/elbe/devel/elbepack/elbexml.py", line 209, in validate_apt_sources
00:07:00.780     raise ValidationError (["Repository %s can not be validated" % u])
00:07:00.780 ValidationError: Repository http://security.debian.org/dists/stretch/updates/main/binary-amd64/Release can not be validated
00:07:00.780
00:07:00.780
00:07:00.780
00:07:00.780 Exception:
00:07:00.780 Repository http://security.debian.org/dists/stretch/updates/main/binary-amd64/Release can not be validated

There is no arch specific Release file on security.debian.org mirrors.
So use the top-level Release file if 'updates'
is detected in the suite string.

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

diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index 71fb2ec2..9babbe2b 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -164,6 +164,7 @@ class ElbeXML(object):
                 lsplit = l.split (" ")
                 url = lsplit[1]
                 suite = lsplit[2]
+                section = lsplit[3]
 
                 if lsplit[2].endswith('/'):
                     s = "%s/%s" % (url, suite)
@@ -173,11 +174,17 @@ class ElbeXML(object):
                 urls.append(s + "Release")
                 if url_validation == ValidationMode.CHECK_ALL:
                     if l.startswith ("deb-src "):
-                        urls.append(s + lsplit[3] + "/source/Release")
+                        urls.append(s + section + "/source/Release")
                     else:
-                        urls.append(s + lsplit[3] + "/binary-%s/Release" % buildtype)
+                        if "updates" in suite:
+                            urls.append(s + "/Release")
+                        else:
+                            urls.append(s + section + "/binary-%s/Release" % buildtype)
                 elif url_validation == ValidationMode.CHECK_BINARIES:
-                    urls.append(s + lsplit[3] + "/binary-%s/Release" % buildtype)
+                    if "updates" in suite:
+                        urls.append(s + section + "/Release")
+                    else:
+                        urls.append(s + section + "/binary-%s/Release" % buildtype)
 
         if not self.prj:
             return
-- 
2.14.1




More information about the elbe-devel mailing list