SHA256
1
0
forked from pool/rpmlint
OBS User unknown 2008-04-17 02:52:37 +00:00 committed by Git OBS Bridge
commit 23d901309b
65 changed files with 4707 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

38
CheckBuildRoot.py Normal file
View File

@ -0,0 +1,38 @@
# vim:sw=4:et
#############################################################################
# File : CheckBuildRoot.py
# Package : rpmlint
# Author : Dirk Mueller, Stephan Kulow
# Purpose : Check for files containing $RPM_BUILD_ROOT
#############################################################################
from Filter import *
import AbstractCheck
import rpm
import re
import os
import commands
import Config
import stat
class BuildRootCheck(AbstractCheck.AbstractFilesCheck):
def __init__(self):
AbstractCheck.AbstractFilesCheck.__init__(self, "BuildRootCheck", ".*")
self.build_root_re = re.compile('/var/tmp/[\w\!-\.]{1,60}-build/')
def check_file(self, pkg, filename):
if filename.startswith('/usr/lib/debug') or pkg.isSource():
return
if not stat.S_ISREG(pkg.files()[filename][0]):
return
if len(pkg.grep(self.build_root_re, filename)):
printError(pkg, "file-contains-buildroot", filename)
check=BuildRootCheck()
if Config.info:
addDetails(
'file-contains-buildroot',
"Your file contains traces of $RPM_BUILD_ROOT."
)

86
CheckCommonFiles.py Normal file
View File

@ -0,0 +1,86 @@
# vim:sw=4:et
#############################################################################
# File : CheckCommonFiles.py
# Package : rpmlint
# Author : Dirk Mueller
# Purpose : Check for common files being packaged
#############################################################################
from Filter import *
import AbstractCheck
import rpm
import re
import commands
import stat
import Config
import os
import string
class CommonFilesCheck(AbstractCheck.AbstractCheck):
def __init__(self):
self.map = []
AbstractCheck.AbstractCheck.__init__(self, "CommonFilesCheck")
self.sources_am_re = re.compile('([\w\d_]+_SOURCES\s*=|\s*SUBDIRS\s*=)')
def check(self, pkg):
if pkg.isSource():
return
files = pkg.files()
for f in files:
if f in pkg.ghostFiles():
continue
enreg = files[f]
mode = enreg[0]
links = enreg[3]
size = enreg[4]
md5 = enreg[5]
rdev = enreg[7]
if len(md5) and md5 in (
'c59cbaf0df9bcf35feca0d0f1fc01dae',
'cf8c4d1a5ab88db006c47ae2b51a6b30',
'5d4638159851671944108691f23e4f28',
'0d6be33865b76025c20b48bcac87adb7'):
printError(pkg, "generic-build-instructions", f)
if len(md5) and md5 in (
'94d55d512a9ba36caa9b7df079bae19f'):
printError(pkg, "duplicated-file-gpl-v2", f)
# bsd causes the false positive COPYING.BSD
if len(md5) and f.rsplit('/',1)[1][0].lower() == 'r' and f.rsplit('.',1)[-1].lower() in (
'aix', 'bsd', 'dos', 'hpux', 'irix', 'os2', 'mac', 'macos', 'tru64',
'sco', 'vms', 'win32', 'win', 'solaris'):
printWarning(pkg, "non-linux-readme", f)
if f.endswith("/Makefile.am") and f[:-3] + ".in" in files and f in pkg.docFiles():
if not len(pkg.grep(self.sources_am_re, f)):
printError(pkg, "makefile-junk", f)
printError(pkg, "makefile-junk", f[:-3] + ".in")
if f[:-3] in files:
printError(pkg, "makefile-junk", f[:-3])
check=CommonFilesCheck()
if Config.info:
addDetails(
'generic-build-instructions',
"""Your package contains a file that contains the FSF generic
configure/make/make install instructions. Those are useless
for a binary package. Consider removing it to save 3kb of rpm size.""",
'duplicated-file-gpl-v2',
"""Your package contains a file that contains the FSF GPLv2
license. If you really have to ship it, consider symlinking it
from the licenses package.""",
'non-linux-readme',
"""Your package contains a file that contains instructions
for non-linux platforms. They're most likely unneccessary bloat,
consider removing them from your package.""",
'makefile-junk',
"""Your package contains makefiles that only make sense in a
source package. Did you package a complete directory from the
tarball by using %doc? Consider removing Makefile* from this
directory at the end of your %install section to reduce package bloat."""
)

98
CheckExecDocs.py Normal file
View File

@ -0,0 +1,98 @@
# vim:sw=4:et
#---------------------------------------------------------------
# Module : rpmlint
# File : CheckExecDocs.py
# Author : Stephan Kulow, Dirk Mueller
# Purpose : Check for executable files in %doc
#---------------------------------------------------------------
from Filter import *
import AbstractCheck
import rpm
import re
import commands
import stat
import Config
import os
import string
def ignore_pkg(name):
if name.startswith('bundle-'):
return True
if name.find('-devel') != -1:
return True
if name.find('-doc') != -1:
return True
return False
def lang_ignore_pkg(name):
if ignore_pkg(name):
return True
if name.endswith('-lang'):
return True
if name.find('-trans-') != -1:
return True
return False
class ExecDocsCheck(AbstractCheck.AbstractCheck):
def __init__(self):
self.map = []
AbstractCheck.AbstractCheck.__init__(self, "ExecDocsCheck")
def check(self, pkg):
if pkg.isSource():
return
files = pkg.files()
complete_size=0
lang_size=0
for f in files:
if stat.S_ISREG(files[f][0]):
complete_size += files[f][4]
if pkg.fileLang(f) != '':
lang_size += files[f][4]
doc_size=0
for f in pkg.docFiles():
if stat.S_ISREG(files[f][0]):
doc_size += files[f][4]
if doc_size * 2 >= complete_size \
and doc_size > 100*1024 and (complete_size - doc_size) * 20 > complete_size \
and not ignore_pkg(pkg.name):
printWarning(pkg, "package-with-huge-docs", ("%3d%%" % (doc_size * 100 / complete_size)) )
if lang_size * 2 >= complete_size \
and lang_size > 100*1024 and (complete_size - lang_size) * 20 > complete_size \
and not lang_ignore_pkg(pkg.name):
printWarning(pkg, "package-with-huge-translation", ("%3d%%" % (lang_size * 100 / complete_size)))
for f in pkg.docFiles():
enreg=files[f]
mode=enreg[0]
if not stat.S_ISREG(mode) or not mode & 0111:
continue
for ext in ['txt', 'gif', 'jpg', 'html', 'pdf', 'ps', 'pdf.gz', 'ps.gz']:
if f.endswith("." + ext):
printError(pkg, 'executable-docs', f)
for name in ['README', 'NEWS', 'COPYING', 'AUTHORS']:
if f.endswith("/" + name):
printError(pkg, 'executable-docs', f)
check=ExecDocsCheck()
if Config.info:
addDetails(
'executable-docs',
"Documentation should not be executable.",
'package-with-huge-docs',
"""More than half the size of your package is documentation.
Consider splitting it into a -doc subpackage.""",
'package-with-huge-translation',
"""More than half the size of your package is language-specific.
Consider splitting it into a -lang subpackage."""
)

53
CheckIconSizes.py Normal file
View File

@ -0,0 +1,53 @@
# vim:sw=4:et
#############################################################################
# File : CheckIconSizes.py
# Package : rpmlint
# Author : Dirk Mueller
# Purpose : Check for common scaling errors in icons
#############################################################################
from Filter import *
import AbstractCheck
import rpm
import re
import commands
import stat
import Config
import os
import string
class IconSizesCheck(AbstractCheck.AbstractCheck):
def __init__(self):
AbstractCheck.AbstractCheck.__init__(self, "IconSizesCheck")
self.file_size_regex = re.compile('/icons/[^/]+/(\d+)x(\d+)/')
self.info_size_regex = re.compile('(\d+) x (\d+)')
def check(self, pkg):
if pkg.isSource():
return
info = pkg.getFilesInfo()
for i in info:
file = i[0]
res = self.file_size_regex.search(file)
if res:
sizes = (res.group(1), res.group(2))
res = self.info_size_regex.search(i[1])
if res:
actualsizes = (res.group(1), res.group(2))
if abs(int(sizes[0])-int(actualsizes[0])) > 2 or \
abs(int(sizes[1])-int(actualsizes[1])) > 2:
printError(pkg,"wrong-icon-size", file, "expected:",
"x".join(sizes), "actual:", "x".join(actualsizes))
check=IconSizesCheck()
if Config.info:
addDetails(
'wrong-icon-size',
"""Your icon file is installed in a fixed-size directory, but has a largely incorrect size.
Some desktop environments (e.g. GNOME) display them incorrectly."""
)

99
CheckInitScripts.py Normal file
View File

@ -0,0 +1,99 @@
# vim:sw=4:et
#############################################################################
# File : CheckInitScripts.py
# Package : rpmlint
# Author : Dirk Mueller
# Purpose : Check for common mistakes in init scripts
#############################################################################
from Filter import *
import AbstractCheck
import rpm
import re
import commands
import stat
import Config
import os
import string
insserv_regex=re.compile('^\s*sbin/insserv', re.MULTILINE)
preun_regex=re.compile('^\s*/etc/init.d/\S+ stop', re.MULTILINE)
class InitScriptsCheck(AbstractCheck.AbstractFilesCheck):
def __init__(self):
AbstractCheck.AbstractFilesCheck.__init__(self, "InitScriptsCheck", "/etc/init.d/.*")
def check(self, pkg):
if pkg.isSource():
return
files = pkg.files()
bins_list = filter(lambda f: (f.startswith("/usr/bin") \
or f.startswith("/usr/sbin")) and stat.S_ISREG(files[f][0]), files)
for f in files:
enreg = files[f]
mode = enreg[0]
if f in pkg.ghostFiles() or not stat.S_ISREG(mode) or not f.startswith("/etc/init.d/"):
continue
boot_script = f.startswith('/etc/init.d/boot.')
input_f = file(pkg.dirName() + '/' + f, "r")
found_remote_fs = False
for l in input_f:
if l.startswith('# Required-Start') or l.startswith('# Should-Start'):
for dep in l.split()[2:]:
if dep.startswith('$') and dep not in ('$local_fs',
'$named',
'$network',
'$portmap',
'$remote_fs',
'$syslog',
'$time', '$ALL'):
printError(pkg, "init-script-undefined-dependency", f, dep)
if dep in ('portmap', 'syslog', 'named', 'network', 'xntpd'):
printWarning(pkg, "init-script-non-var-dependency", f, dep)
if dep in ('$remote_fs'):
found_remote_fs = True
if l.startswith('# X-UnitedLinux-Should'):
printWarning(pkg, "obsolete-init-keyword", f, l)
if l.startswith('# Default-Start'):
for dep in l.split()[2:]:
if boot_script and dep not in ('B', 'S'):
printError(pkg, "init-script-wrong-start-level", f, dep)
if not boot_script and dep in ('B'):
printError(pkg, "init-script-wrong-start-level", f, dep)
if not found_remote_fs and bins_list:
printWarning(pkg, "non-remote_fs-dependency", f)
check=InitScriptsCheck()
if Config.info:
addDetails(
'init-script-undefined-dependency',
"""Your package contains a /etc/init.d script that specifies a
dependency that is not listed in /etc/insserv.conf. Check for
typos.""",
'init-script-non-var-dependency',
"""Your package contains a /etc/init.d script that specifies
a hardcoded dependency that likely should be a variable dependency.
For example portmap should actually be $portmap, and similar.""",
'obsolete-init-keyword',
"""Your package contains a /etc/init.d script that specifies
an obsolete keyword, like X-UnitedLinux-Should-Start. Consider
using the LSB equivalent Should-Start instead.""",
'init-script-wrong-start-level',
"""Your package contains a /etc/init.d script that specifies
that it should be run in boot level but isn't named with a boot prefix
or specifies a non-boot level but has boot prefix. Fix your script.""",
'non-remote_fs-dependency',
"""Your package contains a /etc/init.d script that does not specify
$remote_fs as a start dependency, but the package also contains
files packaged in /usr. Make sure that your start script does not
call any of them, or add the missing $remote_fs dependency."""
)

43
CheckPkgConfig.py Normal file
View File

@ -0,0 +1,43 @@
# vim:sw=4:et
#---------------------------------------------------------------
# Module : rpmlint
# File : CheckPkgConfig
# Author : Stephan Kulow, Dirk Mueller
# Purpose : Check for errors in Pkgconfig files
#---------------------------------------------------------------
from Filter import *
import AbstractCheck
import rpm
import re
import commands
import Config
import os
class PkgConfigCheck(AbstractCheck.AbstractFilesCheck):
def __init__(self):
AbstractCheck.AbstractFilesCheck.__init__(self, "PkgConfigCheck", ".*/pkgconfig/.*\.pc$")
# currently causes too many failures (2008-03-05)
#self.suspicious_dir=re.compile('(?:/usr/src/\w+/BUILD|/var/tmp|/tmp|/home|\@\w{1,50}\@)')
self.suspicious_dir=re.compile('(?:/usr/src/\w+/BUILD|/var/tmp|/tmp|/home)')
def check_file(self, pkg, filename):
if pkg.isSource():
return
if pkg.grep(self.suspicious_dir, filename):
printError(pkg, "invalid-pkgconfig-file", filename)
check=PkgConfigCheck()
if Config.info:
addDetails(
'invalid-pkgconfig-file',
'''Your .pc file appears to be invalid. Possible causes are:
- it contains traces of $RPM_BUILD_ROOT or $RPM_BUILD_DIR.
- it contains unreplaced macros (@have_foo@)
- it references invalid paths (e.g. /home or /tmp)
Please double-check and report false positives.
'''
)

View File

@ -0,0 +1,44 @@
# vim:sw=4:et
#---------------------------------------------------------------
# Module : rpmlint
# File : DesktopTranslationCheck.py
# Author : Dirk Mueller
# Purpose : Check for untranslated desktop files
#---------------------------------------------------------------
from Filter import *
import AbstractCheck
import rpm
import re
import commands
import Config
desktop_re=re.compile('(services|applets)/.*\.desktop$')
class DesktopCheck(AbstractCheck.AbstractFilesCheck):
def __init__(self):
AbstractCheck.AbstractFilesCheck.__init__(self, "DesktopCheck", ".*\.desktop$")
def check_file(self, pkg, filename):
if pkg.isSource() or filename in pkg.ghostFiles():
return
try:
f = open(pkg.dirName() + '/' + filename)
except Exception, e:
printWarning(pkg, "read-error", e)
return 0
for line in f:
if line.startswith('X-SuSE-translate='):
return
printWarning(pkg, "untranslated-desktop-file", filename)
check=DesktopCheck()
if Config.info:
addDetails(
'untranslated-desktop-file',
"""Your desktop file hasn't been handled by suse_update_desktop.sh.
Please use it to make the desktop file translate-able by Novell translations."""
)

107
DuplicatesCheck.py Normal file
View File

@ -0,0 +1,107 @@
# vim:sw=4:et
#############################################################################
# File : DuplicatesCheck.py
# Package : rpmlint
# Author : Stephan Kulow
# Purpose : Check for duplicate files being packaged separately
#############################################################################
from Filter import *
import AbstractCheck
import rpm
import re
import commands
import stat
import Config
import os
import string
def get_prefix(file):
pathlist = string.split(file, '/')
if len(pathlist) == 3:
return "/".join(pathlist[0:2])
return "/".join(pathlist[0:3])
class DuplicatesCheck(AbstractCheck.AbstractCheck):
def __init__(self):
self.map = []
AbstractCheck.AbstractCheck.__init__(self, "DuplicatesCheck")
def check(self, pkg):
if pkg.isSource():
return
md5s = {}
sizes = {}
files = pkg.files()
configFiles = pkg.configFiles()
for f in files:
if f in pkg.ghostFiles():
continue
enreg = files[f]
mode = enreg[0]
links = enreg[3]
size = enreg[4]
md5 = enreg[5]
rdev = enreg[7]
if not stat.S_ISREG(mode):
continue
md5s.setdefault(md5, set()).add(f)
sizes[md5] = size
#print f, links, size, md5, rdev
sum=0
for f in md5s:
duplicates=md5s[f]
if len(duplicates) == 1: continue
one=duplicates.pop()
one_is_config = False
if one in configFiles:
one_is_config = True
partition=get_prefix(one)
st = os.stat(pkg.dirName() + '/' + one)
diff = 1 + len(duplicates) - st[stat.ST_NLINK]
if diff <= 0:
for dupe in duplicates:
if partition != get_prefix(dupe):
printError(pkg,"hardlink-across-partition",one,dupe)
if one_is_config and dupe in configFiles:
printError(pkg,"hardlink-across-config-files",one,dupe)
continue
for dupe in duplicates:
if partition != get_prefix(dupe):
diff = diff - 1
sum += sizes[f] * diff
if sizes[f] and diff > 0:
printWarning(pkg, 'files-duplicate', one,":".join(duplicates))
if sum > 100000:
printError(pkg, 'files-duplicated-waste', sum)
check=DuplicatesCheck()
if Config.info:
addDetails(
'files-duplicated-waste',
"""Your package contains duplicated files that are not hard- or symlinks.
You should use the %fdupes macro to link the files to one.""",
'hardlink-across-partition',
"""Your package contains two files that are apparently hardlinked and
that are likely on different partitions. Installation of such an RPM will fail
due to RPM being unable to unpack the hardlink. do not hardlink across
the first two levels of a path, e.g. between /srv/ftp and /srv/www or
/etc and /usr. """,
'hardlink-across-config-files',
"""Your package contains two config files that are apparently hardlinked.
Hardlinking a config file is probably not what you want. Please double
check and report false positives."""
)

612
LibraryPolicyCheck.py Normal file
View File

@ -0,0 +1,612 @@
# vim:sw=4:et
#############################################################################
# File : LibraryPolicyCheck.py
# Package : rpmlint
# Author : Richard Guenther
# Purpose : Verify shared library packaging policy rules
#############################################################################
from Filter import *
import AbstractCheck
import rpm
import re
import commands
import stat
import Config
import os
import string
import Pkg
_policy_legacy_exceptions = (
"libacl1",
"libaio1",
"libakode_mpeg_decoder",
"libalut0",
"libamso-rdmav2",
"libapr-1-0",
"libapr_dbd_mysql",
"libapr_dbd_pgsql",
"libapr_dbd_sqlite3",
"libaprutil-1-0",
"libapt-pkg-libc6_6-6-2",
"libart_lgpl_2-2",
"libartskde1",
"libatm1",
"libattr1",
"libauthldap0",
"libauthmysql0",
"libauthpgsql0",
"libauthpipe0",
"libauthuserdb0",
"libbluetooth2",
"libcairo2",
"libcairomm-1_0-1",
"libcap1",
"libcasakwallet1",
"libc-client2006c1_suse",
"libccrtp1-1_5-0",
"libcdaudio1",
"libcdk4",
"libcheck0",
"libchewing3",
"libchm0",
"libclalsadrv1",
"libclthreads2",
"libclucene0",
"libclxclient3",
"libcole2",
"libcppunit-1_10-2",
"libdar4",
"libdbh-4_5-4",
"libdb_java-4_3",
"libdbus-glib-1-2",
"libdbus-qt-1-1",
"libdc0",
"libdm0",
"libdns_sd1",
"libdrm2",
"libdts0",
"libdvdcss2",
"libdvdnav4",
"libebml0",
"libefence0",
"libEMF1",
"libevent-1_3b1",
"libevolutionglue",
"libexif12",
"libexif9",
"libexif-gtk4",
"libexiv2-0",
"libf2c0",
"libffi4",
"libflaim5_2",
"libFnlib0",
"libfontenc1",
"libfreebob0",
"libfreeradius-client2",
"libfreetype6",
"libftgl0",
"libg2banking2",
"libg2c0",
"libgadu3",
"libgalago3",
"libgalago-gtk1",
"libganglia1",
"libgcc_s1",
"libgcc_s4", # only for hppa
"libgconfmm-2_6-1",
"libgdome0",
"libghttp1",
"libgif4",
"libgimpprint1",
"libgfortran1", # gcc41
"libglade-2_0-0",
"libgladesharpglue-2",
"libgle3",
"libglibsharpglue-2",
"libgltt0",
"libglut3",
"libGLw1",
"libgmcop1",
"libgnet-2_0-0",
"libgnomecanvasmm-2_6-1",
"libgnomecanvaspixbuf1",
"libgnomecups-1_0-1",
"libgnome-keyring0",
"libgnomemm-2_6-1",
"libgnomeprintui-2-2-0",
"libgnomesharpglue-2",
"libgnomeuimm-2_6-1",
"libgomp1",
"libgsfglue",
"libgsf-gnome-1-114",
"libgssapi2",
"libgtkgl4",
"libgtkhtml-2-0",
"libgtksourceview-1_0-0",
"libgtkspell0",
"libgtkxmhtml1",
"libhandle1",
"libhangul0",
"libHermes1",
"libibcm1",
"libibverbs1",
"libICE6",
"libid3-3_8-3",
"libid3tag0",
"libIDL-2-0",
"libidmef0",
"libidn11",
"libiec61883-0",
"libilbc0",
"libind_helper0",
"libiniparser0",
"libInternalSymbols1",
"libipathverbs-rdmav2",
"libiterm1",
"libjackasyn0",
"libjasper1",
"libJNIChangeHat1",
"libjpeg62",
"libkakasi2",
"libkbanking1",
"libkcddb5",
"libkcompactdisc1",
"libkdegames5",
"libkexiv2-1",
"libkeyutils1",
"libkonq5",
"libksba8",
"libkscan1",
"libktoblzcheck1",
"libkxmleditorpart1",
"liblash2",
"libldapcpp0",
"liblite0",
"liblo0",
"libloudmouth-1-0",
"libltdl3",
"liblua5_1",
"liblzo2-2",
"libmad0",
"libmal0",
"libmatroska0",
"libmcrypt4",
"libmdbodbc0",
"libmeanwhile1",
"libmemcache0",
"libmhash2",
"libmikmod2",
"libmng1",
"libmono-profiler-heap-buddy0",
"libmp3lame0",
"libmpcdec3",
"libmpeg-0_3_0", # kdemultimedia3-mad
"libmsrpc0",
"libmthca-rdmav2",
"libnasl2",
"libneon24",
"libnet0",
"libnet6-1_3-0",
"libnfsidmap0",
"libnl1",
"libnm_glib0",
"libnm-novellvpn-properties0",
"libnm-openvpn-properties0",
"libnm-vpnc-properties0",
"libnscd1",
"libnvtvsimple0",
"libobby-0_4-0",
"libobjc1",
"libobjc2",
"libodbcinstQ1",
"liboggz1",
"liboil-0_3-0",
"libol-0_3_18",
"liboop4",
"libopal2_2",
"libopenal0",
"libopencdk8",
"libopenobex1",
"libopenobex-glib1",
"libotf0",
"libparagui-1_0-0",
"libpathan3",
"libpcap0",
"libpcd2",
"libpgeasy3",
"libpoppler1",
"libpopt0",
"libportaudio2",
"libpowersave11",
"libpq++4",
"libpri1_0",
"libPropList0",
"libpt1_10",
"libpth20",
"libpythonize0",
"libqainternal0",
"libqainternalperl0",
"libqca1",
"libqnotify0",
"libqscintilla6",
"libQt3Support4",
"libqtc1",
"libQtDBus4",
"libqtsharp0",
"libQtSql4",
"librdf0",
"librekall_driver_xbase245",
"librekall_driver_sqlite3-245",
"librekall_driver_pgsql245",
"librekall_driver_mysql245",
"librdmacm1",
"librlog1",
"librpcsecgss3",
"librsync1",
"libsamplerate0",
"libsax7",
"libSDL-1_2-0",
"libSDL_gfx0",
"libSDL_image-1_2-0",
"libSDLmm-0_1-8",
"libSDL_net-1_2-0",
"libSDL_Pango1",
"libSDL_ttf-2_0-0",
"libsecprog0",
"libserdisp1",
"libsexy2",
"libsigc-1_2-5",
"libsigc-2_0-0",
"libSM6",
"libsmbclient0",
"libsmbios1",
"libsmbiosxml1",
"libsmbsharemodes0",
"libsmi2",
"libsndfile1",
"libsoup-2_2-8",
"libspandsp0",
"libspeex1",
"libstartup-notification-1-0",
"libstdc++5",
"libstdc++6",
"libstroke0",
"libstunnel",
"libsvg1",
"libsvg-cairo1",
"libswfdec-0_4-2",
"libsynaptics0",
"libsysfs2",
"libtclsqlite3-0",
"libtelepathy2",
"libthai0",
"libthinkfinger0",
"libtidy-0_99-0",
"libtomoe-gtk0",
"libtonezone1_0",
"libtre4",
"libutempter0",
"libvirt0",
"libvisual-0_4-0",
"libvolume_id0",
"libvtesharpglue-2",
"libwnck-1-18",
"libwnn1",
"libwv2-1",
"libwx_gtk2u_gl-2_8-0",
"libx86-1",
"libXau6",
"libxclass0_9_2",
"libxcrypt1",
"libXdmcp6",
"libXext6",
"libxfce4util4",
"libxfcegui4-4",
"libXfixes3",
"libxflaim3_2",
"libXiterm1",
"libxkbfile1",
"libxklavier11",
"libxml1",
"libxml2-2",
"libxml++-2_6-2",
"libXp6",
"libXprintUtil1",
"libxquery-1_2",
"libXrender1",
"libXt6",
"libXv1",
"libxvidcore4",
"liby2storage2",
"liby2util3",
"libz1",
"libzio0",
"libzrtpcpp-0_9-0",
)
_essential_dependencies = (
"ld-linux.so.2",
"libacl.so.1",
"libanl.so.1",
"libanonymous.so.2",
"libattr.so.1",
"libaudit.so.0",
"libauparse.so.0",
"libBrokenLocale.so.1",
"libbz2.so.1",
"libcidn.so.1",
"libck-connector.so.0",
"libcom_err.so.2",
"libcrack.so.2",
"libcrypto.so.0.9.8",
"libcrypt.so.1",
"libc.so.6",
"libdbus-1.so.3",
"libdbus-glib-1.so.2",
"libdes425.so.3",
"libdl.so.2",
"libexpat.so.1",
"libform.so.5",
"libformw.so.5",
"libgcc_s.so.1",
"libgcrypt.so.11",
"libgdbm_compat.so.3",
"libgdbm.so.3",
"libgio-2.0.so.0",
"libglib-2.0.so.0",
"libgmodule-2.0.so.0",
"libgobject-2.0.so.0",
"libgpg-error.so.0",
"libgssapi_krb5.so.2",
"libgssrpc.so.4",
"libgthread-2.0.so.0",
"libhal.so.1",
"libhal-storage.so.1",
"libhd.so.14",
"libhistory.so.5",
"libk5crypto.so.3",
"libkadm5clnt.so.5",
"libkadm5srv.so.5",
"libkdb5.so.4",
"libkeyutils.so.1",
"libkrb4.so.2",
"libkrb5.so.3",
"libkrb5support.so.0",
"libksba.so.8",
"liblber-2.4.so.2",
"libldap-2.4.so.2",
"libldap_r-2.4.so.2",
"liblogin.so.2",
"liblog_syslog.so.1",
"libltdl.so.3",
"libmagic.so.1",
"libmenu.so.5",
"libmenuw.so.5",
"libm.so.6",
"libncurses.so.5",
"libncursesw.so.5",
"libnscd.so.1",
"libnsl.so.1",
"libnss_compat.so.2",
"libnss_dns.so.2",
"libnss_files.so.2",
"libnss_hesiod.so.2",
"libnss_nisplus.so.2",
"libnss_nis.so.2",
"libopenct.so.1",
"libopensc.so.2",
"libpamc.so.0",
"libpam_misc.so.0",
"libpam.so.0",
"libpanel.so.5",
"libpanelw.so.5",
"libparted-1.8.so.8",
"libpcrecpp.so.0",
"libpcreposix.so.0",
"libpcre.so.0",
"libpcsclite.so.1",
"libpkcs15init.so.2",
"libpolkit-dbus.so.2",
"libpolkit-grant.so.2",
"libpolkit.so.2",
"libpopt.so.0",
"libpthread.so.0",
"libpth.so.20",
"libreadline.so.5",
"libresmgr.so.0.9.8",
"libresmgr.so.1",
"libresolv.so.2",
"librt.so.1",
"libsasl2.so.2",
"libsasldb.so.2",
"libscconf.so.2",
"libslp.so.1",
"libsmbios.so.1",
"libssl.so.0.9.8",
"libss.so.2",
"libstdc++.so.6",
"libthread_db.so.1",
"libtic.so.5",
"libusb-0.1.so.4",
"libusbpp-0.1.so.4",
"libutil.so.1",
"libuuid.so.1",
"libvolume_id.so.0",
"libwrap.so.0",
"libX11.so.6",
"libX11-xcb.so.1",
"libXau.so.6",
"libxcb-composite.so.0",
"libxcb-damage.so.0",
"libxcb-dpms.so.0",
"libxcb-glx.so.0",
"libxcb-randr.so.0",
"libxcb-record.so.0",
"libxcb-render.so.0",
"libxcb-res.so.0",
"libxcb-screensaver.so.0",
"libxcb-shape.so.0",
"libxcb-shm.so.0",
"libxcb.so.1",
"libxcb-sync.so.0",
"libxcb-xevie.so.0",
"libxcb-xf86dri.so.0",
"libxcb-xfixes.so.0",
"libxcb-xinerama.so.0",
"libxcb-xlib.so.0",
"libxcb-xprint.so.0",
"libxcb-xtest.so.0",
"libxcb-xvmc.so.0",
"libxcb-xv.so.0",
"libxcrypt.so.1",
"libzio.so.0",
"libz.so.1",
)
from BinariesCheck import BinaryInfo
def libname_from_soname (soname):
libname = string.split(soname, '.so.')
if len(libname) == 2:
if libname[0][-1:].isdigit():
libname = string.join(libname, '-')
else:
libname = string.join(libname, '')
else:
libname = soname[:-3]
libname = libname.replace('.', '_')
return libname
class LibraryPolicyCheck(AbstractCheck.AbstractCheck):
def __init__(self):
self.map = []
AbstractCheck.AbstractCheck.__init__(self, "LibraryPolicyCheck")
def check(self, pkg):
global _policy_legacy_exceptions
if pkg.isSource():
return
# Only check unsuffixed lib* packages
if pkg.name.endswith('-devel') or pkg.name.endswith('-doc'):
return
files = pkg.files()
# Search for shared libraries in this package
libs = set()
libs_needed = set()
dirs = set()
reqlibs = set()
pkg_requires = set(map(lambda x: string.split(x[0],'(')[0], pkg.requires()))
for f in files:
if f.find('.so.') != -1 or f.endswith('.so'):
filename = pkg.dirName() + '/' + f
try:
if stat.S_ISREG(files[f][0]):
bi = BinaryInfo(pkg, filename, f, 0)
libs_needed = libs_needed.union(bi.needed)
if bi.soname != 0:
libs.add(bi.soname)
dirs.add(string.join(f.split('/')[:-1], '/'))
if bi.soname in pkg_requires:
# But not if the library is used by the pkg itself
# This avoids program packages with their own private lib
# FIXME: we'd need to check if somebody else links to this lib
reqlibs.add(bi.soname)
except:
pass
pass
std_dirs = dirs.intersection(('/lib', '/lib64', '/usr/lib', '/usr/lib64',
'/opt/kde3/lib'))
# If this is a program package (all libs it provides are
# required by itself), bail out
if not pkg.name.startswith("lib") and len(libs.difference(reqlibs)) == 0:
return
# If this package should be or should be splitted into shlib
# package(s)
if len(libs) > 0 and len(std_dirs) > 0:
# If the package contains a single shlib, name after soname
if len(libs) == 1:
soname = libs.copy().pop()
libname = libname_from_soname (soname)
if libname.startswith('lib') and pkg.name != libname:
if libname in _policy_legacy_exceptions:
printWarning(pkg, 'shlib-legacy-policy-name-error', libname)
else:
printError(pkg, 'shlib-policy-name-error', libname)
elif not pkg.name[-1:].isdigit():
printError(pkg, 'shlib-policy-missing-suffix')
if (not pkg.name.startswith('lib')) or pkg.name.endswith('-lang'):
return
if not libs:
if pkg.name in _policy_legacy_exceptions:
printWarning(pkg, 'shlib-legacy-policy-missing-lib', pkg.name)
else:
printError(pkg, 'shlib-policy-missing-lib')
# Verify no non-lib stuff is in the package
dirs = set()
for f in files:
if os.path.isdir(pkg.dirName()+f):
dirs.add(f)
# Verify non-lib stuff does not add dependencies
if libs:
for dep in pkg_requires.difference(_essential_dependencies):
if dep.find('.so.') != -1 and not dep in libs and not dep in libs_needed:
printError(pkg, 'shlib-policy-excessive-dependency', dep)
# Check for non-versioned directories beyond sysdirs in package
sysdirs = [ '/lib', '/lib64', '/usr/lib', '/usr/lib64',
'/usr/share/doc/packages', '/usr/share' ]
cdirs = set()
for sysdir in sysdirs:
done = set()
for dir in dirs:
if dir.startswith(sysdir + '/'):
ssdir = string.split(dir[len(sysdir)+1:],'/')[0]
if not ssdir[-1].isdigit():
cdirs.add(sysdir+'/'+ssdir)
done.add(dir)
dirs = dirs.difference(done)
map(lambda dir: printError(pkg, 'shlib-policy-nonversioned-dir', dir), cdirs)
check=LibraryPolicyCheck()
if Config.info:
addDetails(
'shlib-policy-missing-suffix',
"""Your package containing shared libraries does not end in a digit and
should probably be split.""",
'shlib-policy-devel-file',
"""Your shared library package contains development files. Split them into
a -devel subpackage.""",
'shlib-policy-name-error',
"""Your package contains a single shared library but is not named after its SONAME.""",
'shlib-policy-nonversioned-dir',
"""Your shared library package contains non-versioned directories. Those will not
allow to install multiple versions of the package in parallel.""",
'shlib-legacy-policy-name-error',
"""Your shared library package is not named after its SONAME, but it has been added to the list
of legacy exceptions. Please do ot rename the package until SONAME changes, but if you have
to rename it for another reason, make sure you name it correctly.""",
'shlib-policy-excessive-dependency',
"""Your package starts with 'lib' as part of it's name, but also contains binaries
that have more dependencies than those that already required by the libraries.
Those binaries should probably not be part of the library package, but split into
a seperate one to reduce the additional dependencies for other users of this library.""",
'shlib-policy-missing-lib',
"""Your package starts with 'lib' as part of it's name, but does not provide
any libraries. It must not be called a lib-package then. Give it a more
sensible name."""
)

155
add-scoring-support.diff Normal file
View File

@ -0,0 +1,155 @@
--- Config.py
+++ Config.py
@@ -126,6 +126,17 @@
else:
_filters_re = None
+_scoring={}
+
+def setBadness(s, score):
+ _scoring[s] = score
+ setOption('UseBadness', True)
+
+def badness(s):
+ if _scoring.has_key(s):
+ return _scoring[s]
+ return 0
+
_non_named_group_re = re.compile('[^\\](\()[^:]')
def isFiltered(s):
global _filters
--- Filter.py
+++ Filter.py
@@ -11,19 +11,27 @@
import Config
import Testing
+_badness_score = 0
+_diagnostic = list()
+
def printInfo(pkg, reason, *details):
- if _print("I", pkg, reason, details) and Config.info:
- printDescriptions(reason)
+ _print("I", pkg, reason, details)
def printWarning(pkg, reason, *details):
- if _print("W", pkg, reason, details) and Config.info:
- printDescriptions(reason)
+ _print("W", pkg, reason, details)
def printError(pkg, reason, *details):
- if _print("E", pkg, reason, details) and Config.info:
- printDescriptions(reason)
+ _print("E", pkg, reason, details)
def _print(type, pkg, reason, details):
+ global _badness_score, _diagnostic
+
+ badness = Config.badness(reason)
+ if Config.getOption('UseBadness'):
+ type = "W"
+ if badness:
+ type = "E"
+
ln = ""
if pkg.current_linenum is not None:
ln = "%s:" % pkg.current_linenum
@@ -31,14 +39,16 @@
if pkg.arch is not None:
arch = ".%s" % pkg.arch
s = "%s%s:%s %s: %s" % (pkg.name, arch, ln, type, reason)
+ if badness:
+ s = s + " (Badness: %d)" % badness
for d in details:
s = s + " %s" % d
if Testing.isTest():
Testing.addOutput(s)
else:
if not Config.isFiltered(s):
- sys.stdout.write(s)
- sys.stdout.write("\n")
+ _diagnostic.append(s + "\n")
+ _badness_score += badness
return 1
return 0
@@ -52,12 +62,56 @@
except KeyError:
pass
+def _diag_compare(x,y):
+
+ where_a = x.split()[2]
+ level_a = x.split()[1]
+
+ where_b = y.split()[2]
+ level_b = y.split()[1]
+
+ if (level_b > level_a):
+ return 1
+
+ if (level_b < level_a):
+ return -1
+
+ if (where_b < where_a):
+ return 1
+
+ if (where_b > where_a):
+ return -1
+
+ return 0
+
+def printAllReasons():
+ global _badness_score, _diagnostic
+ _diagnostic.sort(_diag_compare)
+ last_reason=''
+ for diag in _diagnostic:
+ if Config.info:
+ reason = diag.split()[2]
+ if reason != last_reason:
+ if len(last_reason):
+ printDescriptions(last_reason)
+ last_reason=reason
+ sys.stdout.write(diag)
+ if Config.info and len(last_reason):
+ printDescriptions(last_reason)
+ _diagnostic = list()
+ return _badness_score > 1000
+
_details={}
def addDetails(*details):
for idx in range(len(details)/2):
_details[details[idx*2]]=details[idx*2+1]
+def BadnessScore():
+ global _badness_score
+
+ return _badness_score
+
# Filter.py ends here
# Local variables:
--- README
+++ README
@@ -79,6 +79,7 @@
FilesCheck.py
SystemLibPaths list of strings ('/lib', '/usr/lib', '/usr/X11R6/lib')
UseBzip2 boolean 1
+UseBadness boolean 0
UseDefaultRunlevels boolean 1
UseEpoch boolean 0
UseIndexedJars boolean 1
--- rpmlint.py
+++ rpmlint.py
@@ -146,6 +146,10 @@
sys.stderr.write('Interrupted, exiting while scanning all packages\n')
sys.exit(2)
+ if printAllReasons():
+ sys.stdout.write('RPMLINT: E: BADNESS is %d - threshold exceeded. aborting the build.\n' % BadnessScore() )
+ sys.exit(1)
+
finally:
pkg and pkg.cleanup()

14
better-wrong-script.diff Normal file
View File

@ -0,0 +1,14 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -1403,7 +1403,10 @@
executed.''',
'wrong-script-interpreter',
-'''This script uses an incorrect interpreter.''',
+'''This script uses an incorrect interpreter. Correct interpreters should
+be an absolute path to a file in in /(s)bin or /usr/(s)bin.
+Alternatively, if the file isn't supposed to be executed, then don't
+mark it as executable. ''',
'non-executable-script',
'''This text file contains a shebang or is located in a path dedicated for

11
buildroot-doc.diff Normal file
View File

@ -0,0 +1,11 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -408,7 +408,7 @@
'hardcoded-path-in-buildroot-tag',
'''A path is hardcoded in your Buildroot tag. It should be replaced
-by something like %{_tmppath}/%name-root.''',
+by %{_tmppath}/%{name}-%{version}-build.''',
'hardcoded-packager-tag',
'''The Packager tag is hardcoded in your spec file. It should be removed, so

36
buildroot-in-scripts.diff Normal file
View File

@ -0,0 +1,36 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -186,7 +186,7 @@
lib = 0
if_depth = 0
ifarch_depth = -1
- current_section = 'package'
+ current_section = 'package'
buildroot_clean={'clean':0 , 'install':0}
buildroot_created={'clean':False , 'install':True}
depscript_override = 0
@@ -196,8 +196,11 @@
section = {}
buildrequires = set()
- for sec in ['description', 'prep', 'build', 'install', 'clean',
- 'files', 'changelog', 'package', 'check']:
+ for sec in ('description', 'prep', 'build', 'install', 'clean',
+ 'files', 'changelog', 'package', 'check',
+ 'pre', 'post', 'postun', 'trigger', 'triggerin',
+ 'triggerprein', 'triggerun', 'triggerpostun',
+ 'pretrans', 'posttrans'):
section[sec] = {
'count': 0,
're': re.compile('^%' + sec + '(?:\s|$)'),
@@ -223,7 +226,9 @@
if section_marker:
continue
- if current_section in ('prep', 'build'):
+ if current_section in ('prep', 'build', 'pre', 'post', 'postun',
+ 'trigger', 'triggerin', 'triggerprein', 'triggerun', 'triggerpostun',
+ 'pretrans', 'posttrans'):
if contains_buildroot(line):
printWarning(pkg, 'rpm-buildroot-usage', '%' + current_section, line[:-1].strip())

View File

@ -0,0 +1,72 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -32,7 +32,7 @@
prefix_regex = re.compile('^Prefix\s*:\s*([^\s]+)', re.IGNORECASE)
packager_regex = re.compile('^Packager\s*:\s*([^\s]+)', re.IGNORECASE)
make_check_regexp = re.compile('(^|\s|%{?__)make}?\s+(check|test)')
-rm_regex = re.compile('(^|\s)((.*/)?rm|%{?__rm}?) ')
+rm_rf_regex = re.compile('(^|\s)((.*/)?rm|%{?__rm}?) -[fF]?[rR][^/]*$')
rpm_buildroot_regex = re.compile('(\\\*)\${?RPM_BUILD_ROOT}?|(%+){?buildroot}?')
configure_start_regex = re.compile('\./configure')
configure_libdir_spec_regex = re.compile('ln |\./configure[^#]*--libdir=([^\s]+)[^#]*')
@@ -119,6 +140,14 @@
return 1
return 0
+def contains_create_buildroot(line):
+ '''Check if the line is of the form mkdir %{buildroot}.'''
+ line = line.strip()
+ if contains_buildroot(line) and line.startswith("mkdir") and \
+ not line.count("-p"):
+ return True
+ return False
+
class SpecCheck(AbstractCheck.AbstractCheck):
def __init__(self):
@@ -160,6 +167,7 @@
ifarch_depth = -1
current_section = 'package'
buildroot_clean={'clean':0 , 'install':0}
+ buildroot_created={'clean':False , 'install':True}
depscript_override = 0
depgen_disabled = 0
indent_spaces = 0
@@ -200,8 +208,13 @@
printWarning(pkg, 'make-check-outside-check-section', line[:-1])
if current_section in buildroot_clean.keys():
- if contains_buildroot(line) and rm_regex.search(line):
+ if buildroot_created[current_section] and \
+ contains_buildroot(line) and rm_rf_regex.search(line):
buildroot_clean[current_section] = 1
+ buildroot_created[current_section] = False
+
+ if contains_create_buildroot(line):
+ buildroot_created[current_section] = True
if ifarch_regex.search(line):
if_depth = if_depth + 1
@@ -337,6 +350,9 @@
if not buildroot_clean[sect]:
printError(pkg, 'no-cleaning-of-buildroot', '%' + sect)
+ if buildroot_clean['install'] and not buildroot_created['install']:
+ printError(pkg, '%install-no-mkdir-buildroot')
+
if not buildroot:
printError(pkg, 'no-buildroot-tag')
@@ -483,6 +499,12 @@
'''You should clean $RPM_BUILD_ROOT in the %clean section and just after the
beginning of %install section. Use "rm -Rf $RPM_BUILD_ROOT".''',
+'%install-no-mkdir-buildroot',
+"""Your install section removes the buildroot but does not create them
+afterwards in a secure way, which allows attackers to trivially play tricks
+with symlinks on you. use mkdir %buildroot (no -p option!) or don't clean
+the buildroot in %install, because that's anyway already done for you by rpm.""",
+
'rpm-buildroot-usage',
'''$RPM_BUILD_ROOT should not be touched during %build or %prep stage, as it
will break short circuiting.''',

View File

@ -0,0 +1,24 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -837,6 +837,8 @@ class FilesCheck(AbstractCheck.AbstractCheck):
logrotate_file=res or logrotate_file
if res and res.group(1) != pkg.name:
printError(pkg, 'incoherent-logrotate-file', f)
+ if (f.startswith('/etc/cron.') or res) and not ('cron' in pkg.requires()):
+ printError(pkg, 'missing-dependency-to-cron', "for logrotate script", f)
link=enreg[3]
if link != '':
ext=compr_regex.search(link)
@@ -1468,6 +1470,12 @@ packaged as arch dependent, or something else. Verify what the case is, and
if there's no way to produce useful debuginfo out of it, disable creation of
the debuginfo package.''',
+'missing-dependency-to-cron',
+'''This package installs a file in /etc/logrotate.d/ or in /etc/cron.*/ but
+doesn't require cron to be installed. as cron is not part of the essential packages,
+your package should explicitely require cron to make sure that your logrotate
+or cron job is executed.''',
+
'read-error',
'''This file could not be read. A reason for this could be that the info about
it in the rpm header indicates that it is supposed to be a readable normal file

227
config Normal file
View File

@ -0,0 +1,227 @@
# -*- python -*-
# Configuration for the rpmlint utility.
# Loaded before ~/.rpmlintrc
# $Id: config,v 1.39 2003/12/22 11:20:55 flepied Exp $
# This line is mandatory to access the configuration functions
from Config import *
# Additionale path to look for checks
#addCheckDir("~/mandrake/rpmlint")
# Configure the checks if you don't want the default ones
allChecks()
addCheck("CheckBuildRoot")
addCheck("CheckExecDocs")
addCheck("CheckPkgConfig")
addCheck("CheckCommonFiles")
addCheck("CheckInitScripts")
addCheck("DesktopTranslationCheck")
addCheck("DuplicatesCheck")
addCheck("LibraryPolicyCheck")
addCheck("CheckIconSizes")
#addCheck("CheckStaticLibraries")
# stuff autobuild takes care about
addFilter(".*invalid-version.*")
addFilter(".*invalid-packager.*")
addFilter(".*not-standard-release-extension.*")
addFilter(".*non-standard-group.*")
addFilter(".*invalid-buildhost.*")
addFilter(".*executable-in-library-package.*")
addFilter(".*non-versioned-file-in-library-package.*")
addFilter(".*incoherent-version-in-name.*")
addFilter(".*invalid-vendor.*")
addFilter(".*invalid-distribution.*")
# Configuration options used by the checks
#setOption("Vendor", "MySelf")
#setOption("Distribution", "MyDistrib")
setOption("UseBzip2", 0)
setOption("UseUTF8", 1)
#setOption("ReleaseExtension", None)
#setOption("ValidGroups", ("Group1", "Group2"))
#setOption("KernelModuleRPMsOK", 0)
setOption('StandardGroups',
('root', 'bin', 'daemon', 'adm', 'lp', 'sync', 'shutdown', 'halt',
'mail', 'news', 'uucp', 'man', 'nobody', 'games', 'disk', 'tty',
'nogroup', 'video', 'www', 'dialout', 'mysql'))
setOption('StandardUsers',
('root', 'bin', 'daemon', 'adm', 'lp', 'sync',
'shutdown', 'halt', 'mail', 'news', 'uucp',
'operator', 'man', 'nobody', 'otrs', 'wnn', 'fax', 'beagleindex',
'asterisk', 'wwwrun', 'games', 'tomcat', 'squid', 'mysql'))
# Output filters
addFilter(".*spurious-bracket-in-.*")
addFilter(".*one-line-command-in-.*")
addFilter(" dir-or-file-in-opt")
addFilter("incoherent-version-in-changelog")
addFilter(" no-signature")
addFilter(" without-chkconfig")
addFilter("unstripped-binary-or-object.*\.ko")
addFilter(" no-chkconfig")
addFilter(" subsys-not-used")
addFilter(" dangerous-command.*")
addFilter(" setuid-binary.*")
addFilter(".*FSSTND-dir-in-var /var/adm/.*")
addFilter("no-url-tag")
addFilter("subdir-in-bin /sbin/conf.d/")
addFilter(" invalid-license")
addFilter(".* nss_db non-standard-dir-in-var db")
addFilter("non-standard-dir-in-usr openwin")
addFilter("ibcs2 non-standard-dir-in-usr i486-sysv4")
addFilter("shlibs5 non-standard-dir-in-usr i486-linux-libc5")
addFilter("filesystem dir-or-file")
addFilter("filesystem hidden-")
addFilter("explicit-lib-dependency libtool")
# suppress any errors about internal packages
addFilter("^qa\S+: [EWI]:")
addFilter("^\S*(?:INTERNAL|internal)\.\S+: [EWI]:")
# exceptions for devel-files
addFilter("devel-file-in-non-devel-package.*/boot/vmlinuz-.*autoconf.h")
addFilter("devel-file-in-non-devel-package.*/usr/src/linux-")
addFilter("devel-file-in-non-devel-package.*/usr/share/systemtap")
addFilter("kde4-kapptemplate\.\S+:.*devel-file-in-non-devel-package")
addFilter("kdesdk3\.\S+:.*devel-file-in-non-devel-package")
addFilter("-(?:examples|doc)\.\S+: \w: devel-file-in-non-devel-package")
addFilter("java\S+-demo\.\S+: \w: devel-file-in-non-devel-package")
addFilter('avr-libc\.\S+: \w: devel-file-in-non-devel-package')
addFilter('dietlibc\.\S+ \w: devel-file-in-non-devel-package')
addFilter('cross-.*devel-file-in-non-devel-package')
addFilter('cmake.*devel-file-in-non-devel-package')
addFilter('gcc\d\d.*devel-file-in-non-devel-package')
addFilter('OpenOffice_org-sdk\.\S+: \w: devel-file-in-non-devel-package')
addFilter('wnn-sdk\.\S+: \w: devel-file-in-non-devel-package')
addFilter('ocaml\.\S+: \w: devel-file-in-non-devel-package')
addFilter('xorg-x11-server-sdk\.\S+: \w: devel-file-in-non-devel-package')
addFilter('linux-kernel-headers\.\S+: \w: devel-file-in-non-devel-package')
addFilter(' devel-file-in-non-devel-package.*-config')
addFilter('libtool\.\S+: \w: devel-file-in-non-devel-package')
addFilter('update-desktop-files\.\S+: \w: untranslated-desktop-file')
addFilter("sdb.* dangling-relative-symlink /usr/share/doc/sdb/.*/gifs ../gifs")
addFilter("kernel-modules-not-in-kernel-packages")
addFilter("configure-without-libdir-spec")
addFilter("conffile-without-noreplace-flag /etc/init.d")
addFilter("use-of-RPM_SOURCE_DIR")
addFilter(" info info-dir-file /usr/share/info/dir")
addFilter("use-tmp-in-")
addFilter("symlink-contains-up-and-down-segments /var/lib/named")
addFilter("no-ldconfig-symlink")
addFilter("aaa_base\.\S+: \w: use-of-home-in-%post")
addFilter("description-line-too-long")
addFilter("hardcoded-library-path")
# addFilter("incoherent-subsys")
# doesn't seem to make sense
addFilter("invalid-ldconfig-symlink")
addFilter("invalid-soname")
addFilter("library-not-linked-against-libc")
addFilter("only-non-binary-in-usr-lib")
addFilter("outside-libdir-files")
# we want these files
addFilter(" perl-temp-file ")
addFilter(" hidden-file-or-dir .*/\.packlist")
addFilter(" hidden-file-or-dir .*/\.directory")
addFilter("perl-.*no-binary")
addFilter(" no-major-in-name ")
# we check for that already
addFilter("dangling-relative-symlink")
addFilter(" lib-package-without-%mklibname")
addFilter(" requires-on-release")
addFilter(" non-executable-script /etc/profile.d/")
addFilter(" init-script-name-with-dot ")
addFilter('.* statically-linked-binary /sbin/ldconfig')
addFilter('.* statically-linked-binary /sbin/init')
addFilter('ldconfig-post.*/ddiwrapper/wine/')
addFilter('glibc\.\S+: \w: statically-linked-binary /usr/sbin/glibc_post_upgrade')
addFilter(" symlink-should-be-relative ")
addFilter(" binary-or-shlib-defines-rpath .*ORIGIN")
addFilter("libzypp.*shlib-policy-name-error.*libzypp")
# stuff that is currently too noisy, but might become relevant in the future
addFilter(" file-not-utf8")
addFilter(" tag-not-utf8")
addFilter(" setup-not-quiet")
addFilter(" no-cleaning-of-buildroot ")
addFilter(" mixed-use-of-spaces-and-tabs ")
addFilter(" prereq-use ")
addFilter(" unversioned-explicit-provides ")
addFilter(" unversioned-explicit-obsoletes ")
addFilter(" no-%clean-section")
addFilter(" service-default-enabled ")
addFilter(" non-standard-dir-perm ")
addFilter(" conffile-without-noreplace-flag ")
addFilter(" non-standard-executable-perm ")
addFilter(" jar-not-indexed ")
addFilter(" non-conffile-in-etc ")
addFilter(" uncompressed-zip ")
addFilter(" %ifarch-applied-patch ")
addFilter(" read-error ")
addFilter(" init-script-without-chkconfig-postin ")
addFilter(" init-script-without-chkconfig-preun ")
addFilter(" postin-without-chkconfig ")
addFilter(" preun-without-chkconfig ")
addFilter(" no-dependency-on locales")
addFilter(" incoherent-version-in-name")
addFilter(" binary-or-shlib-defines-rpath")
addFilter(" executable-marked-as-config-file")
addFilter(" log-files-without-logrotate")
addFilter(" hardcoded-prefix-tag")
addFilter(" no-documentation")
addFilter(" multiple-specfiles")
addFilter(" apache2-naming-policy-not-applied")
addFilter(" no-default-runlevel ")
addFilter(" setgid-binary ")
addFilter(" non-standard-gid ")
addFilter(" non-readable ")
addFilter(" manpage-not-bzipped ")
addFilter(" postin-without-ghost-file-creation ")
# bug 287090
addFilter(" file-in-usr-marked-as-conffile")
addFilter(" non-remote_fs-dependency.*/boot")
# exceptions for non-devel-buildrequires
addFilter(" non-devel-buildrequires apache2-mod_perl")
addFilter(" non-devel-buildrequires ksh")
addFilter(" non-devel-buildrequires perl")
addFilter(" non-devel-buildrequires php5")
addFilter(" non-devel-buildrequires postfix")
addFilter(" non-devel-buildrequires python")
addFilter(" non-devel-buildrequires ruby")
addFilter(" non-devel-buildrequires valgrind")
addFilter(" non-devel-buildrequires yasm")
addFilter("beagle-index\.\S+: \w: (non-devel|unnecessary)-buildrequires")
addFilter("collect-desktop-files\.\S+: \w: (non-devel|unnecessary)-buildrequires")
addFilter("installation-images\.\S+: \w: (non-devel|unnecessary)-buildrequires")
# suboptimal library packaging
addFilter(" non-devel-buildrequires graphviz")
addFilter(" non-devel-buildrequires ImageMagick")
addFilter(" non-devel-buildrequires aspell")
addFilter(" non-devel-buildrequires autotrace")
addFilter(" non-devel-buildrequires gettext")
addFilter(" non-devel-buildrequires devhelp")
addFilter(" non-devel-buildrequires libxml2")
addFilter(" non-devel-buildrequires libxslt")
addFilter(" non-devel-buildrequires recode")
# many places have shorter paths
addFilter(" non-coherent-filename ")
# mandriva specific stuff that we don't want
addFilter(" invalid-build-requires ")
addFilter(" no-provides ")
# config ends here

12
dependency-parsing.diff Normal file
View File

@ -0,0 +1,12 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -90,7 +90,7 @@
elif wantmore:
tmp += ' ' + tok
wantmore = 0
- elif tok[0] in ('=', '<', '>'):
+ elif len(tok) and tok[0] in ('=', '<', '>'):
tmp += ' ' + tok
wantmore = 1
else:

23
description-check.diff Normal file
View File

@ -0,0 +1,23 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -594,6 +594,9 @@ class TagsCheck(AbstractCheck.AbstractCheck):
if use_utf8 and not Pkg.is_utf8_str(description):
printError(pkg, 'tag-not-utf8', '%description')
+ if len(description.partition('Authors:')[0])-4 <= len(summary):
+ printWarning(pkg, 'description-shorter-than-summary')
+
group=pkg[rpm.RPMTAG_GROUP]
if not group:
printError(pkg, 'no-group-tag')
@@ -769,6 +772,10 @@ Name tag.''',
'''The major number of the library isn't included in the package's name.
''',
+'description-shorter-than-summary',
+'''The package description is shorter than the summary. be a bit more
+verbose, please.''',
+
'no-provides',
'''Your library package doesn't provide the -devel name without the major version
included.''',

View File

@ -0,0 +1,15 @@
--- MenuXDGCheck.py
+++ MenuXDGCheck.py
@@ -21,7 +21,11 @@
def check_file(self, pkg, filename):
f = pkg.dirName() + filename
- if getstatusoutput(('desktop-file-validate', f), 1)[0]:
+ st = getstatusoutput(('desktop-file-validate', f), 1)
+ if st[0]:
+ if st[1].find('error:') != -1:
+ printError(pkg, 'invalid-desktopfile', filename, st[1].split('error: ')[1])
+ else:
printError(pkg, 'invalid-desktopfile', filename)
if not is_utf8(f):
printError(pkg, 'non-utf8-desktopfile', filename)

View File

@ -0,0 +1,13 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -282,6 +282,10 @@
# Check if the package is a development package
devel_pkg=devel_regex.search(pkg.name)
+ for p in pkg.provides():
+ if not devel_pkg and devel_regex.search(p[0]):
+ devel_pkg = True
+
config_files=pkg.configFiles()
ghost_files=pkg.ghostFiles()
doc_files=pkg.docFiles()

10
disable-menu-check.diff Normal file
View File

@ -0,0 +1,10 @@
--- Config.py
+++ Config.py
@@ -18,7 +18,6 @@ DEFAULT_CHECKS=("DistributionCheck",
"DocFilesCheck",
"FHSCheck",
"I18NCheck",
- "MenuCheck",
"PostCheck",
"InitScriptCheck",
"SourceCheck",

31
docdata-examples.diff Normal file
View File

@ -0,0 +1,31 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -651,6 +651,7 @@
bin_regex=re.compile('^(/usr)?/s?bin/')
includefile_regex=re.compile('\.(c|h|a|cmi)$')
buildconfigfile_regex=re.compile('(\.pc|/bin/.+-config)$')
+docdir_examples_regex=re.compile('^/usr/(?:share/doc/packages|lib(?:64))/[^/]+/(?:example|demo|script|contrib)')
sofile_regex=re.compile('/lib(64)?(?:/.+)?/lib[^/]+\.so$')
devel_regex=re.compile('(.*)-(debug(info)?|devel|source|static)$')
debuginfo_package_regex=re.compile('-debug(info)?$')
@@ -990,7 +991,7 @@
compr_regex.search(f) or \
includefile_regex.search(f) or \
logrotate_regex.search(f)
- if nonexec_file:
+ if nonexec_file and not docdir_examples_regex.search(f):
printWarning(pkg, 'spurious-executable-perm', f)
elif f.startswith('/etc/'):
if not f in config_files and not f in ghost_files:
@@ -1289,7 +1290,10 @@
'spurious-executable-perm',
'''The file is installed with executable permissions, but was identified as one
that probably should not be executable. Verify if the executable bits are
-desired, and remove if not.''',
+desired, and remove if not.
+NOTE: example scripts should be packaged under %docdir/examples, which will avoid
+this warning.
+''',
'world-writable',
'''A file or directory in the package is installed with world writable

11
fix-buildroot-test.diff Normal file
View File

@ -0,0 +1,11 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -28,7 +28,7 @@
applied_patch_p_regex = re.compile("-P\s*([\d]*)")
source_dir_regex = re.compile("^[^#]*(\$RPM_SOURCE_DIR|%{?_sourcedir}?)")
obsolete_tags_regex = re.compile("^(Copyright|Serial)\s*:\s*([^\s]+)")
-buildroot_regex = re.compile('Buildroot\s*:\s*([^\s]+)', re.IGNORECASE)
+buildroot_regex = re.compile('^\s*Buildroot\s*:\s*([^\s]+)', re.IGNORECASE)
prefix_regex = re.compile('^Prefix\s*:\s*([^\s]+)', re.IGNORECASE)
packager_regex = re.compile('^Packager\s*:\s*([^\s]+)', re.IGNORECASE)
make_check_regexp = re.compile('(^|\s|%{?__)make}?\s+(check|test)')

40
fix-patch-detection.diff Normal file
View File

@ -0,0 +1,40 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -24,8 +24,8 @@
DEFAULT_HARDCODED_LIB_PATH_EXCEPTIONS = '/lib/(modules|cpp|perl5|rpm|hotplug|firmware)($|[\s/,])'
patch_regex = re.compile("^Patch(\d*)\s*:\s*([^\s]+)", re.IGNORECASE)
-# TODO: http://rpmlint.zarb.org/cgi-bin/trac.cgi/ticket/59
-applied_patch_regex = re.compile("^%patch.*-P\s+(\d+)|^%patch(\d*)\s")
+applied_patch_regex = re.compile("^\s*%patch(\d*)")
+applied_patch_p_regex = re.compile("-P\s*([\d]*)")
source_dir_regex = re.compile("^[^#]*(\$RPM_SOURCE_DIR|%{?_sourcedir}?)")
obsolete_tags_regex = re.compile("^(Copyright|Serial)\s*:\s*([^\s]+)")
buildroot_regex = re.compile('Buildroot\s*:\s*([^\s]+)', re.IGNORECASE)
@@ -147,8 +147,8 @@
def check_spec(self, pkg, spec_lines):
patches = {}
- applied_patches = []
- applied_patches_ifarch = []
+ applied_patches = set()
+ applied_patches_ifarch = set()
source_dir = None
buildroot = 0
configure = 0
@@ -230,10 +230,11 @@
else:
res = applied_patch_regex.search(line)
if res:
- pnum = int(res.group(1) or res.group(2) or 0)
- applied_patches.append(pnum)
- if ifarch_depth > 0:
- applied_patches_ifarch.append(pnum)
+ for tmp in applied_patch_p_regex.findall(line) or [res.group(1)]:
+ pnum=int(tmp or 0)
+ applied_patches.add(pnum)
+ if ifarch_depth > 0:
+ applied_patches_ifarch.add(pnum)
elif not source_dir:
res = source_dir_regex.search(line)
if res:

26
fix-versioned-prereq.diff Normal file
View File

@ -0,0 +1,26 @@
--- Pkg.py
+++ Pkg.py
@@ -403,10 +403,19 @@
current_version=d[1]
if current_version.find(':') > 0:
current_version=''.join(current_version.split(':')[1:])
- if d[2] & rpm.RPMSENSE_EQUAL != rpm.RPMSENSE_EQUAL or current_version != version:
- return 0
- else:
- return 1
+
+ if d[2] & rpm.RPMSENSE_EQUAL:
+ if current_version == version:
+ return 1
+
+ if d[2] & rpm.RPMSENSE_GREATER:
+ if current_version.count('.') > version.count('.'):
+ current_version = '.'.join(current_version.split('.')[0:version.count('.')])
+
+ if current_version == version:
+ return 1
+
+ return 0
return 0
def conflicts(self):

View File

@ -0,0 +1,12 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -948,7 +948,8 @@
printWarning(pkg, 'non-executable-in-bin', f, oct(perm))
if not devel_pkg and (includefile_regex.search(f) or buildconfigfile_regex.search(f)) and not is_doc:
printWarning(pkg, 'devel-file-in-non-devel-package', f)
- if mode & 0444 != 0444 and perm & 07000 == 0 and f[0:len('/var/log')] != '/var/log':
+ if mode & 0444 != 0444 and perm & 07000 == 0 and \
+ not f.startswith('/var/log/') and not f.startswith('/etc/'):
printError(pkg, 'non-readable', f, oct(perm))
if size == 0 and not normal_zero_length_regex.search(f) and f not in ghost_files:
printError(pkg, 'zero-length', f)

View File

@ -0,0 +1,93 @@
--- PostCheck.py
+++ PostCheck.py
@@ -33,7 +33,7 @@
# shells that grok the -n switch for debugging
syntaxcheck_shells = ('/bin/sh', '/bin/bash')
-percent_regex = re.compile('%{?\w{3,}', re.MULTILINE)
+percent_regex = re.compile('^[^#]*%{?\w{3,}', re.MULTILINE)
bracket_regex=re.compile('^[^#]*if.*[^ :\]]\]', re.MULTILINE)
home_regex=re.compile('[^a-zA-Z]+~/|\${?HOME(\W|$)', re.MULTILINE)
dangerous_command_regex=re.compile("(^|[;\|`]|&&|$\()\s*(?:\S*/s?bin/)?(cp|mv|ln|tar|rpm|chmod|chown|rm|cpio|install|perl|userdel|groupdel)\s", re.MULTILINE)
@@ -44,14 +44,48 @@
menu_regex=re.compile('^/usr/lib/menu/|^/etc/menu-methods/|^/usr/share/applications/')
bogus_var_regex=re.compile('(\${?RPM_BUILD_(ROOT|DIR)}?)')
+# [foo, (bar, baz)]:
+# if a script contains foo then the rpm must prerequire bar or contain baz
prereq_assoc = (
# ['chkconfig', ('chkconfig', '/sbin/chkconfig')],
['chkfontpath', ('chkfontpath', '/usr/sbin/chkfontpath')],
['rpm-helper', ('rpm-helper',)],
+ ['cp', ('coreutils', '/bin/cp')],
+ ['ln', ('coreutils', '/bin/ln')],
+ ['mv', ('coreutils', '/bin/mv')],
+ ['rm', ('coreutils', '/bin/rm')],
+ ['rmdir', ('coreutils', '/bin/rmdir')],
+ ['cat', ('coreutils', '/bin/cat')],
+ ['cut', ('coreutils', '/usr/bin/cut')],
+ ['uname', ('coreutils', '/bin/uname')],
+ ['md5sum', ('coreutils', '/usr/bin/md5sum')],
+ ['pear', ('php5-pear', '/usr/bin/pear')],
+ ['update-alternatives', ('update-alternatives', '/usr/sbin/update-alternatives')],
+ ['a2enmod', ('apache2', '/usr/sbin/a2enmod')],
+
+ ['sed', ('sed', '/bin/sed')],
+ ['awk', ('gawk', '/usr/bin/awk')],
+ ['gawk', ('gawk', '/usr/bin/gawk')],
+ ['grep', ('grep', '/usr/bin/grep')],
+ ['useradd', ('pwdutils', '/usr/sbin/useradd')],
+ ['groupadd', ('pwdutils', '/usr/sbin/groupadd')],
+ ['chkstat', ('permissions', '/usr/bin/chkstat')],
+ ['diff', ('diffutils', '/usr/bin/diff')],
+ ['cmp', ('diffutils', '/usr/bin/cmp')],
+ ['patch', ('patch', '/usr/bin/patch')],
+ ['fillup', ('fillup', '/bin/fillup')],
+ ['tar', ('tar', '/bin/tar')],
+ ['cpio', ('cpio', '/bin/cpio')],
+ ['odbcinst', ('unixODBC', '/usr/bin/odbcinst')],
+ ['install-info', ('info', '/sbin/install-info')],
+ ['gpg', ('gpg2', '/usr/bin/gpg')],
+ ['nm', ('binutils', '/usr/bin/nm')],
+ ['edit-xml-catalog', ('awk', '/usr/bin/awk')],
)
+# \b is word boundary
for p in prereq_assoc:
- p[0] = re.compile('^[^#]+' + p[0], re.MULTILINE)
+ p[0] = re.compile('^[^#]+\\b(' + p[0] + ')\\b', re.MULTILINE)
# pychecker fix
del p
@@ -163,15 +196,17 @@
printError(pkg, 'update-menus-without-menu-file-in-' + tag[2])
if tmp_regex.search(script):
printError(pkg, 'use-tmp-in-' + tag[2])
+
for c in prereq_assoc:
- if c[0].search(script):
+ res = c[0].search(script)
+ if res:
found=0
for p in c[1]:
if p in prereq or p in files:
found=1
break
if not found:
- printError(pkg, 'no-prereq-on', c[1][0])
+ printError(pkg, 'no-prereq-on', c[1][0], 'or', c[1][1], 'for', res.group(1))
if prog in syntaxcheck_shells:
if incorrect_shell_script(prog, script):
@@ -230,6 +265,11 @@
policy type was found in the scriptlet. These types are subject to change
on a policy version upgrade. Use the restorecon command which queries the
currently loaded policy for the correct type instead.''',
+
+'no-prereq-on',
+'''Your rpm post/postun scripts contain a call to a command that is missing
+from the rpm prereq list. This might cause the package to fail during
+installation due to the required program not being available yet.'''
)
# PostCheck.py ends here

33
invalid-filerequires.diff Normal file
View File

@ -0,0 +1,33 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -406,6 +406,7 @@ invalid_version_regex=re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE
forbidden_words_regex=re.compile('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE)
valid_buildhost_regex=re.compile(Config.getOption('ValidBuildHost'))
epoch_regex=re.compile('^[0-9]+:')
+valid_filedep_regex=re.compile('(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)')
use_epoch=Config.getOption('UseEpoch', 0)
use_utf8=Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
macro_regex=re.compile('^%(?:[\{\(]|\w{3,})')
@@ -490,6 +491,9 @@ class TagsCheck(AbstractCheck.AbstractCheck):
if d[0].startswith('/usr/bin/env'):
printWarning(pkg, 'invalid-dependency', d[0])
+ if d[0].startswith('/') and not valid_filedep_regex.search(d[0]):
+ printWarning(pkg, 'invalid-filepath-dependency', d[0])
+
if not devel_depend and not is_devel and not is_source:
if FilesCheck.devel_regex.search(d[0]):
printError(pkg, 'devel-dependency', d[0])
@@ -866,6 +870,12 @@ once.''',
'obsolete-on-name',
'''A package should not obsolete itself, as it can cause weird errors in tools.''',
+'invalid-filepath-dependency',
+'''A package has a file or path based dependency that is not resolveable for
+package solvers because it is not in the whitelist for path based dependencies
+and therefore not available in repository metadata. Please use a symbolic requires
+instead or require a file in bin or /etc.''',
+
'tag-not-utf8',
'''The character encoding of the value of this tag is not UTF-8.''',

View File

@ -0,0 +1,42 @@
--- BinariesCheck.py
+++ BinariesCheck.py
@@ -165,6 +165,7 @@
is_elf = string.find(i[1], 'ELF') != -1
is_ar = string.find(i[1], 'current ar archive') != -1
is_ocaml_native = string.find(i[1], 'Objective caml native') != -1
+ is_shell = string.find(i[1], "shell script") != -1
is_binary = is_elf or is_ar or is_ocaml_native
if is_binary:
@@ -278,6 +279,16 @@
printError(pkg, 'invalid-directory-reference', i[0],
'(line %s)' % ", ".join(lines))
+ if is_shell:
+ count= 0
+ for l in file(pkg.dirName() + i[0], "r"):
+ count = count + 1
+ if (l.find("This wrapper script should never be moved out of the build directory") != -1):
+ printError(pkg, 'libtool-wrapper-in-package', i[0])
+ break
+ if (count > 20):
+ break;
+
if has_lib != []:
if exec_files != []:
for f in exec_files:
@@ -341,6 +352,14 @@
Another common mistake that causes this problem is linking with
``gcc -Wl,-shared'' instead of ``gcc -shared''.''',
+'libtool-wrapper-in-package',
+'''Your package contains a libtool wrapper shell script. This
+will not work. Instead of install'ing the libtool wrapper file,
+run
+
+libtool --mode=install install -m perm <file> <dest>
+
+to install the relinked file.''',
'binary-or-shlib-defines-rpath',
'''The binary or shared library defines `RPATH'. Usually this is a
bad thing because it hardcodes the path to search libraries and so

19
locale-support.diff Normal file
View File

@ -0,0 +1,19 @@
--- rpmlint.py
+++ rpmlint.py
@@ -16,6 +16,7 @@ import Pkg
import Config
import os
import stat
+import locale
import rpm
from Filter import *
import SpecCheck
@@ -42,6 +43,8 @@ def loadCheck(name):
# main program
#############################################################################
def main():
+
+ locale.setlocale(locale.LC_ALL, '')
# Load all the tests
for c in Config.allChecks():
loadCheck(c)

11
no-doc-for-lib.diff Normal file
View File

@ -0,0 +1,11 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -292,7 +292,7 @@
log_file=0
logrotate_file=0
- if not doc_files:
+ if not lib_package and not doc_files:
printWarning(pkg, 'no-documentation')
if len(files.keys()) and meta_package_re.search(pkg.name):

11
no-dot-in-skel.diff Normal file
View File

@ -0,0 +1,11 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -824,7 +824,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
printError(pkg, 'version-control-internal-file', f)
elif f.endswith('/.htaccess'):
printError(pkg, 'htaccess-file', f)
- elif hidden_file_regex.search(f):
+ elif hidden_file_regex.search(f) and not f.startswith("/etc/skel/"):
printWarning(pkg, 'hidden-file-or-dir', f)
elif manifest_perl_regex.search(f):
printWarning(pkg, 'manifest-in-perl-module', f)

51
noarch-lib64.diff Normal file
View File

@ -0,0 +1,51 @@
--- BinariesCheck.py
+++ BinariesCheck.py
@@ -153,6 +153,7 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
binary=0
binary_in_usr_lib=0
has_usr_lib_file=0
+ file_in_lib64=0
res = srcname_regex.search(pkg[rpm.RPMTAG_SOURCERPM] or '')
if res:
@@ -161,10 +162,13 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
multi_pkg=0
for f in files:
- if usr_lib_regex.search(f) and not usr_lib_exception_regex.search(f) and not stat.S_ISDIR(files[f][0]):
+ if stat.S_ISREG(files[f][0]) and usr_lib_regex.search(f) and not usr_lib_exception_regex.search(f):
has_usr_lib_file=f
break
+ if stat.S_ISREG(files[f][0]) and (f.startswith("/usr/lib64") or f.startswith("/lib64")):
+ file_in_lib64=1
+
for i in info:
is_elf = string.find(i[1], 'ELF') != -1
is_ar = string.find(i[1], 'current ar archive') != -1
@@ -316,9 +320,12 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
printError(pkg, 'incoherent-version-in-name', version)
if pkg.arch != 'noarch' and not multi_pkg:
- if binary == 0:
+ if binary == 0 and not file_in_lib64:
printError(pkg, 'no-binary')
+ if pkg.arch == 'noarch' and file_in_lib64:
+ printError(pkg, 'noarch-with-lib64')
+
if has_usr_lib_file and not binary_in_usr_lib:
printError(pkg, 'only-non-binary-in-usr-lib')
@@ -343,6 +350,11 @@ FHS and the FSSTND forbid this.''',
# 'non-sparc32-binary',
# '',
+'noarch-with-lib64',
+'''This package is marked as noarch but installs files into lib64.
+Not all architectures have this in path, so the package can't be
+noarch.''',
+
'invalid-soname',
'''The soname of the library is neither of the form lib<libname>.so.<major> or
lib<libname>-<major>.so.''',

16
old-rpm-compat.diff Normal file
View File

@ -0,0 +1,16 @@
--- DocFilesCheck.py
+++ DocFilesCheck.py
@@ -60,8 +60,11 @@
name = dep.N()
flags = dep.Flags()
# skip deps which were found by find-requires
- if flags & rpm.RPMSENSE_FIND_REQUIRES != 0:
- continue
+ try:
+ if flags & rpm.RPMSENSE_FIND_REQUIRES != 0:
+ continue
+ except:
+ pass
core_reqs[name] = []
# register things which are provided by the package

View File

@ -0,0 +1,19 @@
--- InitScriptCheck.py
+++ InitScriptCheck.py
@@ -15,6 +15,7 @@
import rpm
import Pkg
import string
+import stat
rc_regex=re.compile('^/etc(/rc\.d)?/init\.d/')
chkconfig_content_regex=re.compile('^\s*#\s*chkconfig:\s*([-0-9]+)\s+[-0-9]+\s+[-0-9]+')
@@ -40,7 +41,7 @@
initscript_list = []
for f in pkg.files().keys():
- if rc_regex.search(f):
+ if rc_regex.search(f) and stat.S_ISREG(pkg.files()[f][0]):
basename=basename_regex.search(f).group(1)
initscript_list.append(basename)
if pkg.files()[f][0] & 0500 != 0500:

View File

@ -0,0 +1,27 @@
--- BinariesCheck.py
+++ BinariesCheck.py
@@ -119,6 +119,8 @@
sparc_regex=re.compile('SPARC32PLUS|SPARC V9|UltraSPARC')
system_lib_paths=Config.getOption('SystemLibPaths', DEFAULT_SYSTEM_LIB_PATHS)
usr_lib_regex=re.compile('^/usr/lib(64)?/')
+lib_perl_regex=re.compile('^/usr/lib/perl5/(?:vendor_perl/)?([0-9]+\.[0-9]+)\.([0-9]+)/')
+perl_version_trick=Config.getOption('PerlVersionTrick', 1)
bin_regex=re.compile('^(/usr(/X11R6)?)?/s?bin/')
soversion_regex=re.compile('.*?([0-9][.0-9]*)\\.so|.*\\.so\\.([0-9][.0-9]*).*')
reference_regex=re.compile('\.la$|^/usr/lib(64)?/pkgconfig/')
@@ -234,7 +236,14 @@
if p in system_lib_paths or \
not usr_lib_regex.search(p):
printError(pkg, 'binary-or-shlib-defines-rpath', i[0], bin_info.rpath)
- break
+ res=lib_perl_regex.search(p)
+ if res:
+ if perl_version_trick:
+ vers = res.group(1) + '.' + res.group(2)
+ else:
+ vers = res.group(1) + res.group(2)
+ if not (pkg.check_versioned_dep('perl', vers)):
+ printError(pkg, "no-dependency-on", "perl", vers)
# statically linked ?
is_exec=executable_regex.search(i[1])

0
ready Normal file
View File

12
reject-env.diff Normal file
View File

@ -0,0 +1,12 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -486,6 +486,9 @@
if d[0].startswith('/usr/local/'):
printError(pkg, 'invalid-dependency', d[0])
+ if d[0].startswith('/usr/bin/env'):
+ printWarning(pkg, 'invalid-dependency', d[0])
+
if not devel_depend and not is_devel and not is_source:
if FilesCheck.devel_regex.search(d[0]):
printError(pkg, 'devel-dependency', d[0])

11
rpmgroup-checks.diff Normal file
View File

@ -0,0 +1,11 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -586,6 +586,8 @@ class TagsCheck(AbstractCheck.AbstractCheck):
else:
if VALID_GROUPS and group not in VALID_GROUPS:
printWarning(pkg, 'non-standard-group', group)
+ if pkg.name.find('-devel') != -1 and not group.startswith('Development/'):
+ printWarning(pkg, 'devel-package-with-non-devel-group', group)
buildhost=pkg[rpm.RPMTAG_BUILDHOST]
if not buildhost:

3
rpmlint-0.82.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fc9168bb9d950d9ee7282c71a683693156b3f7c697598309b0a9bf978e8e367b
size 79182

48
rpmlint-suse.diff Normal file
View File

@ -0,0 +1,48 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -173,7 +173,7 @@
absolute_regex=re.compile('^/([^/]+)')
absolute2_regex=re.compile('^/?([^/]+)')
points_regex=re.compile('^\.\./(.*)')
-doc_regex=re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/')
+doc_regex=re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help')
bin_regex=re.compile('^(/usr)?/s?bin/')
includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE)
develfile_regex = re.compile('\.(a|cmxa?|mli?)$')
--- I18NCheck.py
+++ I18NCheck.py
@@ -69,10 +69,11 @@
st += ')$'
package_regex=re.compile(st)
-locale_regex=re.compile('^(/usr/share/locale/([^/]+))/')
+locale_regex=re.compile('^/(usr|opt/kde3)/share/locale/([^/]+)/')
correct_subdir_regex=re.compile('^(([a-z][a-z]([a-z])?(_[A-Z][A-Z])?)([.@].*$)?)$')
lc_messages_regex=re.compile('/usr/share/locale/([^/]+)/LC_MESSAGES/.*(mo|po)$')
man_regex=re.compile('/usr(?:/share)?/man/([^/]+)/man./[^/]+$')
+doc_regex=re.compile('^/opt/kde3/share/doc/HTML/(^[/]*)/')
# list of exceptions
#
@@ -122,7 +123,7 @@
if res:
locale=res.group(2)
# checks the same locale only once
- if not locale in locales:
+ if locale and not locale in locales:
locales.append(locale)
res2=correct_subdir_regex.search(locale)
if not res2:
@@ -162,6 +163,12 @@
if main_lang != lang:
main_dir, main_lang = f, lang
+ res=doc_regex.search(f)
+ if res:
+ subdir=res.group(1)
+ if subdir != 'en' and pkg.fileLang(f) == '':
+ printWarning(pkg, 'file-not-in-%lang', f)
+
name=pkg.name
res=package_regex.search(name)
if res:

660
rpmlint.changes Normal file
View File

@ -0,0 +1,660 @@
-------------------------------------------------------------------
Tue Mar 11 18:15:37 CET 2008 - dmueller@suse.de
- fix some false positives
-------------------------------------------------------------------
Mon Mar 10 18:31:03 CET 2008 - dmueller@suse.de
- add check for a really short description
-------------------------------------------------------------------
Thu Mar 6 11:41:02 CET 2008 - dmueller@suse.de
- be less restrictive in pkgconfig checks
-------------------------------------------------------------------
Mon Mar 3 16:16:52 CET 2008 - dmueller@suse.de
- suppress tag-not-utf8 warnings for now
-------------------------------------------------------------------
Thu Feb 28 21:37:57 CET 2008 - dmueller@suse.de
- add check for %run_ldconfig
-------------------------------------------------------------------
Thu Feb 28 13:19:08 CET 2008 - dmueller@suse.de
- improve check output
-------------------------------------------------------------------
Wed Feb 27 00:21:27 CET 2008 - dmueller@suse.de
- improved tags check
- cleanups
-------------------------------------------------------------------
Mon Feb 25 17:28:50 CET 2008 - dmueller@suse.de
- reduce package-size-check false positives
- add another postscript check
-------------------------------------------------------------------
Tue Feb 19 14:27:46 CET 2008 - dmueller@suse.de
- fix typo in sorting routine
-------------------------------------------------------------------
Fri Feb 15 17:58:58 CET 2008 - dmueller@suse.de
- updated spec file name-guessing to catch more cases
- updated dot-in-identifier check
- suppression updates
-------------------------------------------------------------------
Tue Feb 12 15:54:06 CET 2008 - dmueller@suse.de
- update to 0.82:
* some patches were upstreamed
* small bugfixes
- rework fix for bnc#354177 to consider python bytecode
arch-independent again, but catch it in arch-dependent paths
-------------------------------------------------------------------
Sat Feb 9 10:51:12 CET 2008 - dmueller@suse.de
- fix some minor buglets
-------------------------------------------------------------------
Tue Feb 5 15:57:18 CET 2008 - dmueller@suse.de
- consider python bytecode to not be arch independent (bnc#354177)
- improve postcheck to ignore unexpanded macros in comments (bnc#355306)
- check binary rpath for perl version dependency (bnc#355053)
- add check for unversioned self-provides
- update suse checks from SVN
- check for dot's in dependencies - forbidden by autobuild policy
-------------------------------------------------------------------
Wed Jan 23 08:21:53 CET 2008 - dmueller@suse.de
- improve documentation
-------------------------------------------------------------------
Mon Jan 14 12:21:40 CET 2008 - dmueller@suse.de
- check for libtool wrapper scripts being packaged (#353240)
-------------------------------------------------------------------
Wed Dec 12 13:18:02 CET 2007 - dmueller@suse.de
- reapply patch-detection fix
-------------------------------------------------------------------
Tue Dec 4 00:42:58 CET 2007 - dmueller@suse.de
- add suppression for libzypp
- fix wrong indentation in verify-buildrequires
-------------------------------------------------------------------
Fri Nov 30 19:10:42 CET 2007 - dmueller@suse.de
- bugfixes in check-mkdir-buildroot
- bugfix in percent-post check
- check for buildroot in %post scriptlets
- remove abused legacy shared lib policy exceptions
- suppression update
-------------------------------------------------------------------
Tue Nov 27 00:11:06 CET 2007 - dmueller@suse.de
- fix suppression for internal packages
-------------------------------------------------------------------
Fri Nov 23 15:59:40 CET 2007 - dmueller@suse.de
- add suppression for non-remote_fs on boot.* (#340588)
-------------------------------------------------------------------
Wed Nov 21 15:20:30 CET 2007 - dmueller@suse.de
- add warning for non-utf8 filenames (#343216)
-------------------------------------------------------------------
Tue Nov 6 12:10:33 CET 2007 - dmueller@suse.de
- more prereq checks
-------------------------------------------------------------------
Mon Nov 5 18:23:02 CET 2007 - dmueller@suse.de
- suppression update
- add more prereq checks
-------------------------------------------------------------------
Fri Nov 2 11:38:52 CET 2007 - dmueller@suse.de
- fix prereq parsing code (#336712)
- update the obsolete-suse-version check to include 10.0 and 11.0
- fix prereq checks to check for coreutils
-------------------------------------------------------------------
Wed Oct 31 15:52:35 CET 2007 - dmueller@suse.de
- reporting format change-back got rejected by upstream,
so adopt other changes to deal with it
-------------------------------------------------------------------
Tue Oct 30 15:03:53 CET 2007 - dmueller@suse.de
- change back reporting format to list the severity
first
- add more legacy suppressions found by library policy
fix
-------------------------------------------------------------------
Mon Oct 29 11:20:51 CET 2007 - dmueller@suse.de
- also check for Library Policy errors in /opt/kde3/lib
-------------------------------------------------------------------
Mon Oct 29 10:38:23 CET 2007 - dmueller@suse.de
- update to 0.81:
* various new checks, some bugfixes
* many patches upstreamed
* rediffed all other patches
- NOTE: output format has changed from
W: package check-id ..
to
package.<arch>: W: check-id ..
-------------------------------------------------------------------
Sun Oct 7 04:45:41 CEST 2007 - dmueller@suse.de
- another round of updates
-------------------------------------------------------------------
Fri Oct 5 02:08:54 CEST 2007 - dmueller@suse.de
- library policy legacy suppression update
-------------------------------------------------------------------
Mon Oct 1 20:08:08 CEST 2007 - mmarek@suse.cz
- added 'mysql' to the list of standard users and groups
- removed 'jonas' (dropped package) from that list
-------------------------------------------------------------------
Tue Sep 25 15:43:39 CEST 2007 - dmueller@suse.de
- update library policy checker for libgcc and libcaca
- check for /usr/share/gnome/help in documentation checks (#310134)
-------------------------------------------------------------------
Thu Sep 20 15:35:35 CEST 2007 - dmueller@suse.de
- add check for non-whitelisted filedependencies (#326803)
-------------------------------------------------------------------
Mon Sep 3 15:04:21 CEST 2007 - dmueller@suse.de
- fix hardlink check for /bin
-------------------------------------------------------------------
Sat Sep 1 13:10:31 CEST 2007 - schwab@suse.de
- Fix last change.
-------------------------------------------------------------------
Sat Sep 1 00:57:49 CEST 2007 - dmueller@suse.de
- fix off-by-one in hardlink check
-------------------------------------------------------------------
Fri Aug 31 10:45:55 CEST 2007 - dmueller@suse.de
- fix exception in DuplicatesCheck
-------------------------------------------------------------------
Thu Aug 30 18:48:15 CEST 2007 - dmueller@suse.de
- fix buildroot false positive
- check for hardlinks across partitions (#304167)
-------------------------------------------------------------------
Wed Aug 29 20:47:06 CEST 2007 - dmueller@suse.de
- improve mkdir-installroot check
- fix rpmlint package regarding check above ;)
-------------------------------------------------------------------
Wed Aug 29 10:45:55 CEST 2007 - mmarek@suse.cz
- improved the non-devel-buildrequires check
- added some default filters for non-devel-buildrequires and
unneccessary-buildrequires
-------------------------------------------------------------------
Thu Aug 23 01:13:18 CEST 2007 - dmueller@suse.de
- check for wrong cleaning of buildroot in %install (#300232)
- check for obscure and unneccessary buildrequires
- add an icon size check (#163547)
-------------------------------------------------------------------
Tue Aug 21 17:47:31 CEST 2007 - dmueller@suse.de
- refine the $remote_fs dependency check
-------------------------------------------------------------------
Sun Aug 12 15:39:58 CEST 2007 - dmueller@suse.de
- suppression update
-------------------------------------------------------------------
Sat Aug 11 15:22:41 CEST 2007 - dmueller@suse.de
- improved macro checks
- documentation update
-------------------------------------------------------------------
Fri Aug 10 16:37:21 CEST 2007 - dmueller@suse.de
- detect makefile junk (#217472)
- suppression update
- fix a couple of false positives
-------------------------------------------------------------------
Tue Jul 31 15:02:28 CEST 2007 - dmueller@suse.de
- fix package-with-huge-docs check to not complain about
documentation-only packages
- remove verbosity from the shared library packaging policy check
-------------------------------------------------------------------
Wed Jul 25 01:58:03 CEST 2007 - dmueller@suse.de
- fix man page check false positives
- make package-with-huge-docs check less verbose
-------------------------------------------------------------------
Tue Jul 17 11:33:22 CEST 2007 - dmueller@suse.de
- accept lua as a builtin shell
- fix false positives on filesystem package
- add check for init scrips missing $remote_fs
-------------------------------------------------------------------
Wed Jul 11 17:04:33 CEST 2007 - dmueller@suse.de
- adjust library policy suppressions for opal and pwlib (#290347)
- fix readme check (#291150)
-------------------------------------------------------------------
Mon Jul 9 17:47:37 CEST 2007 - dmueller@suse.de
- its also a devel package if it provides a -devel subpackage (#289735)
-------------------------------------------------------------------
Wed Jul 4 20:47:43 CEST 2007 - dmueller@suse.de
- suppress %config check for now (#286231)
-------------------------------------------------------------------
Wed Jun 27 00:09:55 CEST 2007 - dmueller@suse.de
- fix typo in devel-rpmgroup check
-------------------------------------------------------------------
Mon Jun 25 10:39:00 CEST 2007 - dmueller@suse.de
- another update list of legacy packages
-------------------------------------------------------------------
Sat Jun 23 11:51:01 CEST 2007 - dmueller@suse.de
- update list of legacy packages
-------------------------------------------------------------------
Fri Jun 22 14:34:31 CEST 2007 - dmueller@suse.de
- suppressions for mono related packages (#282121)
-------------------------------------------------------------------
Fri Jun 22 11:50:38 CEST 2007 - dmueller@suse.de
- fix the bzip2/gzip confusion again
-------------------------------------------------------------------
Fri Jun 22 09:24:52 CEST 2007 - dmueller@suse.de
- update list of legacy packages
-------------------------------------------------------------------
Fri Jun 22 01:08:40 CEST 2007 - dmueller@suse.de
- add list of legacy package names with non-policy conform
package name
- check updates from SVN
-------------------------------------------------------------------
Thu Jun 21 17:44:25 CEST 2007 - dmueller@suse.de
- suppression update
- suppress devel-file-in-non-devel package if its just a compat
symlink to another .so
- avoid unstripped binaries warnings in BETA
- fix filesystem lint false positives
-------------------------------------------------------------------
Wed Jun 13 18:38:57 CEST 2007 - dmueller@suse.de
- suppression update
- add descriptions to sysv5 init checks
- use readelf for binary info to improve performace
- check if source patch/tarballs is not bzip2'ed and bigger
than 100k (suse packaging conventions requirement)
- check if package contains excessive sized documentation
-------------------------------------------------------------------
Mon Jun 11 17:39:16 CEST 2007 - dmueller@suse.de
- hide errors related to .packlist files from perl
still need to figure out though why they're there
-------------------------------------------------------------------
Mon Jun 11 10:55:45 CEST 2007 - dmueller@suse.de
- fix build
-------------------------------------------------------------------
Sat Jun 9 11:20:21 CEST 2007 - dmueller@suse.de
- make the buildroot check work
- make the buildroot check factor 10-15 faster
- fix the pkgconfig check
-------------------------------------------------------------------
Fri Jun 8 22:57:18 CEST 2007 - dmueller@suse.de
- fix warning-hide hack (#279865)
- description update
-------------------------------------------------------------------
Fri Jun 8 14:20:35 CEST 2007 - dmueller@suse.de
- hide unstripped-binary-or-object warning outside build (#279865)
- fix typo in library policy check
- adopt library checks for suse library packaging policy
- add check for unnecessarily packaged files
- description update
- suppression update
-------------------------------------------------------------------
Thu May 31 21:57:38 CEST 2007 - dmueller@suse.de
- suppression update
- fix various checks
- add checks for init scripts
-------------------------------------------------------------------
Wed May 30 17:33:11 CEST 2007 - dmueller@suse.de
- update LibraryPolicy Checker
-------------------------------------------------------------------
Tue May 29 15:40:23 CEST 2007 - dmueller@suse.de
- suppression update
- fix XDG menu checker to also include non-/usr paths
- fix ghost-file-creation check to skip missingok files (#278761)
-------------------------------------------------------------------
Mon May 28 15:36:29 CEST 2007 - dmueller@suse.de
- suppression-update
- Library Policy Checker crash fixes (#278592)
-------------------------------------------------------------------
Sat May 26 12:04:46 CEST 2007 - dmueller@suse.de
- add description for missing lsb tags check
- fix obsolete-not-provided for yast2-provides
- fix devel-file check matching module names (e.g. apache2)
-------------------------------------------------------------------
Fri May 25 23:44:24 CEST 2007 - dmueller@suse.de
- avoid spurious executable warnings for docdatadir/examples
- add LibraryPolicy checker from Richard (warning only)
- suppression update
-------------------------------------------------------------------
Thu May 24 17:15:12 CEST 2007 - dmueller@suse.de
- fix suppression for qa_ packages
- fix exceptions caused by DesktopTranslation check
- fix crash caused by trailing colons in requires
-------------------------------------------------------------------
Thu May 24 16:27:08 CEST 2007 - dmueller@suse.de
- fix file paths in Duplicate and DesktopTranslation checks
-------------------------------------------------------------------
Thu May 24 16:11:13 CEST 2007 - dmueller@suse.de
- update sourced-dirs list
- add some more standard users
- add suppression for devel-file-in-non-devel package in java
- filter some more noise
-------------------------------------------------------------------
Wed May 23 19:07:36 CEST 2007 - dmueller@suse.de
- add descriptions for obsolete suse version check
- suppress some more noise
- don't run duplicates check for source rpms
-------------------------------------------------------------------
Wed May 23 16:49:18 CEST 2007 - dmueller@suse.de
- suppress errors for cross-avr-*
- suppress devel-packaging-naming errors for gcc41, gcc42
-------------------------------------------------------------------
Wed May 23 15:44:30 CEST 2007 - dmueller@suse.de
- group output by check and put errors last (#276943)
- suppress some more noise (#277308)
- suppress %ifarch-applied-patch (#277316)
- more suppressions for misnamed devel packages (#277317)
-------------------------------------------------------------------
Wed May 23 13:26:06 CEST 2007 - dmueller@suse.de
- Suppress errors about platform dependent code in /usr/share
if its inside a platform-dependant subdirectory
- Suppress devel-file-in-non-devel-package for systemtap (#277338)
- Make sure that the package fails if there is any syntax
error anywhere
-------------------------------------------------------------------
Wed May 23 00:05:04 CEST 2007 - dmueller@suse.de
- typo fix
-------------------------------------------------------------------
Tue May 22 15:47:59 CEST 2007 - dmueller@suse.de
- update config
-------------------------------------------------------------------
Sat May 19 17:58:10 CEST 2007 - coolo@suse.de
- add three more checks
-------------------------------------------------------------------
Thu May 17 23:02:36 CEST 2007 - dmueller@suse.de
- update Duplicates Check to not crash on ghost files
-------------------------------------------------------------------
Tue May 15 23:41:06 CEST 2007 - dmueller@suse.de
- suppress bzip2 related warnings
- no documentation for lib packages
-------------------------------------------------------------------
Tue May 15 21:12:51 CEST 2007 - coolo@suse.de
- add a check how much space is wasted by duplicated files
-------------------------------------------------------------------
Mon May 14 16:02:41 CEST 2007 - dmueller@suse.de
- remove rpm-devel requirement
- add check for filerequires on /usr/bin/env
- fix syntax errors in previous change
-------------------------------------------------------------------
Mon May 14 12:04:51 CEST 2007 - coolo@suse.de
- add a check for /opt/kde3 not in %doc or in %lang
- fix files not in %lang check
-------------------------------------------------------------------
Wed May 9 15:08:11 CEST 2007 - dmueller@suse.de
- remove tabs from sources
-------------------------------------------------------------------
Mon May 7 13:24:24 CEST 2007 - dmueller@suse.de
- fix desktop file check (#252482)
-------------------------------------------------------------------
Sat May 5 13:47:25 CEST 2007 - dmueller@suse.de
- allow extensions to LSB starting with "X-" (#271495)
-------------------------------------------------------------------
Fri May 4 17:42:07 CEST 2007 - dmueller@suse.de
- remove check for usedforbuild tag. magic happens and
it is created automatically
-------------------------------------------------------------------
Thu Apr 19 00:45:14 CEST 2007 - dmueller@suse.de
- add spec checks for obsolete suse hacks
-------------------------------------------------------------------
Wed Apr 18 15:51:46 CEST 2007 - dmueller@suse.de
- update to 0.80:
* many more checks
- suppression updates
-------------------------------------------------------------------
Thu Apr 5 20:25:36 CEST 2007 - dmueller@suse.de
- suppressions for OpenOffice and linux-kernel-headers
-------------------------------------------------------------------
Thu Apr 5 19:26:07 CEST 2007 - dmueller@suse.de
- update suppressions
-------------------------------------------------------------------
Wed Nov 8 17:12:20 CET 2006 - dmueller@suse.de
- fix compatibility with rpm-python of sles9 (#216081)
-------------------------------------------------------------------
Mon Sep 11 18:49:58 CEST 2006 - dmueller@suse.de
- update to 0.77:
* updated checks regarding FHS compliance
* some python-lint fixlets
-------------------------------------------------------------------
Wed Apr 12 12:21:31 CEST 2006 - dmueller@suse.de
- update to 0.76
-------------------------------------------------------------------
Fri Mar 24 18:05:19 CET 2006 - dmueller@suse.de
- update to 0.75
-------------------------------------------------------------------
Tue Mar 21 15:33:35 CET 2006 - dmueller@suse.de
- suppress some glibc related errors (#157906)
-------------------------------------------------------------------
Wed Feb 22 17:54:29 CET 2006 - dmueller@suse.de
- add km to the list of valid locales
-------------------------------------------------------------------
Wed Jan 25 21:47:41 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Mon Jan 9 18:42:52 CET 2006 - dmueller@suse.de
- add check for untranslated desktop files
-------------------------------------------------------------------
Tue Dec 20 16:06:54 CET 2005 - dmueller@suse.de
- fix i18n subdir check
-------------------------------------------------------------------
Thu Dec 15 13:28:23 CET 2005 - dmueller@suse.de
- filter init-script-name-with-dot /etc/init.d/boot.* and
script-without-shellbang /etc/profile.d/*
-------------------------------------------------------------------
Thu Nov 24 11:06:43 CET 2005 - dmueller@suse.de
- update to 0.71
- strip "requires-on-release" for now, too much noise
-------------------------------------------------------------------
Fri Jul 22 15:01:41 CEST 2005 - dmueller@suse.de
- ignore dir-or-file-in-opt
-------------------------------------------------------------------
Mon Jun 20 15:22:12 CEST 2005 - coolo@suse.de
- update to 0.70
-------------------------------------------------------------------
Thu Jun 16 02:01:08 CEST 2005 - dmueller@suse.de
- upgrade to rpmlint 0.69
- split out the config file from the SUSE patch
-------------------------------------------------------------------
Thu Nov 11 15:22:42 CET 2004 - coolo@suse.de
- remove some MDK specific tests and add some SUSE specific tests
-------------------------------------------------------------------
Mon Feb 23 12:37:56 CET 2004 - hmacht@suse.de
- building as non-root
-------------------------------------------------------------------
Wed Jun 11 10:49:01 CEST 2003 - coolo@suse.de
- initial version

511
rpmlint.spec Normal file
View File

@ -0,0 +1,511 @@
#
# spec file for package rpmlint (Version 0.82)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: rpmlint
BuildRequires: rpm-python
Summary: Rpm correctness checker
Version: 0.82
Release: 23
Source0: %{name}-%{version}.tar.bz2
Source1: config
Source2: DesktopTranslationCheck.py
Source3: DuplicatesCheck.py
Source4: CheckBuildRoot.py
Source5: CheckExecDocs.py
Source6: CheckPkgConfig.py
Source7: LibraryPolicyCheck.py
Source8: CheckCommonFiles.py
Source9: CheckInitScripts.py
Source10: CheckIconSizes.py
Source100: syntax-validator.py
Url: http://rpmlint.zarb.org/
License: GPL v2 or later
Group: System/Packages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: rpm-python, python, binutils, file, findutils, cpio, grep, bash
Requires: desktop-file-utils
BuildArch: noarch
Patch0: rpmlint-suse.diff
Patch1: old-rpm-compat.diff
Patch2: suse-version.diff
Patch3: disable-menu-check.diff
Patch4: invalid-filerequires.diff
Patch5: suse-bzip-bigger-than-100k.diff
Patch6: suse-filesystem.diff
Patch7: suse-checks.diff
Patch8: reject-env.diff
Patch9: no-doc-for-lib.diff
Patch10: add-scoring-support.diff
Patch11: suse-spec-bzip2.diff
Patch12: usr-arch.diff
Patch13: script-interpreter-only-for-exec-scripts.diff
Patch14: sourced-dirs.diff
Patch15: subdir-dangling-symlink.diff
Patch16: dependency-parsing.diff
Patch17: docdata-examples.diff
Patch18: suse-hide-unstripped-outside-build.diff
Patch19: yast-provides.diff
Patch20: xdg-paths-update.diff
Patch21: fix-buildroot-test.diff
Patch22: better-wrong-script.diff
Patch23: buildroot-doc.diff
Patch24: sysv5-init-checks.diff
Patch25: suse-devel-dependencies.diff
Patch26: ignore-non-readable-in-etc.diff
Patch27: detailed-desktop-file-check.diff
Patch29: rpmgroup-checks.diff
Patch30: devel-provide-is-devel-package.diff
Patch31: only-reg-files-are-scripts.diff
Patch33: check-buildroot-during-install.diff
Patch34: verify-buildrequires.diff
Patch35: fix-versioned-prereq.diff
Patch36: improve-postdep-check.diff
Patch37: buildroot-in-scripts.diff
Patch38: fix-patch-detection.diff
Patch39: libtool-wrapper-check.diff
Patch41: perl-versioned-rpath-deps.diff
Patch42: check-cron-dependency.diff
Patch46: locale-support.diff
Patch47: noarch-lib64.diff
Patch48: try-harder-with-spec-name.diff
Patch49: stricter-tags-check.diff
Patch50: suse-no-run-ldconfig.diff
Patch51: description-check.diff
Patch52: suppress-for-perl-python.diff
Patch53: no-dot-in-skel.diff
%py_requires
%description
Rpmlint is a tool to check common errors on rpm packages. Binary and
source packages can be checked.
Authors:
--------
Frederic Lepied <flepied@mandriva.com>
Gwenole Beauchesne <gbeauchesne@mandriva.com>
%prep
%setup -q -n rpmlint-%{version}
%patch
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%patch11
%patch12
%patch13
%patch14
%patch15
%patch16
%patch17
%patch18
%patch19
%patch20
%patch21
%patch22
%patch23
%patch24
%patch25
%patch26
%patch27
%patch29
%patch30
%patch31
%patch33
%patch34
%patch35
%patch36
%patch37
%patch38
%patch39
%patch41
%patch46
%patch47
%patch48
%patch49
%patch50
%patch51
%patch52
%patch53
# not yet, needs further support for recommends
#%patch42
cp -p %{SOURCE1} .
cp -p %{SOURCE2} .
cp -p %{SOURCE3} .
cp -p %{SOURCE4} .
cp -p %{SOURCE5} .
cp -p %{SOURCE6} .
cp -p %{SOURCE7} .
cp -p %{SOURCE8} .
cp -p %{SOURCE9} .
cp -p %{SOURCE10} .
%build
make
%install
make install DESTDIR=$RPM_BUILD_ROOT
mv $RPM_BUILD_ROOT/etc/rpmlint/config $RPM_BUILD_ROOT/usr/share/rpmlint/config
head -n 8 $RPM_BUILD_ROOT/usr/share/rpmlint/config > $RPM_BUILD_ROOT/etc/rpmlint/config
# make sure that the package is sane
python -tt %{SOURCE100} $RPM_BUILD_ROOT/usr/share/rpmlint/*.py $RPM_BUILD_ROOT/usr/share/rpmlint/config
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,0755)
%doc COPYING ChangeLog INSTALL README*
%{_prefix}/bin/*
%{_prefix}/share/rpmlint
%config(noreplace) /etc/rpmlint/config
%dir /etc/rpmlint
/etc/bash_completion.d/rpmlint
/usr/share/man/man1/rpmlint.1.gz
%changelog
* Tue Mar 11 2008 dmueller@suse.de
- fix some false positives
* Mon Mar 10 2008 dmueller@suse.de
- add check for a really short description
* Thu Mar 06 2008 dmueller@suse.de
- be less restrictive in pkgconfig checks
* Mon Mar 03 2008 dmueller@suse.de
- suppress tag-not-utf8 warnings for now
* Thu Feb 28 2008 dmueller@suse.de
- add check for %%run_ldconfig
* Thu Feb 28 2008 dmueller@suse.de
- improve check output
* Wed Feb 27 2008 dmueller@suse.de
- improved tags check
- cleanups
* Mon Feb 25 2008 dmueller@suse.de
- reduce package-size-check false positives
- add another postscript check
* Tue Feb 19 2008 dmueller@suse.de
- fix typo in sorting routine
* Fri Feb 15 2008 dmueller@suse.de
- updated spec file name-guessing to catch more cases
- updated dot-in-identifier check
- suppression updates
* Tue Feb 12 2008 dmueller@suse.de
- update to 0.82:
* some patches were upstreamed
* small bugfixes
- rework fix for bnc#354177 to consider python bytecode
arch-independent again, but catch it in arch-dependent paths
* Sat Feb 09 2008 dmueller@suse.de
- fix some minor buglets
* Tue Feb 05 2008 dmueller@suse.de
- consider python bytecode to not be arch independent (bnc#354177)
- improve postcheck to ignore unexpanded macros in comments (bnc#355306)
- check binary rpath for perl version dependency (bnc#355053)
- add check for unversioned self-provides
- update suse checks from SVN
- check for dot's in dependencies - forbidden by autobuild policy
* Wed Jan 23 2008 dmueller@suse.de
- improve documentation
* Mon Jan 14 2008 dmueller@suse.de
- check for libtool wrapper scripts being packaged (#353240)
* Wed Dec 12 2007 dmueller@suse.de
- reapply patch-detection fix
* Tue Dec 04 2007 dmueller@suse.de
- add suppression for libzypp
- fix wrong indentation in verify-buildrequires
* Fri Nov 30 2007 dmueller@suse.de
- bugfixes in check-mkdir-buildroot
- bugfix in percent-post check
- check for buildroot in %%post scriptlets
- remove abused legacy shared lib policy exceptions
- suppression update
* Tue Nov 27 2007 dmueller@suse.de
- fix suppression for internal packages
* Fri Nov 23 2007 dmueller@suse.de
- add suppression for non-remote_fs on boot.* (#340588)
* Wed Nov 21 2007 dmueller@suse.de
- add warning for non-utf8 filenames (#343216)
* Tue Nov 06 2007 dmueller@suse.de
- more prereq checks
* Mon Nov 05 2007 dmueller@suse.de
- suppression update
- add more prereq checks
* Fri Nov 02 2007 dmueller@suse.de
- fix prereq parsing code (#336712)
- update the obsolete-suse-version check to include 10.0 and 11.0
- fix prereq checks to check for coreutils
* Wed Oct 31 2007 dmueller@suse.de
- reporting format change-back got rejected by upstream,
so adopt other changes to deal with it
* Tue Oct 30 2007 dmueller@suse.de
- change back reporting format to list the severity
first
- add more legacy suppressions found by library policy
fix
* Mon Oct 29 2007 dmueller@suse.de
- also check for Library Policy errors in /opt/kde3/lib
* Mon Oct 29 2007 dmueller@suse.de
- update to 0.81:
* various new checks, some bugfixes
* many patches upstreamed
* rediffed all other patches
- NOTE: output format has changed from
W: package check-id ..
to
package.<arch>: W: check-id ..
* Sun Oct 07 2007 dmueller@suse.de
- another round of updates
* Fri Oct 05 2007 dmueller@suse.de
- library policy legacy suppression update
* Mon Oct 01 2007 mmarek@suse.cz
- added 'mysql' to the list of standard users and groups
- removed 'jonas' (dropped package) from that list
* Tue Sep 25 2007 dmueller@suse.de
- update library policy checker for libgcc and libcaca
- check for /usr/share/gnome/help in documentation checks (#310134)
* Thu Sep 20 2007 dmueller@suse.de
- add check for non-whitelisted filedependencies (#326803)
* Mon Sep 03 2007 dmueller@suse.de
- fix hardlink check for /bin
* Sat Sep 01 2007 schwab@suse.de
- Fix last change.
* Sat Sep 01 2007 dmueller@suse.de
- fix off-by-one in hardlink check
* Fri Aug 31 2007 dmueller@suse.de
- fix exception in DuplicatesCheck
* Thu Aug 30 2007 dmueller@suse.de
- fix buildroot false positive
- check for hardlinks across partitions (#304167)
* Wed Aug 29 2007 dmueller@suse.de
- improve mkdir-installroot check
- fix rpmlint package regarding check above ;)
* Wed Aug 29 2007 mmarek@suse.cz
- improved the non-devel-buildrequires check
- added some default filters for non-devel-buildrequires and
unneccessary-buildrequires
* Thu Aug 23 2007 dmueller@suse.de
- check for wrong cleaning of buildroot in %%install (#300232)
- check for obscure and unneccessary buildrequires
- add an icon size check (#163547)
* Tue Aug 21 2007 dmueller@suse.de
- refine the $remote_fs dependency check
* Sun Aug 12 2007 dmueller@suse.de
- suppression update
* Sat Aug 11 2007 dmueller@suse.de
- improved macro checks
- documentation update
* Fri Aug 10 2007 dmueller@suse.de
- detect makefile junk (#217472)
- suppression update
- fix a couple of false positives
* Tue Jul 31 2007 dmueller@suse.de
- fix package-with-huge-docs check to not complain about
documentation-only packages
- remove verbosity from the shared library packaging policy check
* Wed Jul 25 2007 dmueller@suse.de
- fix man page check false positives
- make package-with-huge-docs check less verbose
* Tue Jul 17 2007 dmueller@suse.de
- accept lua as a builtin shell
- fix false positives on filesystem package
- add check for init scrips missing $remote_fs
* Wed Jul 11 2007 dmueller@suse.de
- adjust library policy suppressions for opal and pwlib (#290347)
- fix readme check (#291150)
* Mon Jul 09 2007 dmueller@suse.de
- its also a devel package if it provides a -devel subpackage (#289735)
* Wed Jul 04 2007 dmueller@suse.de
- suppress %%config check for now (#286231)
* Wed Jun 27 2007 dmueller@suse.de
- fix typo in devel-rpmgroup check
* Mon Jun 25 2007 dmueller@suse.de
- another update list of legacy packages
* Sat Jun 23 2007 dmueller@suse.de
- update list of legacy packages
* Fri Jun 22 2007 dmueller@suse.de
- suppressions for mono related packages (#282121)
* Fri Jun 22 2007 dmueller@suse.de
- fix the bzip2/gzip confusion again
* Fri Jun 22 2007 dmueller@suse.de
- update list of legacy packages
* Fri Jun 22 2007 dmueller@suse.de
- add list of legacy package names with non-policy conform
package name
- check updates from SVN
* Thu Jun 21 2007 dmueller@suse.de
- suppression update
- suppress devel-file-in-non-devel package if its just a compat
symlink to another .so
- avoid unstripped binaries warnings in BETA
- fix filesystem lint false positives
* Wed Jun 13 2007 dmueller@suse.de
- suppression update
- add descriptions to sysv5 init checks
- use readelf for binary info to improve performace
- check if source patch/tarballs is not bzip2'ed and bigger
than 100k (suse packaging conventions requirement)
- check if package contains excessive sized documentation
* Mon Jun 11 2007 dmueller@suse.de
- hide errors related to .packlist files from perl
still need to figure out though why they're there
* Mon Jun 11 2007 dmueller@suse.de
- fix build
* Sat Jun 09 2007 dmueller@suse.de
- make the buildroot check work
- make the buildroot check factor 10-15 faster
- fix the pkgconfig check
* Fri Jun 08 2007 dmueller@suse.de
- fix warning-hide hack (#279865)
- description update
* Fri Jun 08 2007 dmueller@suse.de
- hide unstripped-binary-or-object warning outside build (#279865)
- fix typo in library policy check
- adopt library checks for suse library packaging policy
- add check for unnecessarily packaged files
- description update
- suppression update
* Thu May 31 2007 dmueller@suse.de
- suppression update
- fix various checks
- add checks for init scripts
* Wed May 30 2007 dmueller@suse.de
- update LibraryPolicy Checker
* Tue May 29 2007 dmueller@suse.de
- suppression update
- fix XDG menu checker to also include non-/usr paths
- fix ghost-file-creation check to skip missingok files (#278761)
* Mon May 28 2007 dmueller@suse.de
- suppression-update
- Library Policy Checker crash fixes (#278592)
* Sat May 26 2007 dmueller@suse.de
- add description for missing lsb tags check
- fix obsolete-not-provided for yast2-provides
- fix devel-file check matching module names (e.g. apache2)
* Sat May 26 2007 dmueller@suse.de
- avoid spurious executable warnings for docdatadir/examples
- add LibraryPolicy checker from Richard (warning only)
- suppression update
* Thu May 24 2007 dmueller@suse.de
- fix suppression for qa_ packages
- fix exceptions caused by DesktopTranslation check
- fix crash caused by trailing colons in requires
* Thu May 24 2007 dmueller@suse.de
- fix file paths in Duplicate and DesktopTranslation checks
* Thu May 24 2007 dmueller@suse.de
- update sourced-dirs list
- add some more standard users
- add suppression for devel-file-in-non-devel package in java
- filter some more noise
* Wed May 23 2007 dmueller@suse.de
- add descriptions for obsolete suse version check
- suppress some more noise
- don't run duplicates check for source rpms
* Wed May 23 2007 dmueller@suse.de
- suppress errors for cross-avr-*
- suppress devel-packaging-naming errors for gcc41, gcc42
* Wed May 23 2007 dmueller@suse.de
- group output by check and put errors last (#276943)
- suppress some more noise (#277308)
- suppress %%ifarch-applied-patch (#277316)
- more suppressions for misnamed devel packages (#277317)
* Wed May 23 2007 dmueller@suse.de
- Suppress errors about platform dependent code in /usr/share
if its inside a platform-dependant subdirectory
- Suppress devel-file-in-non-devel-package for systemtap (#277338)
- Make sure that the package fails if there is any syntax
error anywhere
* Wed May 23 2007 dmueller@suse.de
- typo fix
* Tue May 22 2007 dmueller@suse.de
- update config
* Sat May 19 2007 coolo@suse.de
- add three more checks
* Fri May 18 2007 dmueller@suse.de
- update Duplicates Check to not crash on ghost files
* Wed May 16 2007 dmueller@suse.de
- suppress bzip2 related warnings
- no documentation for lib packages
* Tue May 15 2007 coolo@suse.de
- add a check how much space is wasted by duplicated files
* Mon May 14 2007 dmueller@suse.de
- remove rpm-devel requirement
- add check for filerequires on /usr/bin/env
- fix syntax errors in previous change
* Mon May 14 2007 coolo@suse.de
- add a check for /opt/kde3 not in %%doc or in %%lang
- fix files not in %%lang check
* Wed May 09 2007 dmueller@suse.de
- remove tabs from sources
* Mon May 07 2007 dmueller@suse.de
- fix desktop file check (#252482)
* Sat May 05 2007 dmueller@suse.de
- allow extensions to LSB starting with "X-" (#271495)
* Fri May 04 2007 dmueller@suse.de
- remove check for usedforbuild tag. magic happens and
it is created automatically
* Thu Apr 19 2007 dmueller@suse.de
- add spec checks for obsolete suse hacks
* Wed Apr 18 2007 dmueller@suse.de
- update to 0.80:
* many more checks
- suppression updates
* Thu Apr 05 2007 dmueller@suse.de
- suppressions for OpenOffice and linux-kernel-headers
* Thu Apr 05 2007 dmueller@suse.de
- update suppressions
* Wed Nov 08 2006 dmueller@suse.de
- fix compatibility with rpm-python of sles9 (#216081)
* Mon Sep 11 2006 dmueller@suse.de
- update to 0.77:
* updated checks regarding FHS compliance
* some python-lint fixlets
* Wed Apr 12 2006 dmueller@suse.de
- update to 0.76
* Fri Mar 24 2006 dmueller@suse.de
- update to 0.75
* Tue Mar 21 2006 dmueller@suse.de
- suppress some glibc related errors (#157906)
* Wed Feb 22 2006 dmueller@suse.de
- add km to the list of valid locales
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Jan 09 2006 dmueller@suse.de
- add check for untranslated desktop files
* Tue Dec 20 2005 dmueller@suse.de
- fix i18n subdir check
* Thu Dec 15 2005 dmueller@suse.de
- filter init-script-name-with-dot /etc/init.d/boot.* and
script-without-shellbang /etc/profile.d/*
* Thu Nov 24 2005 dmueller@suse.de
- update to 0.71
- strip "requires-on-release" for now, too much noise
* Fri Jul 22 2005 dmueller@suse.de
- ignore dir-or-file-in-opt
* Mon Jun 20 2005 coolo@suse.de
- update to 0.70
* Thu Jun 16 2005 dmueller@suse.de
- upgrade to rpmlint 0.69
- split out the config file from the SUSE patch
* Thu Nov 11 2004 coolo@suse.de
- remove some MDK specific tests and add some SUSE specific tests
* Mon Feb 23 2004 hmacht@suse.de
- building as non-root
* Wed Jun 11 2003 coolo@suse.de
- initial version

View File

@ -0,0 +1,11 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -1107,7 +1107,7 @@
# ...but executed ones should
elif res or mode & 0111 != 0 or script_regex.search(f):
if res:
- if not interpreter_regex.search(res.group(1)):
+ if mode & 0111 != 0 and not interpreter_regex.search(res.group(1)):
printError(pkg, 'wrong-script-interpreter', f, '"' + res.group(1) + '"')
elif not nonexec_file and not (lib_path_regex.search(f) and f.endswith('.la')):
printError(pkg, 'script-without-shebang', f)

11
sourced-dirs.diff Normal file
View File

@ -0,0 +1,11 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -683,7 +683,7 @@
shebang_regex=re.compile('^#!\s*(\S*)')
interpreter_regex=re.compile('^/(usr/)?s?bin/[^/]+$')
script_regex=re.compile('^/((usr/)?s?bin|etc/(rc\.d/init\.d|X11/xinit\.d|cron\.(hourly|daily|monthly|weekly)))/')
-sourced_script_regex=re.compile('^/etc/(bash_completion\.d|profile\.d)/')
+sourced_script_regex=re.compile('^(/etc/(bash_completion\.d|profile\.d)|/sbin/conf.d)/')
use_utf8=Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
meta_package_re=re.compile(Config.getOption('MetaPackageRegexp', '^(bundle|task)-'))
filesys_packages = ['filesystem'] # TODO: make configurable?

67
stricter-tags-check.diff Normal file
View File

@ -0,0 +1,67 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -507,7 +507,7 @@ class TagsCheck(AbstractCheck.AbstractCheck):
printError(pkg, 'explicit-lib-dependency', d[0])
if d[2] == rpm.RPMSENSE_EQUAL and string.find(d[1], '-') != -1:
printWarning(pkg, 'requires-on-release', d[0], d[1])
- if string.find(d[1], '%') != -1:
+ if string.find(d[1], '%') != -1 or string.find(d[0], '%') != -1:
printError(pkg, 'percent-in-dependency', d[0], d[1])
if not name:
@@ -665,29 +665,39 @@ class TagsCheck(AbstractCheck.AbstractCheck):
obs=map(lambda x: x[0], pkg.obsoletes())
provs=map(lambda x: x[0].split(':/')[0], pkg.provides())
+ reqs=map(lambda x: x[0], pkg.requires() + pkg.prereq())
if pkg.name in obs:
printError(pkg, 'obsolete-on-name')
for o in obs:
if not o in provs:
printWarning(pkg, 'obsolete-not-provided', o)
for o in pkg.obsoletes():
- if string.find(o[1], '%') != -1:
+ if string.find(o[1], '%') != -1 or string.find(o[0], '%') != -1:
printError(pkg, 'percent-in-obsoletes', o[0], o[1])
- useless_provides=[]
+ useless_provides=set()
for p in provs:
if provs.count(p) != 1:
if p not in useless_provides:
- useless_provides.append(p)
+ useless_provides.add(p)
for p in useless_provides:
printError(pkg, 'useless-explicit-provides',p)
+ useless_reqs=set()
+ for r in reqs:
+ if not r in useless_reqs:
+ useless_reqs.add(r)
+ else:
+ if r[0] != '/':
+ printWarning(pkg, 'useless-explicit-requires', r)
for p in pkg.provides():
- if string.find(p[1], '%') != -1:
+ if string.find(p[1], '%') != -1 or string.find(p[0], '%') != -1:
printError(pkg, 'percent-in-provides', p[0], p[1])
+ if p[0] == pkg.name and not p[1]:
+ printError(pkg, 'unversioned-explicit-self-provides', p)
for c in pkg.conflicts():
- if string.find(c[1], '%') != -1:
+ if string.find(c[1], '%') != -1 or string.find(c[0], '%') != -1:
printError(pkg, 'percent-in-conflicts', c[0], c[1])
expected='%s-%s-%s.%s.rpm' % (name, version, release, pkg.arch)
@@ -877,6 +887,10 @@ explicit Requires: tags.''',
'''This package provides 2 times the same capacity. It should only provide it
once.''',
+'unversioned-explicit-self-provides',
+'''This package provides it's own name explicitely, which might break
+upgrade path. self-provides are autogenerated. Remove the provide.''',
+
'obsolete-on-name',
'''A package should not obsolete itself, as it can cause weird errors in tools.''',

View File

@ -0,0 +1,11 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -651,7 +651,7 @@
bin_regex=re.compile('^(/usr)?/s?bin/')
includefile_regex=re.compile('\.(c|h|a|cmi)$')
buildconfigfile_regex=re.compile('(\.pc|/bin/.+-config)$')
-sofile_regex=re.compile('/lib(64)?/[^/]+\.so$')
+sofile_regex=re.compile('/lib(64)?(?:/.+)?/lib[^/]+\.so$')
devel_regex=re.compile('(.*)-(debug(info)?|devel|source|static)$')
debuginfo_package_regex=re.compile('-debug(info)?$')
lib_regex=re.compile('lib(64)?/lib[^/]*\.so\..*')

View File

@ -0,0 +1,20 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -971,7 +971,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
if not perl_dep_error:
res=perl_regex.search(f)
- if res:
+ if res and not pkg.name in ('perl', 'perl-base'):
if perl_version_trick:
vers = res.group(1) + '.' + res.group(2)
else:
@@ -981,7 +981,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
printError(pkg, 'no-dependency-on', 'perl-base', vers)
perl_dep_error=1
- if not python_dep_error:
+ if not python_dep_error and not pkg.name in ('python', 'python-base'):
res=python_regex.search(f)
if res:
if not (pkg.check_versioned_dep('python-base', res.group(1)) or

View File

@ -0,0 +1,33 @@
--- SourceCheck.py
+++ SourceCheck.py
@@ -14,7 +14,7 @@
DEFAULT_VALID_SRC_PERMS=(0644, 0755)
-source_regex=re.compile('\\.(tar|patch|tgz|diff)$')
+source_regex=re.compile('\\.(tar|patch|tgz|tar\.gz|dif||diff)$')
use_bzip2=Config.getOption('UseBzip2', 1)
valid_src_perms=Config.getOption("ValidSrcPerms", DEFAULT_VALID_SRC_PERMS)
@@ -38,7 +38,7 @@
printError(pkg, 'multiple-specfiles', spec_file, f)
else:
spec_file=f
- elif source_regex.search(f):
+ elif source_regex.search(f) and files[f][4] > 120*1024:
if use_bzip2:
if not f.endswith('.bz2'):
printWarning(pkg, 'source-or-patch-not-bzipped', f)
@@ -59,8 +59,10 @@
all your RPM information.''',
'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.''',
+'''A source archive or patch in your package is not bzipped (doesn't
+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

10
suse-checks.diff Normal file
View File

@ -0,0 +1,10 @@
--- Config.py
+++ Config.py
@@ -17,7 +17,6 @@
"FilesCheck",
"DocFilesCheck",
"FHSCheck",
- "SignatureCheck",
"I18NCheck",
"MenuCheck",
"PostCheck",

View File

@ -0,0 +1,11 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -515,7 +515,7 @@
break
if has_so:
for d in deps:
- if d[0] == base:
+ if d[0].startswith(base):
dep=d
break
if not dep:

640
suse-filesystem.diff Normal file
View File

@ -0,0 +1,640 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -26,65 +26,114 @@
'/',
'/bin',
'/boot',
+ '/dev',
'/etc',
+ '/etc/SuSEconfig',
'/etc/X11',
+ '/etc/aliases.d',
+ '/etc/cron.d',
+ '/etc/cron.daily',
+ '/etc/cron.hourly',
+ '/etc/cron.monthly',
+ '/etc/cron.weekly',
+ '/etc/cups',
+ '/etc/default',
+ '/etc/init.d',
+ '/etc/init.d/boot.d',
+ '/etc/init.d/rc0.d',
+ '/etc/init.d/rc1.d',
+ '/etc/init.d/rc2.d',
+ '/etc/init.d/rc3.d',
+ '/etc/init.d/rc4.d',
+ '/etc/init.d/rc5.d',
+ '/etc/init.d/rc6.d',
+ '/etc/init.d/rcS.d',
+ '/etc/java',
+ '/etc/ld.so.conf.d',
+ '/etc/logrotate.d',
+ '/etc/news',
'/etc/opt',
+ '/etc/permissions.d',
+ '/etc/ppp',
+ '/etc/ppp/ip-down.d',
+ '/etc/ppp/ip-up.d',
'/etc/profile.d',
+ '/etc/rc.d',
'/etc/skel',
+ '/etc/susehelp.d',
+ '/etc/susehelp.d/htdig',
+ '/etc/sysconfig',
+ '/etc/sysconfig/SuSEfirewall2.d',
+ '/etc/sysconfig/SuSEfirewall2.d/services',
+ '/etc/sysconfig/network',
+ '/etc/sysconfig/network/if-down.d',
+ '/etc/sysconfig/network/if-up.d',
+ '/etc/sysconfig/network/providers',
+ '/etc/sysconfig/network/scripts',
+ '/etc/sysconfig/scripts',
+ '/etc/uucp',
+ '/etc/xdg',
+ '/etc/xdg/autostart',
'/etc/xinetd.d',
'/home',
'/lib',
+ '/lib/YaST',
+ '/lib/firmware',
+ '/lib/lsb',
'/lib/modules',
'/lib64',
+ '/lib64/YaST',
+ '/lib64/firmware',
+ '/lib64/lsb',
+ '/lib64/modules',
'/media',
+ '/media/cdrom',
+ '/media/floppy',
'/mnt',
- '/mnt/cdrom',
- '/mnt/disk',
- '/mnt/floppy',
'/opt',
'/proc',
'/root',
+ '/root/.gnupg',
+ '/root/bin',
'/sbin',
- '/selinux',
+ '/sbin/conf.d',
'/srv',
+ '/srv/ftp',
+ '/srv/www',
+ '/srv/www/cgi-bin',
+ '/srv/www/htdocs',
'/sys',
'/tmp',
+ '/tmp/.ICE-unix',
+ '/tmp/.X11-unix',
'/usr',
'/usr/X11R6',
'/usr/X11R6/bin',
- '/usr/X11R6/doc',
- '/usr/X11R6/include',
'/usr/X11R6/lib',
- '/usr/X11R6/lib64',
- '/usr/X11R6/man',
- '/usr/X11R6/man/man1',
- '/usr/X11R6/man/man2',
- '/usr/X11R6/man/man3',
- '/usr/X11R6/man/man4',
- '/usr/X11R6/man/man5',
- '/usr/X11R6/man/man6',
- '/usr/X11R6/man/man7',
- '/usr/X11R6/man/man8',
- '/usr/X11R6/man/man9',
- '/usr/X11R6/man/mann',
'/usr/bin',
- '/usr/bin/X11',
- '/usr/etc',
'/usr/games',
+ '/usr/i586-suse-linux',
+ '/usr/i586-suse-linux/bin',
+ '/usr/i586-suse-linux/include',
+ '/usr/i586-suse-linux/lib',
'/usr/include',
+ '/usr/include/X11',
'/usr/lib',
'/usr/lib/X11',
- '/usr/lib/games',
- '/usr/lib/gcc-lib',
- '/usr/lib/menu',
+ '/usr/lib/browser-plugins',
+ '/usr/lib/lsb',
+ '/usr/lib/news',
+ '/usr/lib/pkgconfig',
'/usr/lib64',
- '/usr/lib64/gcc-lib',
+ '/usr/lib64/X11',
+ '/usr/lib64/browser-plugins',
+ '/usr/lib64/lsb',
+ '/usr/lib64/news',
+ '/usr/lib64/pkgconfig',
'/usr/local',
'/usr/local/bin',
- '/usr/local/doc',
- '/usr/local/etc',
'/usr/local/games',
- '/usr/local/info',
+ '/usr/local/include',
'/usr/local/lib',
'/usr/local/lib64',
'/usr/local/man',
@@ -100,24 +149,417 @@
'/usr/local/man/mann',
'/usr/local/sbin',
'/usr/local/share',
- '/usr/local/share/man',
- '/usr/local/share/man/man1',
- '/usr/local/share/man/man2',
- '/usr/local/share/man/man3',
- '/usr/local/share/man/man4',
- '/usr/local/share/man/man5',
- '/usr/local/share/man/man6',
- '/usr/local/share/man/man7',
- '/usr/local/share/man/man8',
- '/usr/local/share/man/man9',
- '/usr/local/share/man/mann',
'/usr/local/src',
'/usr/sbin',
'/usr/share',
+ '/usr/share/applications',
'/usr/share/dict',
'/usr/share/doc',
+ '/usr/share/doc/packages',
+ '/usr/share/fonts',
+ '/usr/share/games',
'/usr/share/icons',
'/usr/share/info',
+ '/usr/share/java',
+ '/usr/share/locale',
+ '/usr/share/locale/aa',
+ '/usr/share/locale/aa/LC_MESSAGES',
+ '/usr/share/locale/af',
+ '/usr/share/locale/af/LC_MESSAGES',
+ '/usr/share/locale/am',
+ '/usr/share/locale/am/LC_MESSAGES',
+ '/usr/share/locale/ang',
+ '/usr/share/locale/ang/LC_MESSAGES',
+ '/usr/share/locale/ar',
+ '/usr/share/locale/ar/LC_MESSAGES',
+ '/usr/share/locale/as',
+ '/usr/share/locale/as/LC_MESSAGES',
+ '/usr/share/locale/az',
+ '/usr/share/locale/az/LC_MESSAGES',
+ '/usr/share/locale/az_IR',
+ '/usr/share/locale/az_IR/LC_MESSAGES',
+ '/usr/share/locale/be',
+ '/usr/share/locale/be/LC_MESSAGES',
+ '/usr/share/locale/be@latin',
+ '/usr/share/locale/be@latin/LC_MESSAGES',
+ '/usr/share/locale/bg',
+ '/usr/share/locale/bg/LC_MESSAGES',
+ '/usr/share/locale/bn',
+ '/usr/share/locale/bn/LC_MESSAGES',
+ '/usr/share/locale/bn_IN',
+ '/usr/share/locale/bn_IN/LC_MESSAGES',
+ '/usr/share/locale/bo',
+ '/usr/share/locale/bo/LC_MESSAGES',
+ '/usr/share/locale/br',
+ '/usr/share/locale/br/LC_MESSAGES',
+ '/usr/share/locale/bs',
+ '/usr/share/locale/bs/LC_MESSAGES',
+ '/usr/share/locale/byn',
+ '/usr/share/locale/byn/LC_MESSAGES',
+ '/usr/share/locale/ca',
+ '/usr/share/locale/ca/LC_MESSAGES',
+ '/usr/share/locale/ca@valencia',
+ '/usr/share/locale/ca@valencia/LC_MESSAGES',
+ '/usr/share/locale/cs',
+ '/usr/share/locale/cs/LC_MESSAGES',
+ '/usr/share/locale/cs_CZ',
+ '/usr/share/locale/cs_CZ/LC_MESSAGES',
+ '/usr/share/locale/cy',
+ '/usr/share/locale/cy/LC_MESSAGES',
+ '/usr/share/locale/da',
+ '/usr/share/locale/da/LC_MESSAGES',
+ '/usr/share/locale/de',
+ '/usr/share/locale/de/LC_MESSAGES',
+ '/usr/share/locale/de_AT',
+ '/usr/share/locale/de_AT/LC_MESSAGES',
+ '/usr/share/locale/de_CH',
+ '/usr/share/locale/de_CH/LC_MESSAGES',
+ '/usr/share/locale/de_DE',
+ '/usr/share/locale/de_DE/LC_MESSAGES',
+ '/usr/share/locale/dv',
+ '/usr/share/locale/dv/LC_MESSAGES',
+ '/usr/share/locale/dz',
+ '/usr/share/locale/dz/LC_MESSAGES',
+ '/usr/share/locale/ee',
+ '/usr/share/locale/ee/LC_MESSAGES',
+ '/usr/share/locale/el',
+ '/usr/share/locale/el/LC_MESSAGES',
+ '/usr/share/locale/el_GR',
+ '/usr/share/locale/el_GR/LC_MESSAGES',
+ '/usr/share/locale/en',
+ '/usr/share/locale/en/LC_MESSAGES',
+ '/usr/share/locale/en@IPA',
+ '/usr/share/locale/en@IPA/LC_MESSAGES',
+ '/usr/share/locale/en@boldquot',
+ '/usr/share/locale/en@boldquot/LC_MESSAGES',
+ '/usr/share/locale/en@quot',
+ '/usr/share/locale/en@quot/LC_MESSAGES',
+ '/usr/share/locale/en_AU',
+ '/usr/share/locale/en_AU/LC_MESSAGES',
+ '/usr/share/locale/en_CA',
+ '/usr/share/locale/en_CA/LC_MESSAGES',
+ '/usr/share/locale/en_GB',
+ '/usr/share/locale/en_GB/LC_MESSAGES',
+ '/usr/share/locale/en_US',
+ '/usr/share/locale/en_US/LC_MESSAGES',
+ '/usr/share/locale/eo',
+ '/usr/share/locale/eo/LC_MESSAGES',
+ '/usr/share/locale/es',
+ '/usr/share/locale/es/LC_MESSAGES',
+ '/usr/share/locale/es_AR',
+ '/usr/share/locale/es_AR/LC_MESSAGES',
+ '/usr/share/locale/es_CL',
+ '/usr/share/locale/es_CL/LC_MESSAGES',
+ '/usr/share/locale/es_CO',
+ '/usr/share/locale/es_CO/LC_MESSAGES',
+ '/usr/share/locale/es_CR',
+ '/usr/share/locale/es_CR/LC_MESSAGES',
+ '/usr/share/locale/es_DO',
+ '/usr/share/locale/es_DO/LC_MESSAGES',
+ '/usr/share/locale/es_EC',
+ '/usr/share/locale/es_EC/LC_MESSAGES',
+ '/usr/share/locale/es_ES',
+ '/usr/share/locale/es_ES/LC_MESSAGES',
+ '/usr/share/locale/es_GT',
+ '/usr/share/locale/es_GT/LC_MESSAGES',
+ '/usr/share/locale/es_HN',
+ '/usr/share/locale/es_HN/LC_MESSAGES',
+ '/usr/share/locale/es_MX',
+ '/usr/share/locale/es_MX/LC_MESSAGES',
+ '/usr/share/locale/es_NI',
+ '/usr/share/locale/es_NI/LC_MESSAGES',
+ '/usr/share/locale/es_PA',
+ '/usr/share/locale/es_PA/LC_MESSAGES',
+ '/usr/share/locale/es_PE',
+ '/usr/share/locale/es_PE/LC_MESSAGES',
+ '/usr/share/locale/es_PR',
+ '/usr/share/locale/es_PR/LC_MESSAGES',
+ '/usr/share/locale/es_SV',
+ '/usr/share/locale/es_SV/LC_MESSAGES',
+ '/usr/share/locale/es_UY',
+ '/usr/share/locale/es_UY/LC_MESSAGES',
+ '/usr/share/locale/es_VE',
+ '/usr/share/locale/es_VE/LC_MESSAGES',
+ '/usr/share/locale/et',
+ '/usr/share/locale/et/LC_MESSAGES',
+ '/usr/share/locale/et_EE',
+ '/usr/share/locale/et_EE/LC_MESSAGES',
+ '/usr/share/locale/eu',
+ '/usr/share/locale/eu/LC_MESSAGES',
+ '/usr/share/locale/eu_ES',
+ '/usr/share/locale/eu_ES/LC_MESSAGES',
+ '/usr/share/locale/fa',
+ '/usr/share/locale/fa/LC_MESSAGES',
+ '/usr/share/locale/fi',
+ '/usr/share/locale/fi/LC_MESSAGES',
+ '/usr/share/locale/fi_FI',
+ '/usr/share/locale/fi_FI/LC_MESSAGES',
+ '/usr/share/locale/fo',
+ '/usr/share/locale/fo/LC_MESSAGES',
+ '/usr/share/locale/fr',
+ '/usr/share/locale/fr/LC_MESSAGES',
+ '/usr/share/locale/fr_CA',
+ '/usr/share/locale/fr_CA/LC_MESSAGES',
+ '/usr/share/locale/fr_CH',
+ '/usr/share/locale/fr_CH/LC_MESSAGES',
+ '/usr/share/locale/fr_FR',
+ '/usr/share/locale/fr_FR/LC_MESSAGES',
+ '/usr/share/locale/fy',
+ '/usr/share/locale/fy/LC_MESSAGES',
+ '/usr/share/locale/ga',
+ '/usr/share/locale/ga/LC_MESSAGES',
+ '/usr/share/locale/gd',
+ '/usr/share/locale/gd/LC_MESSAGES',
+ '/usr/share/locale/gez',
+ '/usr/share/locale/gez/LC_MESSAGES',
+ '/usr/share/locale/gl',
+ '/usr/share/locale/gl/LC_MESSAGES',
+ '/usr/share/locale/gn',
+ '/usr/share/locale/gn/LC_MESSAGES',
+ '/usr/share/locale/gr',
+ '/usr/share/locale/gr/LC_MESSAGES',
+ '/usr/share/locale/gu',
+ '/usr/share/locale/gu/LC_MESSAGES',
+ '/usr/share/locale/gv',
+ '/usr/share/locale/gv/LC_MESSAGES',
+ '/usr/share/locale/haw',
+ '/usr/share/locale/haw/LC_MESSAGES',
+ '/usr/share/locale/he',
+ '/usr/share/locale/he/LC_MESSAGES',
+ '/usr/share/locale/hi',
+ '/usr/share/locale/hi/LC_MESSAGES',
+ '/usr/share/locale/hr',
+ '/usr/share/locale/hr/LC_MESSAGES',
+ '/usr/share/locale/hu',
+ '/usr/share/locale/hu/LC_MESSAGES',
+ '/usr/share/locale/hy',
+ '/usr/share/locale/hy/LC_MESSAGES',
+ '/usr/share/locale/ia',
+ '/usr/share/locale/ia/LC_MESSAGES',
+ '/usr/share/locale/id',
+ '/usr/share/locale/id/LC_MESSAGES',
+ '/usr/share/locale/is',
+ '/usr/share/locale/is/LC_MESSAGES',
+ '/usr/share/locale/it',
+ '/usr/share/locale/it/LC_MESSAGES',
+ '/usr/share/locale/it_CH',
+ '/usr/share/locale/it_CH/LC_MESSAGES',
+ '/usr/share/locale/it_IT',
+ '/usr/share/locale/it_IT/LC_MESSAGES',
+ '/usr/share/locale/iu',
+ '/usr/share/locale/iu/LC_MESSAGES',
+ '/usr/share/locale/ja',
+ '/usr/share/locale/ja/LC_MESSAGES',
+ '/usr/share/locale/ja_JP.EUC',
+ '/usr/share/locale/ja_JP.EUC/LC_MESSAGES',
+ '/usr/share/locale/ja_JP.SJIS',
+ '/usr/share/locale/ja_JP.SJIS/LC_MESSAGES',
+ '/usr/share/locale/ja_JP.eucJP',
+ '/usr/share/locale/ja_JP.eucJP/LC_MESSAGES',
+ '/usr/share/locale/ka',
+ '/usr/share/locale/ka/LC_MESSAGES',
+ '/usr/share/locale/kk',
+ '/usr/share/locale/kk/LC_MESSAGES',
+ '/usr/share/locale/kl',
+ '/usr/share/locale/kl/LC_MESSAGES',
+ '/usr/share/locale/km',
+ '/usr/share/locale/km/LC_MESSAGES',
+ '/usr/share/locale/kn',
+ '/usr/share/locale/kn/LC_MESSAGES',
+ '/usr/share/locale/ko',
+ '/usr/share/locale/ko/LC_MESSAGES',
+ '/usr/share/locale/kok',
+ '/usr/share/locale/kok/LC_MESSAGES',
+ '/usr/share/locale/ku',
+ '/usr/share/locale/ku/LC_MESSAGES',
+ '/usr/share/locale/kw',
+ '/usr/share/locale/kw/LC_MESSAGES',
+ '/usr/share/locale/ky',
+ '/usr/share/locale/ky/LC_MESSAGES',
+ '/usr/share/locale/lg',
+ '/usr/share/locale/lg/LC_MESSAGES',
+ '/usr/share/locale/li',
+ '/usr/share/locale/li/LC_MESSAGES',
+ '/usr/share/locale/lo',
+ '/usr/share/locale/lo/LC_MESSAGES',
+ '/usr/share/locale/lt',
+ '/usr/share/locale/lt/LC_MESSAGES',
+ '/usr/share/locale/lv',
+ '/usr/share/locale/lv/LC_MESSAGES',
+ '/usr/share/locale/mg',
+ '/usr/share/locale/mg/LC_MESSAGES',
+ '/usr/share/locale/mi',
+ '/usr/share/locale/mi/LC_MESSAGES',
+ '/usr/share/locale/mk',
+ '/usr/share/locale/mk/LC_MESSAGES',
+ '/usr/share/locale/ml',
+ '/usr/share/locale/ml/LC_MESSAGES',
+ '/usr/share/locale/mn',
+ '/usr/share/locale/mn/LC_MESSAGES',
+ '/usr/share/locale/mr',
+ '/usr/share/locale/mr/LC_MESSAGES',
+ '/usr/share/locale/ms',
+ '/usr/share/locale/ms/LC_MESSAGES',
+ '/usr/share/locale/mt',
+ '/usr/share/locale/mt/LC_MESSAGES',
+ '/usr/share/locale/my',
+ '/usr/share/locale/my/LC_MESSAGES',
+ '/usr/share/locale/nb',
+ '/usr/share/locale/nb/LC_MESSAGES',
+ '/usr/share/locale/nb_NO',
+ '/usr/share/locale/nb_NO/LC_MESSAGES',
+ '/usr/share/locale/nds',
+ '/usr/share/locale/nds/LC_MESSAGES',
+ '/usr/share/locale/ne',
+ '/usr/share/locale/ne/LC_MESSAGES',
+ '/usr/share/locale/nl',
+ '/usr/share/locale/nl/LC_MESSAGES',
+ '/usr/share/locale/nl_BE',
+ '/usr/share/locale/nl_BE/LC_MESSAGES',
+ '/usr/share/locale/nn',
+ '/usr/share/locale/nn/LC_MESSAGES',
+ '/usr/share/locale/nn_NO',
+ '/usr/share/locale/nn_NO/LC_MESSAGES',
+ '/usr/share/locale/nso',
+ '/usr/share/locale/nso/LC_MESSAGES',
+ '/usr/share/locale/oc',
+ '/usr/share/locale/oc/LC_MESSAGES',
+ '/usr/share/locale/om',
+ '/usr/share/locale/om/LC_MESSAGES',
+ '/usr/share/locale/or',
+ '/usr/share/locale/or/LC_MESSAGES',
+ '/usr/share/locale/pa',
+ '/usr/share/locale/pa/LC_MESSAGES',
+ '/usr/share/locale/pl',
+ '/usr/share/locale/pl/LC_MESSAGES',
+ '/usr/share/locale/pl_PL',
+ '/usr/share/locale/pl_PL/LC_MESSAGES',
+ '/usr/share/locale/ps',
+ '/usr/share/locale/ps/LC_MESSAGES',
+ '/usr/share/locale/pt',
+ '/usr/share/locale/pt/LC_MESSAGES',
+ '/usr/share/locale/pt_BR',
+ '/usr/share/locale/pt_BR/LC_MESSAGES',
+ '/usr/share/locale/pt_PT',
+ '/usr/share/locale/pt_PT/LC_MESSAGES',
+ '/usr/share/locale/rm',
+ '/usr/share/locale/rm/LC_MESSAGES',
+ '/usr/share/locale/ro',
+ '/usr/share/locale/ro/LC_MESSAGES',
+ '/usr/share/locale/ru',
+ '/usr/share/locale/ru/LC_MESSAGES',
+ '/usr/share/locale/ru_RU',
+ '/usr/share/locale/ru_RU/LC_MESSAGES',
+ '/usr/share/locale/ru_UA.koi8u',
+ '/usr/share/locale/ru_UA.koi8u/LC_MESSAGES',
+ '/usr/share/locale/rw',
+ '/usr/share/locale/rw/LC_MESSAGES',
+ '/usr/share/locale/sa',
+ '/usr/share/locale/sa/LC_MESSAGES',
+ '/usr/share/locale/se',
+ '/usr/share/locale/se/LC_MESSAGES',
+ '/usr/share/locale/si',
+ '/usr/share/locale/si/LC_MESSAGES',
+ '/usr/share/locale/sid',
+ '/usr/share/locale/sid/LC_MESSAGES',
+ '/usr/share/locale/sk',
+ '/usr/share/locale/sk/LC_MESSAGES',
+ '/usr/share/locale/sl',
+ '/usr/share/locale/sl/LC_MESSAGES',
+ '/usr/share/locale/sl_SI',
+ '/usr/share/locale/sl_SI/LC_MESSAGES',
+ '/usr/share/locale/so',
+ '/usr/share/locale/so/LC_MESSAGES',
+ '/usr/share/locale/sp',
+ '/usr/share/locale/sp/LC_MESSAGES',
+ '/usr/share/locale/sq',
+ '/usr/share/locale/sq/LC_MESSAGES',
+ '/usr/share/locale/sq_AL',
+ '/usr/share/locale/sq_AL/LC_MESSAGES',
+ '/usr/share/locale/sr',
+ '/usr/share/locale/sr/LC_MESSAGES',
+ '/usr/share/locale/sr@Latn',
+ '/usr/share/locale/sr@Latn/LC_MESSAGES',
+ '/usr/share/locale/sr@ije',
+ '/usr/share/locale/sr@ije/LC_MESSAGES',
+ '/usr/share/locale/ss',
+ '/usr/share/locale/ss/LC_MESSAGES',
+ '/usr/share/locale/st',
+ '/usr/share/locale/st/LC_MESSAGES',
+ '/usr/share/locale/sv',
+ '/usr/share/locale/sv/LC_MESSAGES',
+ '/usr/share/locale/sw',
+ '/usr/share/locale/sw/LC_MESSAGES',
+ '/usr/share/locale/syr',
+ '/usr/share/locale/syr/LC_MESSAGES',
+ '/usr/share/locale/ta',
+ '/usr/share/locale/ta/LC_MESSAGES',
+ '/usr/share/locale/te',
+ '/usr/share/locale/te/LC_MESSAGES',
+ '/usr/share/locale/tg',
+ '/usr/share/locale/tg/LC_MESSAGES',
+ '/usr/share/locale/th',
+ '/usr/share/locale/th/LC_MESSAGES',
+ '/usr/share/locale/ti',
+ '/usr/share/locale/ti/LC_MESSAGES',
+ '/usr/share/locale/tig',
+ '/usr/share/locale/tig/LC_MESSAGES',
+ '/usr/share/locale/tk',
+ '/usr/share/locale/tk/LC_MESSAGES',
+ '/usr/share/locale/tl',
+ '/usr/share/locale/tl/LC_MESSAGES',
+ '/usr/share/locale/tr',
+ '/usr/share/locale/tr/LC_MESSAGES',
+ '/usr/share/locale/tt',
+ '/usr/share/locale/tt/LC_MESSAGES',
+ '/usr/share/locale/ug',
+ '/usr/share/locale/ug/LC_MESSAGES',
+ '/usr/share/locale/uk',
+ '/usr/share/locale/uk/LC_MESSAGES',
+ '/usr/share/locale/uk_UA',
+ '/usr/share/locale/uk_UA/LC_MESSAGES',
+ '/usr/share/locale/ur',
+ '/usr/share/locale/ur/LC_MESSAGES',
+ '/usr/share/locale/urd',
+ '/usr/share/locale/urd/LC_MESSAGES',
+ '/usr/share/locale/uz',
+ '/usr/share/locale/uz/LC_MESSAGES',
+ '/usr/share/locale/uz@Cyrl',
+ '/usr/share/locale/uz@Cyrl/LC_MESSAGES',
+ '/usr/share/locale/uz@Latn',
+ '/usr/share/locale/uz@Latn/LC_MESSAGES',
+ '/usr/share/locale/ve',
+ '/usr/share/locale/ve/LC_MESSAGES',
+ '/usr/share/locale/ven',
+ '/usr/share/locale/ven/LC_MESSAGES',
+ '/usr/share/locale/vi',
+ '/usr/share/locale/vi/LC_MESSAGES',
+ '/usr/share/locale/wa',
+ '/usr/share/locale/wa/LC_MESSAGES',
+ '/usr/share/locale/wal',
+ '/usr/share/locale/wal/LC_MESSAGES',
+ '/usr/share/locale/wo',
+ '/usr/share/locale/wo/LC_MESSAGES',
+ '/usr/share/locale/xh',
+ '/usr/share/locale/xh/LC_MESSAGES',
+ '/usr/share/locale/yi',
+ '/usr/share/locale/yi/LC_MESSAGES',
+ '/usr/share/locale/yo',
+ '/usr/share/locale/yo/LC_MESSAGES',
+ '/usr/share/locale/zh',
+ '/usr/share/locale/zh/LC_MESSAGES',
+ '/usr/share/locale/zh_CN',
+ '/usr/share/locale/zh_CN.GB2312',
+ '/usr/share/locale/zh_CN.GB2312/LC_MESSAGES',
+ '/usr/share/locale/zh_CN/LC_MESSAGES',
+ '/usr/share/locale/zh_HK',
+ '/usr/share/locale/zh_HK/LC_MESSAGES',
+ '/usr/share/locale/zh_TW',
+ '/usr/share/locale/zh_TW.Big5',
+ '/usr/share/locale/zh_TW.Big5/LC_MESSAGES',
+ '/usr/share/locale/zh_TW/LC_MESSAGES',
+ '/usr/share/locale/zu',
+ '/usr/share/locale/zu/LC_MESSAGES',
'/usr/share/man',
'/usr/share/man/man1',
'/usr/share/man/man2',
@@ -129,28 +571,60 @@
'/usr/share/man/man8',
'/usr/share/man/man9',
'/usr/share/man/mann',
+ '/usr/share/mime',
+ '/usr/share/mime/packages',
'/usr/share/misc',
+ '/usr/share/nls',
+ '/usr/share/pixmaps',
+ '/usr/share/pkgconfig',
+ '/usr/share/sgml',
+ '/usr/share/sgml/docbook',
+ '/usr/share/sounds',
+ '/usr/share/themes',
+ '/usr/share/tmac',
+ '/usr/share/xml',
+ '/usr/share/xml/docbook',
+ '/usr/share/xsessions',
'/usr/src',
+ '/usr/src/packages',
'/usr/tmp',
'/var',
+ '/var/X11R6',
+ '/var/adm',
+ '/var/adm/SuSEconfig',
+ '/var/adm/SuSEconfig/bin',
+ '/var/adm/SuSEconfig/md5',
+ '/var/adm/backup',
+ '/var/adm/backup/rpmdb',
+ '/var/adm/backup/sysconfig',
+ '/var/adm/fillup-templates',
+ '/var/adm/perl-modules',
'/var/cache',
- '/var/db',
+ '/var/cache/fonts',
+ '/var/cache/man',
+ '/var/games',
'/var/lib',
- '/var/lib/games',
+ '/var/lib/empty',
'/var/lib/misc',
- '/var/lib/rpm',
- '/var/local',
+ '/var/lib/news',
+ '/var/lib/nobody',
+ '/var/lib/pam_devperm',
+ '/var/lib/wwwrun',
'/var/lock',
'/var/lock/subsys',
'/var/log',
'/var/mail',
- '/var/nis',
'/var/opt',
- '/var/preserve',
'/var/run',
'/var/spool',
+ '/var/spool/clientmqueue',
+ '/var/spool/locks',
+ '/var/spool/lpd',
'/var/spool/mail',
+ '/var/spool/uucp',
+ '/var/spool/uucp/uucp',
'/var/tmp',
+ '/var/tmp/vi.recover',
)
DEFAULT_GAMES_GROUPS='Games'

View File

@ -0,0 +1,21 @@
--- BinariesCheck.py
+++ BinariesCheck.py
@@ -16,6 +16,7 @@
import Config
import Pkg
import stat
+import os
DEFAULT_SYSTEM_LIB_PATHS=('/lib', '/usr/lib', '/usr/X11R6/lib',
'/lib64', '/usr/lib64', '/usr/X11R6/lib64')
@@ -193,7 +194,9 @@
# stripped ?
if not unstrippable.search(i[0]) and not is_ocaml_native:
- if not_stripped.search(i[1]):
+ if not_stripped.search(i[1]) and \
+ (os.environ.get('BUILD_IS_RUNNING', None) == None or \
+ os.environ.get('BUILD_DEBUG_FLAGS','').find('-g') != -1):
printWarning(pkg, 'unstripped-binary-or-object', i[0])
# inspect binary file

28
suse-no-run-ldconfig.diff Normal file
View File

@ -0,0 +1,28 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -359,6 +359,10 @@ class SpecCheck(AbstractCheck.AbstractCheck):
if scriptlet_requires_regex.search(line) and current_section == 'package':
printError(pkg, 'broken-syntax-in-scriptlet-requires', string.strip(line))
+ if current_section in ('post', 'postun'):
+ if line.find('%run_ldconfig') != -1:
+ printWarning(pkg, 'deprecated-use-of-%run_ldconfig')
+
if current_section == 'changelog':
res = macro_regex.search(line)
if res and len(res.group(1)) % 2:
@@ -572,6 +576,14 @@ will break short circuiting.''',
'''Make check or other automated regression test should be run in %check, as
they can be disabled with a rpm macro for short circuiting purposes.''',
+'deprecated-use-of-%run_ldconfig',
+'''According to the new SUSE Packaging Conventions, the use of %run_ldconfig
+is deprecated. use
+
+%post(un) -p /sbin/ldconfig
+
+instead.''',
+
'macro-in-%changelog',
'''Macros are expanded in %changelog too, which can in unfortunate cases lead
to the package not building at all, or other subtle unexpected conditions that

11
suse-spec-bzip2.diff Normal file
View File

@ -0,0 +1,11 @@
--- SourceCheck.py
+++ SourceCheck.py
@@ -39,7 +39,7 @@ class SourceCheck(AbstractCheck.AbstractCheck):
else:
spec_file=f
elif source_regex.search(f) and files[f][4] > 120*1024:
- if use_bzip2:
+ if True:
if not f.endswith('.bz2'):
printWarning(pkg, 'source-or-patch-not-bzipped', f)
else:

39
suse-version.diff Normal file
View File

@ -0,0 +1,39 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -47,6 +47,7 @@
buildprereq_regex = re.compile('^BuildPreReq:\s*(.+?)\s*$', re.IGNORECASE)
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
macro_regex = re.compile('(%+)[{(]?(\w+)')
+suse_version_regex = re.compile('%suse_version\s*[<>=]+\s*(\d+)')
# Only check for /lib, /usr/lib, /usr/X11R6/lib
# TODO: better handling of X libraries and modules.
@@ -287,6 +288,12 @@
if lib_package_regex.search(line):
lib = 1
+ res = suse_version_regex.search(line)
+ if res and int(res.group(1)) > 0 and int(res.group(1)) < 1010:
+ printWarning(pkg, "obsolete-suse-version-check", res.group(1))
+ elif res and int(res.group(1)) > 1100:
+ printError(pkg, "invalid-suse-version-check", res.group(1))
+
res = prereq_regex.search(line)
if res:
printWarning(pkg, 'prereq-use', res.group(2))
@@ -514,6 +521,15 @@
problems, restrict future package/provides naming, and may match something it
was originally not inteded to match -- make the Obsoletes versioned if
possible.''',
+
+'obsolete-suse-version-check',
+'''The specfile contains a comparison of %suse_version against a suse release
+that is no longer in maintenance. Consider removing obsolete parts of your
+spec file to make it more readable.''',
+
+'invalid-suse-version-check',
+'''The specfile contains a comparison of %suse_version against a suse release
+that does not exist. Please double check.'''
)
# SpecCheck.py ends here

10
syntax-validator.py Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/python
# vim:sw=4:et
import sys
for filename in sys.argv[1:]:
try:
compile(open(filename).read(), filename, 'exec')
except:
exit(1)

93
sysv5-init-checks.diff Normal file
View File

@ -0,0 +1,93 @@
--- InitScriptCheck.py
+++ InitScriptCheck.py
@@ -27,6 +27,8 @@
use_deflevels=Config.getOption('UseDefaultRunlevels', 1)
lsb_tags_regex = re.compile('^# ([\w-]+):\s*(.*?)\s*$')
lsb_cont_regex = re.compile('^#(?:\t| )(.*?)\s*$')
+insserv_regex=re.compile('^\s*sbin/insserv', re.MULTILINE)
+preun_regex=re.compile('^\s*/etc/init.d/\S+ stop', re.MULTILINE)
class InitScriptCheck(AbstractCheck.AbstractCheck):
@@ -39,6 +41,12 @@
return
initscript_list = []
+
+ # check chkconfig call in %post and %preun
+ postin=pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
+ preun=pkg[rpm.RPMTAG_PREUN] or pkg[rpm.RPMTAG_PREUNPROG]
+ postun=pkg[rpm.RPMTAG_POSTUN] or pkg[rpm.RPMTAG_POSTUNPROG]
+
for f in pkg.files().keys():
if rc_regex.search(f):
basename=basename_regex.search(f).group(1)
@@ -48,20 +56,23 @@
if dot_in_name_regex.match(basename):
printError(pkg, 'init-script-name-with-dot', f)
- # check chkconfig call in %post and %preun
- postin=pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
if not postin:
printError(pkg, 'init-script-without-chkconfig-postin', f)
else:
if not chkconfig_regex.search(postin):
printError(pkg, 'postin-without-chkconfig', f)
- preun=pkg[rpm.RPMTAG_PREUN] or pkg[rpm.RPMTAG_PREUNPROG]
if not preun:
- printError(pkg, 'init-script-without-chkconfig-preun', f)
+ printError(pkg, 'init-script-without-%stop_on_removal-preun', f)
else:
- if not chkconfig_regex.search(preun):
- printError(pkg, 'preun-without-chkconfig', f)
+ if not preun_regex.search(preun):
+ printError(pkg, 'preun-without-%stop_on_removal-preun', f)
+
+ if not postun:
+ printError(pkg, 'init-script-without-%insserv_cleanup-postun', f)
+ else:
+ if not insserv_regex.search(postun):
+ printError(pkg, 'postun-without-%insserv_cleanup', f)
status_found = 0
reload_found = 0
@@ -183,10 +194,18 @@
'postin-without-chkconfig',
'''The package contains an init script but doesn't call chkconfig in its %post.''',
-'init-script-without-chkconfig-preun',
+'init-script-without-%stop_on_removal-preun',
'''The package contains an init script but doesn't contain a %preun with
a call to chkconfig.''',
+'init-script-without-%insserv_cleanup-postun',
+'''The package contains an init script but doesn't contain a %postun
+with a call to %insserv_cleanup-postun''',
+
+'postun-without-%insserv_cleanup',
+'''The package contains an init script but doesn't contain a %postun
+with a call to %insserv_cleanup-postun''',
+
'preun-without-chkconfig',
'''The package contains an init script but doesn't call chkconfig in its %preun.''',
@@ -241,6 +260,18 @@
'init-script-non-executable',
'''The init script should have at least the execution bit set for root
in order for it to run at boot time.''',
+
+'init-script-without-%stop_on_removal-preun',
+'''The init script should have a %preun script that calls %stop_on_removal.''',
+
+'preun-without-%stop_on_removal-preun',
+'''The init script is not listed in %stop_on_removal in %preun.''',
+
+'init-script-without-%insserv_cleanup-postun',
+'''The package doesn't have a %insserv_cleanup call in %postun''',
+
+'postun-without-%insserv_cleanup',
+'''The package doesn't have a %insserv_cleanup call in %postun''',
)
# InitScriptCheck.py ends here

View File

@ -0,0 +1,41 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -169,18 +169,22 @@
# lookup spec file
files = pkg.files()
- for f in files.keys():
- if f.endswith('.spec'):
- self._spec_file = pkg.dirName() + "/" + f
- break
+ if (pkg.name + ".spec") in files.keys():
+ self._spec_file = pkg.name + ".spec"
+ else:
+ for f in files.keys():
+ if f.endswith('.spec'):
+ self._spec_file = f
+ break
+
if not self._spec_file:
printError(pkg, "no-spec-file")
else:
- if f != pkg.name + ".spec":
- printError(pkg, "invalid-spec-name", f)
+ if self._spec_file != pkg.name + ".spec":
+ printError(pkg, "invalid-spec-name", self._spec_file)
# check content of spec file
- spec_lines = Pkg.readlines(self._spec_file)
+ spec_lines = Pkg.readlines(pkg.dirName() + "/" + self._spec_file)
self.check_spec(pkg, spec_lines)
def check_spec(self, pkg, spec_lines):
@@ -219,7 +223,7 @@
}
if self._spec_file:
- if use_utf8 and not Pkg.is_utf8(self._spec_file):
+ if use_utf8 and not Pkg.is_utf8(pkg.dirName() + "/" + self._spec_file):
printError(pkg, "non-utf8-spec-file", self._spec_file)
# gather info from spec lines

19
usr-arch.diff Normal file
View File

@ -0,0 +1,19 @@
--- BinariesCheck.py
+++ BinariesCheck.py
@@ -109,6 +109,7 @@
numeric_dir_regex=re.compile('/usr(?:/share)/man/man./(.*)\.[0-9](?:\.gz|\.bz2)')
versioned_dir_regex=re.compile('[^.][0-9]')
usr_share=re.compile('^/usr/share/')
+usr_arch_share=re.compile('/share/.*/(?:x86|i.86|x86_64|ppc|ppc64|s390|s390x|ia64)')
etc=re.compile('^/etc/')
not_stripped=re.compile('not stripped')
unstrippable=re.compile('\.o$|\.static$')
@@ -181,7 +182,7 @@
printError(pkg, 'arch-independent-package-contains-binary-or-object', i[0])
else:
# in /usr/share ?
- if usr_share.search(i[0]):
+ if usr_share.search(i[0]) and not usr_arch_share.search(i[0]):
printError(pkg, 'arch-dependent-file-in-usr-share', i[0])
# in /etc ?
if etc.search(i[0]):

105
verify-buildrequires.diff Normal file
View File

@ -0,0 +1,105 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -44,7 +44,8 @@
biarch_package_regex = re.compile(DEFAULT_BIARCH_PACKAGES)
hardcoded_lib_path_exceptions_regex = re.compile(Config.getOption('HardcodedLibPathExceptions', DEFAULT_HARDCODED_LIB_PATH_EXCEPTIONS))
prereq_regex = re.compile('^PreReq(\(.*\))?:\s*(.+?)\s*$', re.IGNORECASE)
-buildprereq_regex = re.compile('^BuildPreReq:\s*(.+?)\s*$', re.IGNORECASE)
+buildprereq_regex = re.compile('^BuildPreReq\s*:\s*(.+)\s*$', re.IGNORECASE)
+buildrequires_regex = re.compile('^\s*BuildRequires\s*:\s*(.+)\s*$', re.IGNORECASE)
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
macro_regex = re.compile('(%+)[{(]?(\w+)')
suse_version_regex = re.compile('%suse_version\s*[<>=]+\s*(\d+)')
@@ -111,6 +112,25 @@
res.append(tok)
return res
+def find_reverse_requires():
+ reverse_requires = dict()
+ try:
+ f = file("/.builtinfo/rpmdeps", "r")
+ except:
+ return reverse_requires
+
+ for line in f:
+ if line.startswith('R:'):
+ package = "-".join(line.split(':')[1].split('-')[:-3])
+ deps = deptokens(line.split(':')[2])
+ for dep in deps:
+ name = dep.split(' ')[0]
+ if name.startswith('/') or name.find('(') != -1 or name == dep:
+ continue
+ reverse_requires.setdefault(name, set()).add(package)
+
+ return reverse_requires
+
def contains_buildroot(line):
'''Check if the given line contains use of rpm buildroot.'''
res = rpm_buildroot_regex.search(line)
@@ -174,6 +194,8 @@
indent_spaces = 0
indent_tabs = 0
section = {}
+ buildrequires = set()
+
for sec in ['description', 'prep', 'build', 'install', 'clean',
'files', 'changelog', 'package', 'check']:
section[sec] = {
@@ -316,6 +338,14 @@
if res:
printWarning(pkg, 'buildprereq-use', res.group(1))
+ res = buildrequires_regex.search(line)
+ if not if_depth and res:
+ for r in deptokens(res.group(1)):
+ name = r.split(' ')[0]
+ if name in buildrequires:
+ printWarning(pkg, 'duplicate-buildrequires', name)
+ buildrequires.add(name)
+
if scriptlet_requires_regex.search(line) and current_section == 'package':
printError(pkg, 'broken-syntax-in-scriptlet-requires', string.strip(line))
@@ -376,6 +406,24 @@
'(spaces: line %d, tab: line %d)' %
(indent_spaces, indent_tabs))
+ reverse_requires = find_reverse_requires()
+ for r in buildrequires:
+ if r in reverse_requires:
+ for rev in reverse_requires[r]:
+ if rev in buildrequires:
+ printWarning(pkg, 'unnecessary-buildrequires', r, 'already included by', rev)
+
+ if not r.endswith("-devel"):
+ develr = [ r + "-devel" ]
+ # libfoo-4_2 -> libfoo-devel
+ dr2 = re.sub(r'-?[0-9_]+$', '', r) + "-devel"
+ if dr2 != develr[0]:
+ develr.append(dr2);
+ for dr in develr:
+ if r in reverse_requires and dr in reverse_requires[r] \
+ and not dr in buildrequires:
+ printWarning(pkg, "non-devel-buildrequires", r, "- did you mean", dr, "?")
+
# process gathered info
for p in patches.keys():
if p in applied_patches_ifarch:
@@ -522,6 +570,17 @@
odd entries eg. in source rpms, which is rarely wanted. Avoid use of macros
in %changelog altogether, or use two '%'s to escape them, like '%%foo'.''',
+'unnecessary-buildrequires',
+''' The specfile contains a buildrequires entry that seems to be already
+requires by one of the other buildrequires. Please consider reducing your
+buildrequires definitions in case this is a real implicit dependency.''',
+
+'non-devel-buildrequires',
+'''The specfile contains a buildrequires entry that has a -devel package.
+Please carefully check if you want to buildrequire the -devel subpackage or if
+this is an unnecessary dependency that is already required by one of the other
+buildrequires.''',
+
'depscript-without-disabling-depgen',
'''In some common rpm configurations/versions, defining __find_provides and/or
__find_requires has no effect if rpm's internal dependency generator has not

12
xdg-paths-update.diff Normal file
View File

@ -0,0 +1,12 @@
--- MenuXDGCheck.py
+++ MenuXDGCheck.py
@@ -16,7 +16,8 @@
# desktop file need to be in $XDG_DATA_DIRS
# $ echo $XDG_DATA_DIRS/applications
# /var/lib/menu-xdg:/usr/share
- AbstractCheck.AbstractFilesCheck.__init__(self, "MenuXDGCheck", "/usr/share/applications/.*\.desktop$")
+ AbstractCheck.AbstractFilesCheck.__init__(self, "MenuXDGCheck",
+ "(?:/usr/share|/etc/opt/.*/share|/opt/.*)/applications/.*\.desktop$")
def check_file(self, pkg, filename):
f = pkg.dirName() + filename

11
yast-provides.diff Normal file
View File

@ -0,0 +1,11 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -648,7 +648,7 @@
printWarning(pkg, 'no-url-tag')
obs=map(lambda x: x[0], pkg.obsoletes())
- provs=map(lambda x: x[0], pkg.provides())
+ provs=map(lambda x: x[0].split(':/')[0], pkg.provides())
if pkg.name in obs:
printError(pkg, 'obsolete-on-name')