From dbb6794e792b3de46bbd4e4dff238eaf3bbd5f09 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sun, 26 Nov 2006 10:00:56 +0100 Subject: * add a function to change the server of all distro specific sources --- AptSources/aptsources.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AptSources/aptsources.py b/AptSources/aptsources.py index 34b5b967..7078147f 100644 --- a/AptSources/aptsources.py +++ b/AptSources/aptsources.py @@ -673,6 +673,17 @@ class Distribution: if len(source.comps) < 1: sourceslist.remove(source) + def change_server(self, uri): + ''' Change the server of all distro specific sources to + a given host ''' + sources = [] + sources.extend(self.main_sources) + sources.extend(self.child_sources) + sources.extend(self.source_code_sources) + for source in sources: + # FIXME: ugly + if not "security.ubuntu.com" in source.uri: + source.uri = uri # some simple tests if __name__ == "__main__": -- cgit v1.2.3