SHA256
1
0
forked from pool/rpmlint
rpmlint/suse-bzip-bigger-than-100k.diff
OBS User autobuild fbe71d53ac Accepting request 36946 from Base:System
Copy from Base:System/rpmlint based on submit request 36946 from user dirkmueller

OBS-URL: https://build.opensuse.org/request/show/36946
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=56
2010-04-05 16:53:54 +00:00

34 lines
1.4 KiB
Diff

--- SourceCheck.py
+++ SourceCheck.py
@@ -17,7 +17,7 @@
DEFAULT_VALID_SRC_PERMS = (0644, 0755)
-source_regex = re.compile('\\.(tar|patch|tgz|diff)$')
+source_regex = re.compile('\\.(tar|tar\.gz|patch|tgz|diff)$')
compress_ext = Config.getOption("CompressExtension", "bz2")
valid_src_perms = Config.getOption("ValidSrcPerms", DEFAULT_VALID_SRC_PERMS)
@@ -40,7 +40,7 @@
printError(pkg, 'multiple-specfiles', spec_file, fname)
else:
spec_file = fname
- elif source_regex.search(fname) and compress_ext:
+ elif source_regex.search(fname) and compress_ext and pkgfile.size > 120*1024:
if not fname.endswith(compress_ext):
printWarning(pkg, 'source-or-patch-not-compressed',
compress_ext, fname)
@@ -58,8 +58,10 @@
'source-or-patch-not-compressed',
'''A source archive or file in your package is not compressed using the %s
-compression method (doesn't have the %s extension).''' %
-(compress_ext, compress_ext),
+compression method (doesn't have the %s extension).
+Files bigger than 100k should be bzip2'ed
+in order to save space. To bzip2 a patch, use bzip2. To bzip2 a source
+tarball, use bznew''' % (compress_ext, compress_ext),
'strange-permission',
'''A file that you listed to include in your package has strange