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 2014/09/27 12:51:43 garyo"
34
35 import collections
36
37 import SCons.Errors
38 import SCons.Node
39 import SCons.Util
40
42 - def Alias(self, name, **kw):
51
53 try:
54 return self[name]
55 except KeyError:
56 return None
57
63
66
67 -class Alias(SCons.Node.Node):
68
69 NodeInfo = AliasNodeInfo
70 BuildInfo = AliasBuildInfo
71
75
77 return '"' + self.__str__() + '"'
78
81
84
85 really_build = SCons.Node.Node.build
86 is_up_to_date = SCons.Node.Node.children_are_up_to_date
87
93
94 - def get_contents(self):
95 """The contents of an alias is the concatenation
96 of the content signatures of all its sources."""
97 childsigs = [n.get_csig() for n in self.children()]
98 return ''.join(childsigs)
99
101 """An Alias is not recorded in .sconsign files"""
102 pass
103
104
105
106
107
109 cur_csig = self.get_csig()
110 try:
111 return cur_csig != prev_ni.csig
112 except AttributeError:
113 return 1
114
116 """A "builder" for aliases."""
117 pass
118
124
126 """
127 Generate a node's content signature, the digested signature
128 of its content.
129
130 node - the node
131 cache - alternate node to use for the signature cache
132 returns - the content signature
133 """
134 try:
135 return self.ninfo.csig
136 except AttributeError:
137 pass
138
139 contents = self.get_contents()
140 csig = SCons.Util.MD5signature(contents)
141 self.get_ninfo().csig = csig
142 return csig
143
144 default_ans = AliasNameSpace()
145
146 SCons.Node.arg2nodes_lookups.append(default_ans.lookup)
147
148
149
150
151
152
153