Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meson, configure: move --with-pkgversion, CONFIG_STAMP to meson
The hash is now generated with a Python script. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
- Loading branch information
Showing
7 changed files
with
40 additions
and
25 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
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,24 @@ | ||
#! /usr/bin/env python3 | ||
|
||
# Usage: scripts/qemu-stamp.py STRING1 STRING2... -- FILE1 FILE2... | ||
import hashlib | ||
import os | ||
import sys | ||
|
||
sha = hashlib.sha1() | ||
is_file = False | ||
for arg in sys.argv[1:]: | ||
if arg == '--': | ||
is_file = True | ||
continue | ||
if is_file: | ||
with open(arg, 'rb') as f: | ||
for chunk in iter(lambda: f.read(65536), b''): | ||
sha.update(chunk) | ||
else: | ||
sha.update(os.fsencode(arg)) | ||
sha.update(b'\n') | ||
|
||
# The hash can start with a digit, which the compiler doesn't | ||
# like as an symbol. So prefix it with an underscore | ||
print("_" + sha.hexdigest()) |