1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 18:34:48 +00:00
This commit is contained in:
deadc0de6
2023-01-13 11:04:58 +01:00
parent 367df16db7
commit e2322c5842
2 changed files with 34 additions and 4 deletions

View File

@@ -265,7 +265,7 @@ class CfgYaml:
# process imported configs (import_configs)
self._import_configs()
# process profile include
# process profile include items (actions, dotfiles, ...)
self._resolve_profile_includes()
# add the current profile variables
@@ -928,7 +928,7 @@ class CfgYaml:
val[self.key_profile_dotfiles] = self.dotfiles.keys()
def _resolve_profile_includes(self):
"""resolve profile(s) including other profiles"""
"""resolve elements included through other profiles"""
for k, _ in self.profiles.items():
self._rec_resolve_profile_include(k)
@@ -987,7 +987,7 @@ class CfgYaml:
msg = f'Merging actions {profile} '
msg += f'<- {i}: {actions} <- {o_actions}'
self._dbg(msg)
actions.extend(o_actions)
actions.extend(o_actions)
this_profile[self.key_profile_actions] = uniq_list(actions)
dotfiles = this_profile.get(self.key_profile_dotfiles, [])
@@ -1498,7 +1498,10 @@ class CfgYaml:
self._redefine_templater()
def _get_profile_included_vars(self):
"""resolve profile included variables/dynvariables"""
"""
resolve profile included variables/dynvariables
returns inc_profiles, inc_var, inc_dvar
"""
for _, val in self.profiles.items():
if self.key_profile_include in val and \
val[self.key_profile_include]:

View File

@@ -181,5 +181,32 @@ nb=`wc -l ${tmpa}/post2 | awk '{print $1}'`
nb=`wc -l ${tmpa}/naked | awk '{print $1}'`
[ "${nb}" != "1" ] && echo "naked executed multiple times" && exit 1
# install without verbose
rm -f ${tmpa}/pre ${tmpa}/pre2 ${tmpa}/post ${tmpa}/post2 ${tmpa}/naked
rm -f ${tmpd}/abc
echo "PROFILE p0 without verbose"
cd ${ddpath} | ${bin} install -f -c ${cfg} -p p0
# checks
[ ! -e ${tmpa}/pre ] && echo "pre not found" && exit 1
nb=`wc -l ${tmpa}/pre | awk '{print $1}'`
[ "${nb}" != "1" ] && echo "pre executed multiple times" && exit 1
[ ! -e ${tmpa}/pre2 ] && echo "pre2 not found" && exit 1
nb=`wc -l ${tmpa}/pre2 | awk '{print $1}'`
[ "${nb}" != "1" ] && echo "pre2 executed multiple times" && exit 1
[ ! -e ${tmpa}/post ] && echo "post not found" && exit 1
nb=`wc -l ${tmpa}/post | awk '{print $1}'`
[ "${nb}" != "1" ] && echo "post executed multiple times" && exit 1
[ ! -e ${tmpa}/post2 ] && echo "post2 not found" && exit 1
nb=`wc -l ${tmpa}/post2 | awk '{print $1}'`
[ "${nb}" != "1" ] && echo "post2 executed multiple times" && exit 1
[ ! -e ${tmpa}/naked ] && echo "naked not found" && exit 1
nb=`wc -l ${tmpa}/naked | awk '{print $1}'`
[ "${nb}" != "1" ] && echo "naked executed multiple times" && exit 1
echo "OK"
exit 0