begin to reintegrate parameter recording
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
a6702cc804
commit
b46850cd12
2 changed files with 29 additions and 24 deletions
|
@ -213,7 +213,6 @@ __cdist_object_list()
|
||||||
find . -name "$__cdist_name_object_source" | \
|
find . -name "$__cdist_name_object_source" | \
|
||||||
sed -e 's;^./;;' -e "s;/${__cdist_name_object_source}\$;;"
|
sed -e 's;^./;;' -e "s;/${__cdist_name_object_source}\$;;"
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__cdist_object_parameter_dir()
|
__cdist_object_parameter_dir()
|
||||||
|
|
|
@ -62,38 +62,28 @@ fi
|
||||||
__cdist_myname="$__cdist_myname ($__cdist_object_id)"
|
__cdist_myname="$__cdist_myname ($__cdist_object_id)"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Create object in tmpdir
|
# Create object in tmpdir first
|
||||||
#
|
#
|
||||||
|
|
||||||
__cdist_new_object_dir="$__cdist_tmp_dir/$__cdist_object_self"
|
# Save original destination
|
||||||
mkdir -p "${__cdist_new_object_dir}"
|
__cdist_out_object_dir_orig="$__cdist_out_object_dir"
|
||||||
|
|
||||||
|
# Store to tmp now
|
||||||
|
__cdist_out_object_dir="$__cdist_tmp_dir"
|
||||||
|
|
||||||
|
__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")"
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
# Record source
|
# Record source
|
||||||
echo "${__cdist_manifest}" > "${__cdist_new_object_dir}/${__cdist_name_object_source}"
|
mkdir -p "${__cdist_object_dir}"
|
||||||
|
__cdist_object_source_add "${__cdist_object_dir}"
|
||||||
|
|
||||||
|
|
||||||
|
# Record parameter
|
||||||
################################################################################
|
|
||||||
# Try to merge object into global object directory
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")"
|
|
||||||
__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")"
|
|
||||||
|
|
||||||
__cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")"
|
__cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")"
|
||||||
|
|
||||||
# if [ -e "${__cdist_new_object_dir}" ]; then
|
|
||||||
# source="$(__cdist_object_source "${__cdist_new_object_dir}")"
|
|
||||||
# __cdist_exit_err "${__cdist_object} already exists (source: $source)"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
mkdir -p "${__cdist_parameter_dir}"
|
mkdir -p "${__cdist_parameter_dir}"
|
||||||
|
|
||||||
# Record parameters to tmpdir
|
|
||||||
tempparameter="${__cdist_tmp_dir}/${__cdist_name_parameter}"
|
|
||||||
mkdir -p "$tempparameter"
|
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
opt="$1"; shift
|
opt="$1"; shift
|
||||||
|
|
||||||
|
@ -109,6 +99,14 @@ while [ $# -gt 0 ]; do
|
||||||
echo "${value}" > "${tempparameter}/${opt_file}"
|
echo "${value}" > "${tempparameter}/${opt_file}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Try to merge object into global object directory
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
# Ensure required parameters are given
|
# Ensure required parameters are given
|
||||||
if [ -f "$(__cdist_type_parameter_required "$__cdist_type")" ]; then
|
if [ -f "$(__cdist_type_parameter_required "$__cdist_type")" ]; then
|
||||||
while read required; do
|
while read required; do
|
||||||
|
@ -144,3 +142,11 @@ for requirement in $require; do
|
||||||
echo $requirement >> "$(__cdist_object_require "$__cdist_object")"
|
echo $requirement >> "$(__cdist_object_require "$__cdist_object")"
|
||||||
echo Recording: $__cdist_object requires $requirement
|
echo Recording: $__cdist_object requires $requirement
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
# old stuff
|
||||||
|
# if [ -e "${__cdist_new_object_dir}" ]; then
|
||||||
|
# source="$(__cdist_object_source "${__cdist_new_object_dir}")"
|
||||||
|
# __cdist_exit_err "${__cdist_object} already exists (source: $source)"
|
||||||
|
# fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue