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(+) (limited to 'AptSources') 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 From 29858347385381d3cf59e3ff2be38bd1c971f187 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sun, 26 Nov 2006 10:26:03 +0100 Subject: * add __init.py__ --- AptSources/__init__.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 AptSources/__init__.py (limited to 'AptSources') diff --git a/AptSources/__init__.py b/AptSources/__init__.py new file mode 100644 index 00000000..8d1c8b69 --- /dev/null +++ b/AptSources/__init__.py @@ -0,0 +1 @@ + -- cgit v1.2.3 From 64be9ca0d20252695e2638c1f4b15b2db4588a8e Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sun, 26 Nov 2006 10:39:48 +0100 Subject: * Use the new data path --- AptSources/DistInfo.py | 4 ++-- AptSources/aptsources.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'AptSources') diff --git a/AptSources/DistInfo.py b/AptSources/DistInfo.py index 57621f52..2dbd9a1b 100644 --- a/AptSources/DistInfo.py +++ b/AptSources/DistInfo.py @@ -52,7 +52,7 @@ class Component: class DistInfo: def __init__(self, dist = None, - base_dir = "/usr/share/update-manager/channels"): + base_dir = "/usr/share/python-aptsources/templates"): self.metarelease_uri = '' self.suites = [] @@ -148,7 +148,7 @@ class DistInfo: if __name__ == "__main__": - d = DistInfo ("Ubuntu", "../../data/channels") + d = DistInfo ("Ubuntu", "../../data/templates") print d.changelogs_uri for suite in d.suites: print "\nSuite: %s" % suite.name diff --git a/AptSources/aptsources.py b/AptSources/aptsources.py index 7078147f..713b0ff8 100644 --- a/AptSources/aptsources.py +++ b/AptSources/aptsources.py @@ -219,7 +219,7 @@ class SourcesList: """ represents the full sources.list + sources.list.d file """ def __init__(self, withMatcher=True, - matcherPath="/usr/share/update-manager/channels/"): + matcherPath="/usr/share/python-aptsources/templates/"): self.list = [] # the actual SourceEntries Type if withMatcher: self.matcher = SourceEntryMatcher(matcherPath) -- cgit v1.2.3