From 5e4cd2c12efe25668e997738af0d5c0b48b88ed3 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 8 Jul 2015 11:28:44 +0200 Subject: [PATCH] contrib/rh-bkr: decompress mainpage if it's gzipped Will be useful for compressed rpmmd. --- contrib/rh-bkr/bkr.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/rh-bkr/bkr.py b/contrib/rh-bkr/bkr.py index 5c6bb18288..3125561dc2 100755 --- a/contrib/rh-bkr/bkr.py +++ b/contrib/rh-bkr/bkr.py @@ -383,6 +383,12 @@ class UploadFile_ParseWebsite(UploadFile): page = p.read() p.close() + if re.match('.*\.gz$', self._mainpage): + import gzip, StringIO + p = StringIO.StringIO(page) + page = gzip.GzipFile(fileobj=p).read() + p.close() + urls = list(self.parse_urls(page)) if not urls: self.raise_no_urls()