[elbe-devel] [PATCH] comments: add description of suite interpretation

John Ogness john.ogness at linutronix.de
Mon Nov 20 15:00:39 CET 2017


If the suite name is followed by a slash, the path to search the
mirror is created differently.

    deb http://mirror foo  --> URI-Prefix: http://mirror/dist/foo
    deb http://mirror foo/ --> URI-Prefix: http://mirror/foo

Add comments and use existing variable name so that it is easier
to understand what is happening and know it is on purpose.

Signed-off-by: John Ogness <john.ogness at linutronix.de>
---
 elbepack/elbexml.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index 9babbe2b..39eed4c7 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -166,7 +166,13 @@ class ElbeXML(object):
                 suite = lsplit[2]
                 section = lsplit[3]
 
-                if lsplit[2].endswith('/'):
+                #
+                # NOTE: special interpretation if suite followed by slash
+                #
+                # deb http://mirror foo  --> URI-Prefix: http://mirror/dist/foo
+                # deb http://mirror foo/ --> URI-Prefix: http://mirror/foo
+                #
+                if suite.endswith('/'):
                     s = "%s/%s" % (url, suite)
                 else:
                     s = "%s/dists/%s/"  % (url, suite)
-- 
2.14.0



More information about the elbe-devel mailing list