do not require with python macro
[platform/upstream/rpmlint.git] / RpmFileCheck.py
1 # -*- coding: utf-8 -*-
2 # check the rpm file for various errors.
3 # $Id: RpmFileCheck.py 1732 2010-02-21 11:28:42Z scop $
4
5 # Copyright (C) 2006 Michael Scherer <misc@zarb.org>
6 #                    Ville Skyttä <ville.skytta@iki.fi>
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; version 2 of the License.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21
22 import os
23
24 from Filter import addDetails, printWarning
25 import AbstractCheck
26
27
28 class RpmFileCheck(AbstractCheck.AbstractCheck):
29     def __init__(self):
30         AbstractCheck.AbstractCheck.__init__(self, "RpmFileCheck")
31
32     def check(self, pkg):
33         # http://en.wikipedia.org/wiki/Joliet_(file_system)
34         rpmfile_name = os.path.basename(pkg.filename)
35         if len(rpmfile_name) > 64:
36             printWarning(pkg, 'filename-too-long-for-joliet', rpmfile_name)
37
38 check = RpmFileCheck()
39
40 addDetails(
41 'filename-too-long-for-joliet',
42 '''This filename is too long to fit on a joliet filesystem (limit is 64 unicode
43 chars).''',
44 )
45
46 # Local variables:
47 # indent-tabs-mode: nil
48 # py-indent-offset: 4
49 # End:
50 # ex: ts=4 sw=4 et