implement the big code shuffle

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-03-29 14:36:35 +02:00
commit f187ed257a
8 changed files with 67 additions and 87 deletions

View file

@ -57,6 +57,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
: ${__cdist_name_object_finished:=done}
: ${__cdist_name_object_id:=object_id}
: ${__cdist_name_object_source:=source}
: ${__cdist_name_objects_created:=.objects_created}
: ${__cdist_name_out_dir:=out}
: ${__cdist_name_parameter:=parameter}
: ${__cdist_name_parameter_required:=required}
@ -68,6 +69,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
: ${__cdist_name_type:=type}
: ${__cdist_name_type_bin:=type_bin}
: ${__cdist_name_type_explorer:=type_explorer}
: ${__cdist_name_type_explorer_pushed:=.explorer_pushed}
# Used for IDs: Allow everything not starting with - and .
: ${__cdist_sane_regexp:=[^-\.].*}
@ -115,6 +117,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
: ${__cdist_out_dir:=$__cdist_local_base_dir/$__cdist_name_out_dir}
: ${__cdist_out_explorer_dir:=$__cdist_out_dir/$__cdist_name_explorer}
: ${__cdist_out_object_dir:=$__cdist_out_dir/$__cdist_name_object}
: ${__cdist_out_type_dir:=$__cdist_out_dir/$__cdist_name_type}
: ${__cdist_out_type_bin_dir:=$__cdist_out_dir/$__cdist_name_type_bin}
################################################################################
@ -134,6 +137,11 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
: ${__cdist_remote_out_explorer_dir:=$__cdist_remote_out_dir/$__cdist_name_explorer}
: ${__cdist_remote_out_object_dir:=$__cdist_remote_out_dir/$__cdist_name_object}
################################################################################
# Global internal variables
#
: ${__cdist_objects_created:=$__cdist_out_object_dir/$__cdist_name_objects_created}
################################################################################
# Internal functions
#
@ -329,6 +337,18 @@ __cdist_type_has_explorer()
fi
}
__cdist_type_explorer_pushed()
{
[ -f "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" ] \
&& grep -q "$1" "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}"
}
__cdist_type_explorer_pushed_add()
{
[ -d "$__cdist_out_type_dir" ] || mkdir "$__cdist_out_type_dir"
echo "$1" >> "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}"
}
__cdist_type_gencode()
{
echo "${__cdist_type_dir}/$1/${__cdist_name_gencode}"