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

OBS-URL: https://build.opensuse.org/request/show/50483
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=68
2010-10-14 12:32:03 +00:00

34 lines
1.3 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)
@@ -41,7 +41,7 @@
else:
spec_file = fname
elif source_regex.search(fname) and compress_ext and \
- not fname.endswith(compress_ext):
+ not fname.endswith(compress_ext) and pkgfile.size > 120*1024:
printWarning(pkg, 'source-or-patch-not-compressed',
compress_ext, fname)
perm = pkgfile.mode & 07777
@@ -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