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

OBS-URL: https://build.opensuse.org/request/show/20532
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=46
2009-09-16 16:41:21 +00:00

32 lines
1.2 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|patch|tgz|tar\.gz|diff)$')
use_bzip2 = Config.getOption('UseBzip2', True)
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):
+ elif source_regex.search(fname) and pkgfile.size > 120*1024:
if use_bzip2:
if not fname.endswith('.bz2'):
printWarning(pkg, 'source-or-patch-not-bzipped', fname)
@@ -61,7 +61,9 @@
'source-or-patch-not-bzipped',
'''A source archive or file in your package is not bzipped (doesn't
-have the .bz2 extension). To bzip it, use bzip2.''',
+have the .bz2 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''',
'source-or-patch-not-gzipped',
'''A source archive or file in your package is not gzipped (doesn't