]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Change hash calculating function
authorKarel Kočí <cynerd@email.cz>
Thu, 13 Aug 2015 07:59:33 +0000 (09:59 +0200)
committerKarel Kočí <cynerd@email.cz>
Thu, 13 Aug 2015 08:02:28 +0000 (10:02 +0200)
Previous method of calculating hash wasn't work (wouldn't give same
result for same configuration) if there would be added
new configuration options to hashconfigsort file.

scripts/configurations.py

index d6780c9e15fdd4a3ce60e7208c698dce2bb31b98..aaa6937cb8f36e754f58380e6498f5e23085b6cd 100644 (file)
@@ -119,11 +119,9 @@ def __calchash__(file):
        for c in csort:
                try:
                        if con[c]:
-                               cstr += '+'
-                       else:
-                               cstr += '-'
+                               cstr += c
                except ValueError:
-                       cstr += '0'
+                       pass
 
        # Add missing
        csortfile = open(sf(conf.hashconfigsort), 'a');
@@ -135,9 +133,7 @@ def __calchash__(file):
                        csort.append(key)
                        csortfile.write(key + '\n')
                        if val:
-                               cstr += '+'
-                       else:
-                               cstr += '-'
+                               cstr += key
        csortfile.close()
 
        hsh = hashlib.md5(bytes(cstr, 'UTF-8'))