-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Common - Check extensions hash (#10144)
Co-authored-by: johnb432 <[email protected]> Co-authored-by: Grim <[email protected]>
- Loading branch information
1 parent
ca4ea2f
commit 2bfb226
Showing
8 changed files
with
100 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class ACE_ExtensionsHashes { | ||
class ace { | ||
dll = "b83c2c9c7c989eaf888c885d13a2fdf4a61d1c5f"; | ||
dll_x64 = "356a61c4bd2aa13556a8ba0b467c819b3b438d6c"; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import pathlib | ||
import os | ||
import hashlib | ||
|
||
addon_base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) | ||
|
||
extensions = {} | ||
|
||
for file in os.listdir(addon_base_path): | ||
path = pathlib.Path(addon_base_path, file) | ||
extension_type = "dll" | ||
if path.suffix == ".dll": | ||
key = path.stem | ||
if key.endswith("_x64"): | ||
key = key.removesuffix("_x64") | ||
extension_type += "_x64" | ||
print(f"looking at {path}") | ||
with open(path, 'rb') as file_read: | ||
sha1 = hashlib.sha1() | ||
data = file_read.read() | ||
sha1.update(data) | ||
arr = extensions.get(key, {}) | ||
arr[extension_type] = sha1.hexdigest() | ||
extensions[key] = arr | ||
|
||
file_out = pathlib.Path(addon_base_path, "addons", "common", "ACE_ExtensionsHashes.hpp") | ||
with open(file_out, 'w') as file_write: | ||
print(f"class ACE_ExtensionsHashes {{", file=file_write) | ||
for key, values in extensions.items(): | ||
print(f" class {key} {{", file=file_write) | ||
for type, hash in values.items(): | ||
print(f" {type} = \"{hash}\";", file=file_write) | ||
print(f" }};", file=file_write) | ||
print(f"}};", file=file_write) | ||
|
||
print(f"Wrote {len(extensions)} to {file_out}") |