From 0a6e7dc1aac196e640bda1160c9561a398d76044 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 May 2006 18:11:55 +0200 Subject: * apt/package.py: - check if _lookupRecords() succeeded when checking description/maintainer --- apt/package.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'apt') diff --git a/apt/package.py b/apt/package.py index 4fceb904..55e1cd01 100644 --- a/apt/package.py +++ b/apt/package.py @@ -49,7 +49,7 @@ class Package(object): # check if we found a version if ver == None: - #print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) + print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) return False if ver.FileList == None: @@ -149,13 +149,15 @@ class Package(object): def summary(self): """ Return the short description (one line summary) """ - self._lookupRecord() + if not self._lookupRecord(): + return "" return self._records.ShortDesc summary = property(summary) def description(self, format=True): """ Return the formated long description """ - self._lookupRecord() + if not self._lookupRecord(): + return "" desc = "" for line in string.split(self._records.LongDesc, "\n"): tmp = string.strip(line) @@ -168,7 +170,8 @@ class Package(object): def rawDescription(self): """ return the long description (raw)""" - self._lookupRecord() + if not self._lookupRecord(): + return "" return self._records.LongDesc rawDescription = property(rawDescription) -- cgit v1.2.3 From 5042fb1f6160381c18a4add7076e8da175cba2d0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 May 2006 18:14:20 +0200 Subject: * remove debug string --- apt/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt') diff --git a/apt/package.py b/apt/package.py index 55e1cd01..53f6c1f5 100644 --- a/apt/package.py +++ b/apt/package.py @@ -49,7 +49,7 @@ class Package(object): # check if we found a version if ver == None: - print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) + #print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) return False if ver.FileList == None: -- cgit v1.2.3 From 52ae9a181314398e4dc4996d1409e99b9bdbbf7e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 May 2006 18:41:09 +0200 Subject: * apt/package.py: - actually return values in {candiate,installed}Downloadable() --- apt/package.py | 4 ++-- debian/changelog | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'apt') diff --git a/apt/package.py b/apt/package.py index 53f6c1f5..7297a1bb 100644 --- a/apt/package.py +++ b/apt/package.py @@ -105,12 +105,12 @@ class Package(object): return ver.Downloadable def candidateDownloadable(self): " returns if the canidate is downloadable " - self._downloadable(useCandidate=True) + return self._downloadable(useCandidate=True) candidateDownloadable = property(candidateDownloadable) def installedDownloadable(self): " returns if the installed version is downloadable " - self._downloadable(useCandidate=False) + return self._downloadable(useCandidate=False) installedDownloadable = property(installedDownloadable) def sourcePackageName(self): diff --git a/debian/changelog b/debian/changelog index 896e4a0d..5eac06d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ python-apt (0.6.17) unstable; urgency=low * apt/package.py: - fix various pychecker warnings - check if looupRecords succeeded + - fix bug in the return statement of _downloadable() * apt/cache.py: * python/srcrecords.cc: - add "Restart" method -- cgit v1.2.3 From 22e59d0dc92c45ea63d75d73474b5be610e57a58 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Mon, 12 Jun 2006 18:48:16 -0300 Subject: * apt/cache.py: - fix commit doc string to also cite the open related callbacks --- apt/cache.py | 2 +- debian/changelog | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'apt') diff --git a/apt/cache.py b/apt/cache.py index 01034cf9..8410fc56 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -218,7 +218,7 @@ class Cache(object): def connect(self, name, callback): """ connect to a signal, currently only used for - cache_{post,pre}_changed """ + cache_{post,pre}_{changed,open} """ if not self._callbacks.has_key(name): self._callbacks[name] = [] self._callbacks[name].append(callback) diff --git a/debian/changelog b/debian/changelog index a1a9858e..ff62eac6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ python-apt (0.6.18) unstable; urgency=low + [ Michael Vogt ] * doc/examples/print_uris.py: - added a example to show how the indexfile.ArchiveURI() can be used with binary packages + [ Otavio Salvador ] + * apt/cache.py: + - fix commit doc string to also cite the open related callbacks + -- python-apt (0.6.17) unstable; urgency=low -- cgit v1.2.3 From 473031d5c8273643592d2f269fd532afb560303c Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 14 Jun 2006 00:31:49 -0300 Subject: - allow change of rootdir for APT database loading --- apt/cache.py | 6 +++++- debian/changelog | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'apt') diff --git a/apt/cache.py b/apt/cache.py index 8410fc56..690510e3 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -31,10 +31,14 @@ class Cache(object): dictionary """ - def __init__(self, progress=None): + def __init__(self, progress=None, rootdir=None): self._callbacks = {} self.open(progress) + if rootdir: + apt_pkg.Config.Set("Dir", rootdir) + apt_pkg.Config.Set("Dir::State::status", rootdir + "/var/lib/dpkg/status") + def _runCallbacks(self, name): """ internal helper to run a callback """ if self._callbacks.has_key(name): diff --git a/debian/changelog b/debian/changelog index ff62eac6..287605e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ python-apt (0.6.18) unstable; urgency=low [ Otavio Salvador ] * apt/cache.py: - fix commit doc string to also cite the open related callbacks + - allow change of rootdir for APT database loading -- -- cgit v1.2.3 From 3b12e19d8a19ae319646cc2a97c36e92cf65a1d5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 15 Jun 2006 08:59:04 +0200 Subject: * apt/packages.py: - add autoInst option --- apt/package.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apt') diff --git a/apt/package.py b/apt/package.py index 7297a1bb..0d1145ea 100644 --- a/apt/package.py +++ b/apt/package.py @@ -290,10 +290,12 @@ class Package(object): Fix.InstallProtect() Fix.Resolve() self._pcache.cachePostChange() - def markInstall(self, autoFix=True): - """ mark a package for install. Run the resolver if autoFix is set """ + def markInstall(self, autoFix=True, autoInst=True): + """ mark a package for install. Run the resolver if autoFix is set, + automatically install required dependencies if autoInst is set + """ self._pcache.cachePreChange() - self._depcache.MarkInstall(self._pkg) + self._depcache.MarkInstall(self._pkg, autoInst) # try to fix broken stuff if autoFix and self._depcache.BrokenCount > 0: fixer = apt_pkg.GetPkgProblemResolver(self._depcache) -- cgit v1.2.3