From dda9962601bb0799a14a376c52275470e42cbfbb Mon Sep 17 00:00:00 2001 From: Juraj Ivancic Date: Wed, 7 Dec 2011 10:44:29 +0100 Subject: [PATCH] Add support for --hash. --- src/build/property_set.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/build/property_set.py b/src/build/property_set.py index d970f7734..4fff814c9 100644 --- a/src/build/property_set.py +++ b/src/build/property_set.py @@ -6,6 +6,8 @@ # all copies. This software is provided "as is" without express or implied # warranty, and with no claim as to its suitability for any purpose. +import hashlib + from b2.util.utility import * import property, feature, string import b2.build.feature @@ -371,7 +373,9 @@ class PropertySet: is_relative = False else: - p = self.as_path () + p = self.as_path() + if hash_maybe: + p = hash_maybe(p) # Really, an ugly hack. Boost regression test system requires # specific target paths, and it seems that changing it to handle @@ -446,4 +450,11 @@ class PropertySet: def __contains__(self, item): return item in self.all_set_ + +def hash(p): + m = hashlib.md5() + m.update(p) + return m.hexdigest() + +hash_maybe = hash if "--hash" in bjam.variable("ARGV") else None