~ubuntu-branches/ubuntu/karmic/potracegui/karmic

« back to all changes in this revision

Viewing changes to admin/unsermake/checkrcs.um

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Wegscheider
  • Date: 2005-04-30 23:04:34 UTC
  • Revision ID: james.westby@ubuntu.com-20050430230434-733cdzgwcwtb98ud
Tags: upstream-1.3
ImportĀ upstreamĀ versionĀ 1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-python-*-
 
2
# vim: ts=4
 
3
# Copyright (C) 2003 Simon Hausmann <hausmann@kde.org>
 
4
# Licensed under whatever license unsermake is available
 
5
 
 
6
import handlerbase
 
7
 
 
8
class RCHandler( handlerbase.HandlerBase ):
 
9
        def __init__( self ):
 
10
                pass
 
11
 
 
12
        def collect( self, amfile ):
 
13
 
 
14
                rcfiles = ''
 
15
 
 
16
                for define in amfile.defines():
 
17
                        if define.endswith( '_DATA' ):
 
18
 
 
19
                                for file in amfile.definition_rec( define ):
 
20
                                        if file.endswith( '.rc' ):
 
21
                                                rcfiles = rcfiles + file + ' '
 
22
 
 
23
                checks = [ '@if test -n "$(XMLLINT)"; then \\',
 
24
                           '    for rcf in %s; do \\' % rcfiles,
 
25
                                   '        rc=%s$$rcf; \\' % amfile.rulef.source,
 
26
                                   '        if head -n 1 $$rc | egrep -q "DOCTYPE|xml"; then \\',
 
27
                                   '            echo checking $$rc; \\',
 
28
                                   '            if ! $(XMLLINT) --noout $$rc; then \\',
 
29
                                   '                exit 1 ;\\',
 
30
                                   '            fi \\',
 
31
                                   '        fi \\',
 
32
                                   '    done \\',
 
33
                                   'fi' ]
 
34
 
 
35
                if len( rcfiles ):
 
36
                        checkTargetName = 'install-check-rcfiles-' + amfile.canon_subdir
 
37
                        amfile.rulef.insertTarget( checkTargetName, '', checks, phony=1 )
 
38
                        amfile.rulef.insertTarget( 'install-data', checkTargetName, phony=1 )
 
39
 
 
40
register_handler( RCHandler() )