create __cdist_object_id_from_object and use it + __cdist_type_from_object in cdist-manifest-run-all

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-23 09:50:30 +01:00
parent 51669874a7
commit a12df5ce7c
2 changed files with 7 additions and 2 deletions

View file

@ -160,6 +160,11 @@ __cdist_type_from_object()
echo "${1%%/*}"
}
__cdist_object_id_from_object()
{
echo "${1#*/}"
}
__cdist_object_arg()
{
local arg="$1"; shift

View file

@ -53,12 +53,12 @@ while [ "$__cdist_new_objects_created" = "y" ]; do
# Full path to current object
__cdist_cur_object_dir="$__cdist_object_base_dir/$__cdist_object"
# Only the id
__cdist_object_id="${__cdist_object#*/}"
__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")"
if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then
echo "Working on object ${__cdist_object} ..."
__cdist_type="${__cdist_object%%/*}"
__cdist_type="$(__cdist_type_from_object "$__cdist_object")"
__cdist_manifest="$__cdist_type_dir/${__cdist_type}/${__cdist_name_manifest}"
echo $__cdist_manifest