From c74cc8406aecc7a80748eb28009f6d934bc9eff9 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 14 Jan 2007 17:15:22 +0000 Subject: [PATCH] Stop parsing autopackages when we have the information we need, or we get to the end of the header. git-svn-id: https://zero-install.svn.sourceforge.net/svnroot/zero-install/trunk/0publish-gui/trunk/0publish-gui@1418 9f8c893c-44ee-0310-b757-c8ca8341c71e --- archive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/archive.py b/archive.py index 1a07ff0..be78dcc 100644 --- a/archive.py +++ b/archive.py @@ -29,6 +29,8 @@ def autopackage_get_details(package): size = os.path.getsize(package) - int(line.split('"', 2)[1]) elif line.startswith('compression=') and 'lzma' in line: type = 'application/x-lzma-compressed-tar' + if size and type: break + if line.startswith('## END OF STUB'): break if size is None: raise Exception("Can't find payload in autopackage (missing 'dataSize')") return size, type -- 2.11.4.GIT