rename manifest -> manifests and use subshell in__cdist_object_list()

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-17 09:17:13 +01:00
parent 7f96e30971
commit 662eee7ea3

View file

@ -33,7 +33,12 @@
: ${__cdist_name_gencode:=gencode} : ${__cdist_name_gencode:=gencode}
: ${__cdist_name_host:=hosts} : ${__cdist_name_host:=hosts}
: ${__cdist_name_init:=init} : ${__cdist_name_init:=init}
: ${__cdist_name_manifest:=manifests}
# Name of the manifest file in types
: ${__cdist_name_manifest:=manifest}
# Name of the base directory containing the initial manifests
: ${__cdist_name_manifests:=manifests}
: ${__cdist_name_object:=objects} : ${__cdist_name_object:=objects}
: ${__cdist_name_type:=types} : ${__cdist_name_type:=types}
@ -54,7 +59,7 @@
# Base # Base
: ${__cdist_config:=/etc/cdist} : ${__cdist_config:=/etc/cdist}
: ${__cdist_explorer_dir:=$__cdist_config/$__cdist_name_explorer} : ${__cdist_explorer_dir:=$__cdist_config/$__cdist_name_explorer}
: ${__cdist_manifest_dir:=$__cdist_config/$__cdist_name_manifest} : ${__cdist_manifest_dir:=$__cdist_config/$__cdist_name_manifests}
: ${__cdist_manifest_init:=$__cdist_manifest_dir/$__cdist_name_init} : ${__cdist_manifest_init:=$__cdist_manifest_dir/$__cdist_name_init}
: ${__cdist_type_dir:=$__cdist_config/$__cdist_name_type} : ${__cdist_type_dir:=$__cdist_config/$__cdist_name_type}
@ -151,10 +156,14 @@ __cdist_object_list()
{ {
local basedir="$1"; shift local basedir="$1"; shift
# Use subshell to prevent changing cwd in program
(
cd "${basedir}" cd "${basedir}"
find . -name "$__cdist_name_object_source" | \ find . -name "$__cdist_name_object_source" | \
sed -e "s;$__cdist_name_object_source\$;;" -e 's;^./;;' sed -e "s;$__cdist_name_object_source\$;;" -e 's;^./;;'
)
} }
__cdist_object_source() __cdist_object_source()