summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aptsources/distro.py1
-rw-r--r--aptsources/sourceslist.py11
-rw-r--r--data/templates/Debian.info.in12
-rw-r--r--data/templates/Ubuntu.info.in10
-rw-r--r--debian/changelog7
5 files changed, 28 insertions, 13 deletions
diff --git a/aptsources/distro.py b/aptsources/distro.py
index 5b4c6522..f53783dc 100644
--- a/aptsources/distro.py
+++ b/aptsources/distro.py
@@ -244,7 +244,6 @@ class Distribution:
if comp in self.cdrom_comps:
sources = []
sources.extend(self.main_sources)
-
for source in sources:
if comp in source.comps:
source.comps.remove(comp)
diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py
index 14c2a0ea..208e6c7d 100644
--- a/aptsources/sourceslist.py
+++ b/aptsources/sourceslist.py
@@ -219,7 +219,7 @@ class SourcesList:
""" represents the full sources.list + sources.list.d file """
def __init__(self,
withMatcher=True,
- matcherPath="/usr/share/python-aptsources/templates/"):
+ matcherPath="/usr/share/python-apt/templates/"):
self.list = [] # the actual SourceEntries Type
if withMatcher:
self.matcher = SourceEntryMatcher(matcherPath)
@@ -342,6 +342,15 @@ class SourcesList:
def save(self):
""" save the current sources """
files = {}
+ # write an empty default config file if there aren't any sources
+ if len(self.list) == 0:
+ path = "%s%s" % (apt_pkg.Config.FindDir("Dir::Etc"),
+ apt_pkg.Config.Find("Dir::Etc::sourcelist"))
+ header = ("## See sources.list(5) for more information, especialy\n"
+ "# Remember that you can only use http, ftp or file URIs\n"
+ "# CDROMs are managed through the apt-cdrom tool.\n")
+ open(path,"w").write(header)
+ return
for source in self.list:
if not files.has_key(source.file):
files[source.file]=open(source.file,"w")
diff --git a/data/templates/Debian.info.in b/data/templates/Debian.info.in
index 8a2eead3..244e1c6b 100644
--- a/data/templates/Debian.info.in
+++ b/data/templates/Debian.info.in
@@ -4,7 +4,7 @@ Suite: etch
RepositoryType: deb
BaseURI: http://http.us.debian.org/debian/
MatchUri: ftp[0-9]*\.[a-z]\.debian\.org
-MirrorsFile: /usr/share/python-aptsources/templates/Debian.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Debian.mirrors
_Description: Debian 4.0 'Etch'
Component: main
_CompDescription: Officially supported
@@ -27,7 +27,7 @@ Suite: sarge
RepositoryType: deb
BaseURI: http://http.us.debian.org/debian/
MatchUri: ftp[0-9]*\.[a-z]\.debian\.org
-MirrorsFile: /usr/share/python-aptsources/templates/Debian.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Debian.mirrors
_Description: Debian 3.1 'Sarge'
Component: main
_CompDescription: Officially supported
@@ -50,7 +50,7 @@ Suite: stable
RepositoryType: deb
BaseURI: http://http.us.debian.org/debian/
MatchUri: ftp[0-9]*\.[a-z]\.debian\.org
-MirrorsFile: /usr/share/python-aptsources/templates/Debian.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Debian.mirrors
_Description: Debian current stable release
Component: main
_CompDescription: Officially supported
@@ -63,7 +63,7 @@ Suite: testing
RepositoryType: deb
BaseURI: http://http.us.debian.org/debian/
MatchUri: ftp[0-9]*\.[a-z]\.debian\.org
-MirrorsFile: /usr/share/python-aptsources/templates/Debian.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Debian.mirrors
_Description: Debian testing
Component: main
_CompDescription: Officially supported
@@ -76,7 +76,7 @@ Suite: sid
RepositoryType: deb
BaseURI: http://http.us.debian.org/debian/
MatchUri: ftp[0-9]*\.[a-z]\.debian\.org
-MirrorsFile: /usr/share/python-aptsources/templates/Debian.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Debian.mirrors
_Description: Debian 'Sid' (unstable)
Component: main
_CompDescription: Officially supported
@@ -88,7 +88,7 @@ _CompDescription: Non-DFSG-compatible Software
Suite: unstable
RepositoryType: deb
BaseURI: http://http.us.debian.org/debian/
-MirrorsFile: /usr/share/python-aptsources/templates/Debian.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Debian.mirrors
_Description: Debian 'Sid' (unstable)
Component: main
_CompDescription: Officially supported
diff --git a/data/templates/Ubuntu.info.in b/data/templates/Ubuntu.info.in
index fa76879f..56a02436 100644
--- a/data/templates/Ubuntu.info.in
+++ b/data/templates/Ubuntu.info.in
@@ -4,7 +4,7 @@ Suite: feisty
RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu
-MirrorsFile: /usr/share/python-aptsources/templates/Ubuntu.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Ubuntu.mirrors
_Description: Ubuntu 7.04 'Feisty Fawn'
Component: main
_CompDescription: Officially supported
@@ -55,7 +55,7 @@ Suite: edgy
RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu
-MirrorsFile: /usr/share/python-aptsources/templates/Ubuntu.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Ubuntu.mirrors
_Description: Ubuntu 6.10 'Edgy Eft'
Component: main
_CompDescription: Officially supported
@@ -106,7 +106,7 @@ Suite: dapper
RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu
-MirrorsFile: /usr/share/python-aptsources/templates/Ubuntu.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Ubuntu.mirrors
_Description: Ubuntu 6.06 LTS 'Dapper Drake'
Component: main
_CompDescription: Officially supported
@@ -157,7 +157,7 @@ Suite: breezy
RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu
-MirrorsFile: /usr/share/python-aptsources/templates/Ubuntu.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Ubuntu.mirrors
_Description: Ubuntu 5.10 'Breezy Badger'
Component: main
_CompDescription: Officially supported
@@ -199,7 +199,7 @@ Suite: hoary
RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu
-MirrorsFile: /usr/share/python-aptsources/templates/Ubuntu.mirrors
+MirrorsFile: /usr/share/python-apt/templates/Ubuntu.mirrors
_Description: Ubuntu 5.04 'Hoary Hedgehog'
Component: main
_CompDescription: Officially supported
diff --git a/debian/changelog b/debian/changelog
index 545034c6..375eb2c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+python-apt (0.6.20ubuntu3) feisty; urgency=low
+
+ * fixes in the new 'aptsources' module
+ (thanks to Sebastian Heinlein)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 5 Feb 2007 10:29:55 +0100
+
python-apt (0.6.20ubuntu2) feisty; urgency=low
* python/depcache.cc: