add source record information to created objects

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
remotes/origin/1.0
Nico Schottelius 14 years ago
parent 489639f8e0
commit 7c8dba566f
  1. 3
      bin/cdist-config
  2. 7
      bin/cdist_tree_wrapper

@ -60,6 +60,9 @@ __cdist_bin_prefix="__"
# Used for IDs
__cdist_sane_chars='[A-Za-z0-9_]'
# Used to mark file that created a specific type
__cdist_object_source=".source"
################################################################################
# Function list
#

@ -38,9 +38,8 @@ __cdist_tid="${__cdist_myname}/${__cdist_id}"
__cdist_ddir="$(__cdist_cache_host)/${__cdist_tid}"
if [ -e "${__cdist_ddir}" ]; then
# FIXME: add source! $cdist_config_base/source
# FIXME: force $source information to be present from outside!
__cdist_usage "${__cdist_tid} already exists"
source="$(cat "${__cdist_ddir}/${__cdist_object_source}")"
__cdist_usage "${__cdist_tid} already exists (source: $source)"
fi
mkdir -p "${__cdist_ddir}"
@ -61,4 +60,6 @@ while [ $# -gt 0 ]; do
echo "${value}" > "${__cdist_ddir}/${opt_file}"
echo "${__cdist_abs_myname}" > "${__cdist_ddir}/${__cdist_object_source}"
done

Loading…
Cancel
Save