Commit 3bbf69b4 authored by Maciej Delmanowski's avatar Maciej Delmanowski

[debops.apt] Filter '/' at end in original sources

Removing '/' from the end of original APT source URLs should ensure that
there are no duplicates in the generated '/etc/apt/sources.list' file.
parent 698bd4b6
......@@ -70,19 +70,21 @@ try:
for line in fh:
if line.startswith('deb'):
source = line.split()
if (source[1] not in source_deb
and source[1] not in security_sources):
source_url = source[1].rstrip('/')
if (source_url not in source_deb
and source_url not in security_sources):
for prefix in apt_uri_types:
if source[1].startswith(prefix):
source_deb.append(source[1])
if source_url.startswith(prefix):
source_deb.append(source_url)
elif line.startswith('deb-src'):
source = line.split()
if (source[1] not in source_deb_src
and source[1] not in security_sources):
source_url = source[1].rstrip('/')
if (source_url not in source_deb_src
and source_url not in security_sources):
for prefix in apt_uri_types:
if source[1].startswith(prefix):
source_deb_src.append(source[1])
if source_url.startswith(prefix):
source_deb_src.append(source_url)
fh.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment