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 5110 2010/07/25 16:14:38 bdeegan"
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
78 return '"' + self.__str__() + '"'
79
82
85
86 really_build = SCons.Node.Node.build
87 is_up_to_date = SCons.Node.Node.children_are_up_to_date
88
94
95 - def get_contents(self):
96 """The contents of an alias is the concatenation
97 of the content signatures of all its sources."""
98 childsigs = map(lambda n: n.get_csig(), self.children())
99 return string.join(childsigs, '')
100
102 """An Alias is not recorded in .sconsign files"""
103 pass
104
105
106
107
108
110 cur_csig = self.get_csig()
111 try:
112 return cur_csig != prev_ni.csig
113 except AttributeError:
114 return 1
115
117 """A "builder" for aliases."""
118 pass
119
125
127 """
128 Generate a node's content signature, the digested signature
129 of its content.
130
131 node - the node
132 cache - alternate node to use for the signature cache
133 returns - the content signature
134 """
135 try:
136 return self.ninfo.csig
137 except AttributeError:
138 pass
139
140 contents = self.get_contents()
141 csig = SCons.Util.MD5signature(contents)
142 self.get_ninfo().csig = csig
143 return csig
144
145 default_ans = AliasNameSpace()
146
147 SCons.Node.arg2nodes_lookups.append(default_ans.lookup)
148
149
150
151
152
153
154