From 01cb0348e30b31c15a4bebbe3ecfb4605509d29d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 4 Nov 2010 21:43:39 -0500 Subject: reporead: Use transparent compression on open And make filename check more lenient. Signed-off-by: Dan McGee --- devel/management/commands/reporead.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'devel/management') diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 983346c..ef30977 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -347,14 +347,14 @@ def parse_repo(repopath): logger.info("Reading repo tarfile %s", repopath) filename = os.path.split(repopath)[1] - m = re.match(r"^(.*)\.(db|files)\.tar\.(.*)$", filename) + m = re.match(r"^(.*)\.(db|files)\.tar(\..*)?$", filename) if m: reponame = m.group(1) else: logger.error("File does not have the proper extension") raise Exception("File does not have the proper extension") - repodb = tarfile.open(repopath,"r:gz") + repodb = tarfile.open(repopath,"r") ## assuming well formed tar, with dir first then files after ## repo-add enforces this logger.debug("Starting package parsing") -- cgit v1.2.3-24-g4f1b