mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
fix: do not overwrite __version__ (#1170)
This commit is contained in:
25
.github/pyinstaller/pyinstaller.spec
vendored
25
.github/pyinstaller/pyinstaller.spec
vendored
@@ -6,31 +6,6 @@ import subprocess
|
||||
import wcwidth
|
||||
|
||||
|
||||
# git output will look like:
|
||||
#
|
||||
# tags/v1.0.0-0-g3af38dc
|
||||
# ------- tag
|
||||
# - commits since
|
||||
# g------- git hash fragment
|
||||
version = (
|
||||
subprocess.check_output(["git", "describe", "--always", "--tags", "--long"])
|
||||
.decode("utf-8")
|
||||
.strip()
|
||||
.replace("tags/", "")
|
||||
)
|
||||
# when invoking pyinstaller from the project root, this gets run from the project root.
|
||||
with open("./capa/version.py", "r", encoding="utf-8") as f:
|
||||
lines = f.read()
|
||||
# version.py contains the version string and other helper functions
|
||||
# here we manually replace the version value substring with the result of the above git output
|
||||
VERSION_DEF = "__version__ = "
|
||||
s = lines.index(VERSION_DEF)
|
||||
e = s + len(VERSION_DEF)
|
||||
off_rest_file = e + lines[e:].index("\n")
|
||||
lines = lines[s:e] + f'"{version}"' + lines[off_rest_file:]
|
||||
with open("./capa/version.py", "w", encoding="utf-8") as f:
|
||||
f.write(lines)
|
||||
|
||||
a = Analysis(
|
||||
# when invoking pyinstaller from the project root,
|
||||
# this gets invoked from the directory of the spec file,
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
### Bug Fixes
|
||||
- render: convert feature attributes to aliased dictionary for vverbose #1152 @mike-hunhoff
|
||||
- decouple Token dependency / extractor and features #1139 @mr-tz
|
||||
- do not overwrite version in version.py during PyInstaller build #1169 @mr-tz
|
||||
|
||||
### capa explorer IDA Pro plugin
|
||||
- fix: display instruction items #1154 @mr-tz
|
||||
|
||||
Reference in New Issue
Block a user