mirror of
https://gitlab.com/openlp/packaging.git
synced 2024-12-22 13:02:50 +00:00
Use md5 hashes instead of the file name and path
This commit is contained in:
parent
f0b3ce65a1
commit
119b551afd
@ -112,6 +112,7 @@ import os
|
|||||||
import glob
|
import glob
|
||||||
import sys
|
import sys
|
||||||
from distutils import dir_util
|
from distutils import dir_util
|
||||||
|
from hashlib import md5
|
||||||
from shutil import copy, move, rmtree
|
from shutil import copy, move, rmtree
|
||||||
|
|
||||||
from lxml.etree import fromstring, tostring
|
from lxml.etree import fromstring, tostring
|
||||||
@ -171,7 +172,7 @@ class WindowsBuilder(Builder):
|
|||||||
if fname in BLACKLIST:
|
if fname in BLACKLIST:
|
||||||
continue
|
continue
|
||||||
source = os.path.join(path, fname) if path else fname
|
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)
|
file_id = 'file_{source_id}'.format(source_id=source_id)
|
||||||
component_id = 'cmp_{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)
|
file_ = E.File(Id=file_id, KeyPath="yes", Source=source)
|
||||||
|
Loading…
Reference in New Issue
Block a user