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: ...@@ -70,19 +70,21 @@ try:
for line in fh: for line in fh:
if line.startswith('deb'): if line.startswith('deb'):
source = line.split() source = line.split()
if (source[1] not in source_deb source_url = source[1].rstrip('/')
and source[1] not in security_sources): if (source_url not in source_deb
and source_url not in security_sources):
for prefix in apt_uri_types: for prefix in apt_uri_types:
if source[1].startswith(prefix): if source_url.startswith(prefix):
source_deb.append(source[1]) source_deb.append(source_url)
elif line.startswith('deb-src'): elif line.startswith('deb-src'):
source = line.split() source = line.split()
if (source[1] not in source_deb_src source_url = source[1].rstrip('/')
and source[1] not in security_sources): if (source_url not in source_deb_src
and source_url not in security_sources):
for prefix in apt_uri_types: for prefix in apt_uri_types:
if source[1].startswith(prefix): if source_url.startswith(prefix):
source_deb_src.append(source[1]) source_deb_src.append(source_url)
fh.close() 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