1
2 """scons.Node.Alias
3
4 Alias nodes.
5
6 This creates a hash of global Aliases (dummy targets).
7
8 """
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 __revision__ = "src/engine/SCons/Node/Alias.py 2928 2008/04/29 22:44:09 knight"
34
35 import string
36 import UserDict
37
38 import SCons.Errors
39 import SCons.Node
40 import SCons.Util
41
43 - def Alias(self, name, **kw):
52
54 try:
55 return self[name]
56 except KeyError:
57 return None
58
64
67
68 -class Alias(SCons.Node.Node):
69
70 NodeInfo = AliasNodeInfo
71 BuildInfo = AliasBuildInfo
72
76
79
82
83 really_build = SCons.Node.Node.build
84 is_up_to_date = SCons.Node.Node.children_are_up_to_date
85
91
92 - def get_contents(self):
93 """The contents of an alias is the concatenation
94 of the content signatures of all its sources."""
95 childsigs = map(lambda n: n.get_csig(), self.children())
96 return string.join(childsigs, '')
97
99 """An Alias is not recorded in .sconsign files"""
100 pass
101
102
103
104
105
107 cur_csig = self.get_csig()
108 try:
109 return cur_csig != prev_ni.csig
110 except AttributeError:
111 return 1
112
114 """A "builder" for aliases."""
115 pass
116
122
124 """
125 Generate a node's content signature, the digested signature
126 of its content.
127
128 node - the node
129 cache - alternate node to use for the signature cache
130 returns - the content signature
131 """
132 try:
133 return self.ninfo.csig
134 except AttributeError:
135 pass
136
137 contents = self.get_contents()
138 csig = SCons.Util.MD5signature(contents)
139 self.get_ninfo().csig = csig
140 return csig
141
142 default_ans = AliasNameSpace()
143
144 SCons.Node.arg2nodes_lookups.append(default_ans.lookup)
145