Use md5 hashes instead of the file name and path

This commit is contained in:
Raoul Snyman 2019-04-10 12:59:51 -07:00
parent f0b3ce65a1
commit 119b551afd
1 changed files with 2 additions and 1 deletions

View File

@ -112,6 +112,7 @@ import os
import glob
import sys
from distutils import dir_util
from hashlib import md5
from shutil import copy, move, rmtree
from lxml.etree import fromstring, tostring
@ -171,7 +172,7 @@ class WindowsBuilder(Builder):
if fname in BLACKLIST:
continue
source = os.path.join(path, fname) if path else fname
source_id = source.replace('-', '_').replace(os.sep, '_')
source_id = md5(source).hexdigest()
file_id = 'file_{source_id}'.format(source_id=source_id)
component_id = 'cmp_{source_id}'.format(source_id=source_id)
file_ = E.File(Id=file_id, KeyPath="yes", Source=source)