Hi -release, Please unblock aptfs 0.6: * debian/changelog entry: aptfs (0.6) unstable; urgency=low * Don't ignore source packages which contain a period (".") in their name * Remove temporary directory if download fails. * Move to Debhelper 7. -- Chris Lamb <chris@chris-lamb.co.uk> Sun, 17 Aug 2008 22:05:14 +0100 * diffstat for detailed changes: aptfs.py | 6 +++++- download.py | 7 +++++-- util.py | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) The corresponding patch is attached. * detail: - Packages with periods in their names (eg. "linux-2.6") were not present in the directory listing. This was caused by the '.' character being treated literally instead of as a metacharacter for a regex. util.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) - Temporary directories were not being cleaned-up if the download failed. This is a particular problem if all the remaining disk space was consumed by the extraction as it is never cleaned up, causing headaches. This was reported (on IRC) by Tim Retout <tim@retout.co.uk>. aptfs.py | 6 +++++- download.py | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) - The rest of the patch is noise from moving to dh7. Thank-you for your attention (and efforts towards the Lenny release). Regards, -- Chris Lamb, UK chris@chris-lamb.co.uk GPG: 0x634F9A20
diff --git a/AptFs/aptfs.py b/AptFs/aptfs.py index eb59996..3eff4e4 100644 --- a/AptFs/aptfs.py +++ b/AptFs/aptfs.py @@ -83,7 +83,11 @@ class AptFs(Fuse): pkg, target = parse_path() if target is None: - target = download(pkg, self.temp_dir, self.secure) + try: + target = download(pkg, self.temp_dir, self.secure) + except DownloadError, e: + shutil.rmtree(e.dir) + raise self.source_packages[pkg] = target self.window.insert(0, pkg) diff --git a/AptFs/download.py b/AptFs/download.py index 53c96a7..bb3674b 100644 --- a/AptFs/download.py +++ b/AptFs/download.py @@ -20,7 +20,10 @@ import tempfile import commands import os -class DownloadError(Exception): pass +class DownloadError(Exception): + def __init__(self, output, dir): + super(DownloadError, self).__init__(self, output) + self.dir = dir def download(srcpkg, tempdir=None, secure=False): ''' @@ -52,7 +55,7 @@ def download(srcpkg, tempdir=None, secure=False): status, output = commands.getstatusoutput(' && '.join(cmds)) if status != 0: - raise DownloadError(output) + raise DownloadError(output, dir) for fname in os.listdir(dir): path = os.path.join(dir, fname) diff --git a/AptFs/util.py b/AptFs/util.py index 4c12e70..9b10ce7 100644 --- a/AptFs/util.py +++ b/AptFs/util.py @@ -50,7 +50,7 @@ def package_info(): if not glob.glob('/var/lib/apt/lists/*_Sources'): raise StopIteration() - stdout, stdin = popen2.popen2('grep-dctrl -S . --invert-match --no-field-names --show-field=Package,Binary /var/lib/apt/lists/*_Sources') + stdout, stdin = popen2.popen2('grep-dctrl -FSource:Package --regex . --no-field-names --show-field=Package,Binary /var/lib/apt/lists/*_Sources') for line in stdout: source_package = line.strip()
Attachment:
signature.asc
Description: PGP signature