From db99d5da6361e0e745dd853c2665a4569ee90f36 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jul 24 2020 11:51:34 +0000 Subject: cli: don't check size for signed rpms We store only size of unsigned copy in db, so checking it for signed rpms results in error. Fixes: https://pagure.io/koji/issue/2394 --- diff --git a/cli/koji_cli/lib.py b/cli/koji_cli/lib.py index a85e537..e91a61b 100644 --- a/cli/koji_cli/lib.py +++ b/cli/koji_cli/lib.py @@ -563,12 +563,13 @@ def download_rpm(build, rpm, topurl, sigkey=None, quiet=False, noprogress=False) download_file(url, path, quiet=quiet, noprogress=noprogress, filesize=rpm['size']) - # size - size = os.path.getsize(path) - if size != rpm['size']: - os.unlink(path) - error("Downloaded rpm %s size %d does not match db size %d, deleting" % - (path, size, rpm['size'])) + # size - we have stored size only for unsigned copies + if not sigkey: + size = os.path.getsize(path) + if size != rpm['size']: + os.unlink(path) + error("Downloaded rpm %s size %d does not match db size %d, deleting" % + (path, size, rpm['size'])) # basic sanity try: