diff options
| -rw-r--r-- | apt/cache.py | 5 | ||||
| -rw-r--r-- | aptsources/distinfo.py | 14 | ||||
| -rw-r--r-- | aptsources/distro.py | 2 | ||||
| -rw-r--r-- | data/templates/Ubuntu.info.in | 62 | ||||
| -rw-r--r-- | debian/README.source | 3 | ||||
| -rw-r--r-- | debian/changelog | 18 | ||||
| -rw-r--r-- | debian/control | 2 |
7 files changed, 98 insertions, 8 deletions
diff --git a/apt/cache.py b/apt/cache.py index a43bd5d7..36e3df8e 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -47,8 +47,11 @@ class Cache(object): dictionary """ - def __init__(self, progress=None, rootdir=None): + def __init__(self, progress=None, rootdir=None, memonly=False): self._callbacks = {} + if memonly: + # force apt to build its caches in memory + apt_pkg.Config.Set("Dir::Cache::pkgcache","") if rootdir: apt_pkg.Config.Set("Dir", rootdir) apt_pkg.Config.Set( diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index 3bdbd653..d7dfd970 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -28,7 +28,7 @@ import gettext from os import getenv import ConfigParser import string -import re +import apt_pkg #from gettext import gettext as _ import gettext @@ -151,6 +151,8 @@ class DistInfo: base_dir = "/usr/share/python-apt/templates"): self.metarelease_uri = '' self.templates = [] + apt_pkg.init() + self.arch = apt_pkg.Config.Find("APT::Architecture") location = None match_loc = re.compile(r"^#LOC:(.+)$") @@ -212,12 +214,16 @@ class DistInfo: template.available = value elif field == 'RepositoryType': template.type = value - elif field == 'BaseURI': + elif field == 'BaseURI' and not template.base_uri: template.base_uri = value + elif field == 'BaseURI-%s' % self.arch: + template.base_uri = value + elif field == 'MatchURI' and not template.match_uri: template.match_uri = value - elif field == 'MatchURI': + elif field == 'MatchURI-%s' % self.arch: template.match_uri = value - elif field == 'MirrorsFile': + elif (field == 'MirrorsFile' or + field == 'MirrorsFile-%s' % self.arch): if not map_mirror_sets.has_key(value): mirror_set = {} try: diff --git a/aptsources/distro.py b/aptsources/distro.py index f631e285..0bf8aba9 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -177,7 +177,7 @@ class Distribution: # try to guess the nearest mirror from the locale self.country = None self.country_code = None - locale = os.getenv("LANG", default="en.UK") + locale = os.getenv("LANG", default="en_UK") a = locale.find("_") z = locale.find(".") if z == -1: diff --git a/data/templates/Ubuntu.info.in b/data/templates/Ubuntu.info.in index ab3dc790..0a15f0ea 100644 --- a/data/templates/Ubuntu.info.in +++ b/data/templates/Ubuntu.info.in @@ -1,10 +1,68 @@ _ChangelogURI: http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/changelog +Suite: intrepid +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +BaseURI-powerpc: http://ports.ubuntu.com/ +MatchURI-powerpc: ports.ubuntu.com +MatchURI: archive.ubuntu.com/ubuntu +MirrorsFile-amd64: /usr/share/python-apt/templates/Ubuntu.mirrors +MirrorsFile-i386: /usr/share/python-apt/templates/Ubuntu.mirrors +_Description: Ubuntu 8.10 'Intrepid Ibex' +Component: main +_CompDescription: Officially supported +_CompDescriptionLong: Canonical-supported Open Source software +Component: universe +_CompDescription: Community-maintained +_CompDescriptionLong: Community-maintained Open Source software +Component: restricted +_CompDescription: Non-free drivers +_CompDescriptionLong: Proprietary drivers for devices +Component: multiverse +_CompDescription: Restricted software +_CompDescriptionLong: Software restricted by copyright or legal issues + +Suite: intrepid +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*8.10 +_Description: Cdrom with Ubuntu 8.10 'Intrepid Ibex' +Available: False +Component: main +_CompDescription: Officially supported +Component: restricted +_CompDescription: Restricted copyright + +Suite: intrepid-security +ParentSuite: intrepid +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu|security.ubuntu.com +_Description: Important security updates + +Suite: intrepid-updates +ParentSuite: intrepid +RepositoryType: deb +_Description: Recommended updates + +Suite: intrepid-proposed +ParentSuite: intrepid +RepositoryType: deb +_Description: Pre-released updates + +Suite: intrepid-backports +ParentSuite: intrepid +RepositoryType: deb +_Description: Unsupported updates + + Suite: hardy RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu -MirrorsFile: /usr/share/python-apt/templates/Ubuntu.mirrors +BaseURI-powerpc: http://ports.ubuntu.com/ +MatchURI-powerpc: ports.ubuntu.com +MirrorsFile-amd64: /usr/share/python-apt/templates/Ubuntu.mirrors +MirrorsFile-i386: /usr/share/python-apt/templates/Ubuntu.mirrors _Description: Ubuntu 8.04 'Hardy Heron' Component: main _CompDescription: Officially supported @@ -34,6 +92,8 @@ ParentSuite: hardy RepositoryType: deb BaseURI: http://security.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu|security.ubuntu.com +BaseURI-powerpc: http://ports.ubuntu.com/ +MatchURI-powerpc: ports.ubuntu.com/ubuntu _Description: Important security updates Suite: hardy-updates diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 00000000..ecd31364 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,3 @@ +This package is maintained in bzr and it should be build +with: +$ bzr-buildpackage --native diff --git a/debian/changelog b/debian/changelog index c81885f6..7f329fdd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +python-apt (0.7.6) unstable; urgency=low + + * apt/cache.py: + - add "memonly" option to apt.Cache() to force python-apt to + not touch the pkgcache.bin file (this works around a possible + race condition in the pkgcache.bin handling) + * data/templates/Ubuntu.info.in: + - added ubuntu 'intrepid' + * debian/README.source: + - added (basic) documentation how to build python-apt + * aptsources/distinfo.py: + - support arch specific BaseURI, MatchURI and MirrosFile fields + in the distinfo template + * debian/control: + - move bzr branch to bzr.debian.org and update Vcs-Bzr + + -- Michael Vogt <mvo@debian.org> Wed, 18 Jun 2008 14:46:43 +0200 + python-apt (0.7.5) unstable; urgency=low * use the new ListUpdate() code diff --git a/debian/control b/debian/control index a1d9b807..2e933b18 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Uploaders: Matt Zimmerman <mdz@debian.org>, Michael Vogt <mvo@debian.org> Standards-Version: 3.7.2.2 XS-Python-Version: all Build-Depends: debhelper (>= 5.0.37.1), libapt-pkg-dev (>= 0.7.10), apt-utils, python-all-dev, python-distutils-extra (>= 1.9.0), cdbs, python-central (>= 0.5), python-all-dbg -XS-Vcs-Bzr: http://people.debian.org/~mvo/bzr/python-apt/debian-sid +Vcs-Bzr: http://bzr.debian.org/apt/python-apt/debian-sid Package: python-apt Architecture: any |
