|
93 | 93 | outputcxx += ' "' + gcc + '",\n'
|
94 | 94 | outputhxx += '"' + gcc + '\\n"\n'
|
95 | 95 |
|
| 96 | +main_git_hash = None |
| 97 | + |
96 | 98 | for x in inputs :
|
97 | 99 | print x
|
98 | 100 | # go into the root of the repo
|
|
121 | 123 | outputcxx += ':' + os.path.split(os.path.abspath(x))[1]
|
122 | 124 | outputhxx += '"' + git_hash + ':' + os.path.split(os.path.abspath(x))[1]
|
123 | 125 |
|
| 126 | + hashopts = "" |
| 127 | + |
124 | 128 | if dirty or untracked :
|
125 |
| - outputcxx += ':' |
126 |
| - outputhxx += ':' |
| 129 | + hashopts += ':' |
127 | 130 | if dirty :
|
128 |
| - outputcxx += '-d' |
129 |
| - outputhxx += '-d' |
| 131 | + hashopts += '-d' |
130 | 132 | if untracked :
|
131 |
| - outputcxx += '-u' |
132 |
| - outputhxx += '-u' |
133 |
| - outputcxx += '",\n' |
134 |
| - outputhxx += '\\n"\n' |
| 133 | + hashopts += '-u' |
| 134 | + outputcxx += hashopts + '",\n' |
| 135 | + outputhxx += hashopts + '\\n"\n' |
| 136 | + |
| 137 | + if main_git_hash is None: |
| 138 | + main_git_hash = git_hash + hashopts |
135 | 139 |
|
136 | 140 | outputcxx += ' nullptr\n'
|
137 | 141 | outputcxx += '};\n'
|
|
142 | 146 | outputhxx += '));\n'
|
143 | 147 | outputhxx += 'CDI_GROUP_END();\n'
|
144 | 148 |
|
| 149 | +if main_git_hash is not None: |
| 150 | + outputhxx += '\n#define REVISION_GIT_HASH "' + main_git_hash + '"\n' |
| 151 | + |
145 | 152 | os.chdir(orig_dir)
|
146 | 153 |
|
147 | 154 | # generate the *.cxxout style content
|
|
165 | 172 | "-I", """Thu, """, "-I", """Fri, """,
|
166 | 173 | "-I", """Sat, """,
|
167 | 174 | options.output + 'Try.hxxout',
|
168 |
| - options.output + '.hxxout'], stdout=f_null) |
| 175 | + options.output + '.hxxout'], |
| 176 | + stdout=f_null, stderr=f_null) |
169 | 177 | diffcxx = subprocess.call(['diff',
|
170 | 178 | "-I", """Sun, """, "-I", """Mon, """,
|
171 | 179 | "-I", """Tue, """, "-I", """Wed, """,
|
172 | 180 | "-I", """Thu, """, "-I", """Fri, """,
|
173 | 181 | "-I", """Sat, """,
|
174 | 182 | options.output + 'Try.cxxout',
|
175 |
| - options.output + '.cxxout'], stdout=f_null) |
| 183 | + options.output + '.cxxout'], |
| 184 | + stdout=f_null, stderr=f_null) |
| 185 | +# disable this because we are not actually writing a cxx file above. |
| 186 | +diffcxx = 0 |
176 | 187 |
|
177 | 188 | if diffhxx != 0 :
|
178 | 189 | os.system('rm -f ' + options.output + '.hxxout')
|
|
0 commit comments