~ubuntu-branches/ubuntu/trusty/nagios-plugins-contrib/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/packaging-helper.py

  • Committer: Package Import Robot
  • Author(s): Bernd Zeimetz
  • Date: 2013-05-21 22:11:50 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130521221150-k5bda5v5euvt7wg9
Tags: 6.20130521
* [e68c82e1] check_raid: do not run hpacucli if cciss_vol_status is available.
* [4a1c57e8] Also support tw-cli as additional name for the 3ware binary.
  Thanks to Dennis Hoppe
* [eb5e1c7c] Add /run/ to the check_libs ignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import re
7
7
from debian import deb822
8
8
 
 
9
ALLOWED_FIELDS = ('Suggests',
 
10
                  'Recommends',
 
11
                  'Depends',
 
12
                  'Uploaders',
 
13
                  'Version',
 
14
                  'Homepage',
 
15
                  'Watch',
 
16
                  'Description',
 
17
                  'Build-Depends')
 
18
 
9
19
# find all plugins
10
20
__basedir__ = os.path.realpath(os.path.dirname(sys.argv[0]) + os.path.sep + '..')
11
21
__plugins__ = [p for p in os.listdir(__basedir__) 
20
30
    # returns (plug, parsed control field data)
21
31
    # We look at the first paragraph only!
22
32
    for plugin in __plugins__:
23
 
        yield (plugin, [x for x in deb822.Packages.iter_paragraphs(file(__basedir__ + os.path.sep+ plugin + os.path.sep + 'control'))][0])
 
33
        data=(plugin, [x for x in deb822.Packages.iter_paragraphs(file(__basedir__ + os.path.sep+ plugin + os.path.sep + 'control'))][0])
 
34
        for key in data[1].iterkeys():
 
35
            if key not in ALLOWED_FIELDS:
 
36
                raise Exception("Unknown control field in plugin %s: %s" %(data[0],key))
 
37
        yield data
24
38
 
25
39
def generate_debian_readme_plugins():
26
40
    plugins_depends={}