On Fri, Nov 02, 2007 at 10:26:12AM +0100, Lukas Ocilka wrote:
> Stephan Kulow napsal(a):
> > Do you speak python? Extend rpmlint's PostCheck.py
>
> It's a shame but I don't ;)
Neither do I, but ...
> I hope, there's someone who does and is willing to help.
> Any volunteer?
here's a patch, untested.
--
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner
Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
--- PostCheck.py.orig 2006-11-08 20:34:35.000000000 +0100
+++ PostCheck.py 2007-11-02 11:10:04.000000000 +0100
@@ -45,14 +45,22 @@
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')],
+ ['sed', ('sed', '/bin/sed')],
)
+# \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