diff --git a/bin/debexpo_importer.py b/bin/debexpo_importer.py index 03b303293cd38a71f232c5af656d73daa12350f6..75a6649f4b8bcb3e97a560a083162ec39afe8235 100755 --- a/bin/debexpo_importer.py +++ b/bin/debexpo_importer.py @@ -559,12 +559,30 @@ class Importer(object): # b) We couldn't find a orig.tar.gz in our repository # c) No plugin could get the orig.tar.gz # ... time to give up - if orig == None: - orig = "any original tarball (orig.tar.gz)" - self._reject("Rejecting incomplete upload. " - "You did not upload %s and we didn't find it on any of our alternative resources.\n" \ - "If you tried to upload a package which only increased the Debian revision part, make sure you include the full source (pass -sa to dpkg-buildpackage)" % - ( orig )) + + orig_from_debian = None + for result in post_upload.result: + if result.from_plugin == 'getorigtarball': + orig_from_debian = result.outcome + + if orig_from_debian and orig_from_debian == 'tarball-from-debian-too-big': + self._reject("Rejecting incomplete upload. Your upload did " + "not include the orig tarball. We did find it on " + "Debian main archive, however it is too big to be " + "downloaded by our system (> 100Mo).\nPlease " + "re-upload your package to mentors.debian.net, " + "including the orig tarball (pass -sa to " + "dpkg-buildpackage). Thanks,") + else: + if orig == None: + orig = "any original tarball (orig.tar.gz)" + self._reject("Rejecting incomplete upload. " + "You did not upload %s and we didn't find it on any of our" + " alternative resources.\n" + "If you tried to upload a package which only increased the" + " Debian revision part, make sure you include the full" + " source (pass -sa to dpkg-buildpackage)" % + ( orig )) else: toinstall.append(orig) diff --git a/debexpo/plugins/getorigtarball.py b/debexpo/plugins/getorigtarball.py index c793184c30ef6db92dcc8c857eb9245903bc510c..23eb4491a8d7bf3d67d4c3a951d181da2015351a 100644 --- a/debexpo/plugins/getorigtarball.py +++ b/debexpo/plugins/getorigtarball.py @@ -63,12 +63,13 @@ class GetOrigTarballPlugin(BasePlugin): larger than the configured size """ - # Set download of files, when the expected file size of the orig.tar.gz is larger - # than the configured threshold. - # XXX TODO: This size should be the 75% quartile, that is the value where 75% of all - # packages are smaller than that. For now, blindly assume this as 15M - size = 15728640 - log.debug('Checking whether an orig tarball mentioned in the dsc is missing') + # Set download of files, when the expected file size of the orig.tar.gz + # is larger than the configured threshold. + # The 100M limit has been choosen based on the biggest 500 packages as + # of late 2018. + size = 104857600 + log.debug('Checking whether an orig tarball mentioned in the dsc is' + ' missing') dsc = deb822.Dsc(file(self.changes.get_dsc())) filecheck = CheckFiles() @@ -90,8 +91,11 @@ class GetOrigTarballPlugin(BasePlugin): dscfile['size'] = int(dscfile['size']) if orig == dscfile['name']: if dscfile['size'] > size: - log.warning("Skipping eventual download of orig.tar.gz %s: size %d > %d" % (dscfile['name'], dscfile['size'], size)) - return + log.warning("Skipping eventual download of orig.tar.gz %s:" + " size %d > %d" % (dscfile['name'], + dscfile['size'], size)) + self.info('tarball-from-debian-too-big', None) + return orig = dscfile break else: @@ -119,5 +123,9 @@ class GetOrigTarballPlugin(BasePlugin): plugin = GetOrigTarballPlugin outcomes = { - 'tarball-taken-from-debian' : { 'name' : 'The original tarball has been retrieved from Debian' }, + 'tarball-taken-from-debian' : { 'name' : 'The original tarball has been' + ' retrieved from Debian' }, + 'tarball-from-debian-too-big': {'name': 'The original tarball cannot be' + ' retrieved from Debian: file too' + ' big'}, }