--- python-apt-1.4.0~beta3ubuntu1/aptsources/sourceslist.py 2017-04-23 12:02:14.000000000 -0700 +++ sourceslist.py 2017-12-22 10:31:06.864418357 -0800 @@ -303,7 +303,7 @@ class SourcesList(object): yield source def add(self, type, uri, dist, orig_comps, comment="", pos=-1, file=None, - architectures=[]): + architectures=[], disabled=False): """ Add a new source to the sources.list. The method will search for existing matching repos and will try to @@ -315,7 +315,7 @@ class SourcesList(object): # we can modify it later comps = orig_comps[:] sources = self.__find(lambda s: set(s.architectures) == architectures, - disabled=False, invalid=False, type=type, + invalid=False, type=type, uri=uri, dist=dist) # check if we have this source already in the sources.list for source in sources: @@ -339,7 +339,7 @@ class SourcesList(object): source.comps = uniq(source.comps + comps) return source # there isn't any matching source, so create a new line and parse it - line = type + line = type if not disabled else '# ' + type if architectures: line += " [arch=%s]" % ",".join(architectures) line += " %s %s" % (uri, dist)