Added pre install hook

parent ac92eb4d
......@@ -30,8 +30,8 @@ for maps_list_item in ( ("share/settingsd/plugins/functions", "plugins/functions
("share/settingsd/data/customs", "data/customs"),
("/etc/settingsd", "configs/settingsd") ) :
data_files_list.append(( maps_list_item[0], [ os.path.join(maps_list_item[1], item)
for item in os.listdir(maps_list_item[1]) if not item in (".gitignore",) ] ))
data_files_list.append(( maps_list_item[0], [ os.path.join(maps_list_item[1], item) for item
in os.listdir(maps_list_item[1]) if os.path.isfile(maps_list_item[1] + '/'+ item) and item not in (".gitignore", "__pycache__") ] ))
#####
......@@ -58,12 +58,20 @@ class SettingsdInstall(install) :
### Public ###
def run(self) :
self.preInstallHook()
install.run(self)
self.postInstallHooks()
### Private ###
def preInstallHook(self):
log.info("running pre-install hooks")
for data_item in data_files_list:
if not os.path.exists(self.install_data + "/" + data_item[0]):
os.makedirs(self.install_data + "/" + data_item[0])
def postInstallHooks(self) :
# FIXME: This is dirty hack. In normal realization, this code must be moved to build stage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment