Allow ids to contain slashes

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-25 02:13:11 +01:00
commit 45429c2ca0
3 changed files with 15 additions and 2 deletions

View file

@ -6,6 +6,8 @@
echo "Running initial manifest for $__target_host"
echo "We could access other manifests in $__manifest"
__file /etc/configured-via-cdist --type file
case "$__target_host" in
localhost)
__issue iddoesnotmatterhere

View file

@ -28,9 +28,20 @@ type="$(cat "$__object/parameter/type")"
if [ -f "$__object/parameter/destination" ]; then
destination="$(cat "$__object/parameter/destination")"
else
destination="$__object_id"
# If no destination has been supplied, the id is the destination
# Prepend /, which got lost in the object id (and relative paths
# don't make sense)
destination="/$__object_id"
fi
# Ensure we have an absolute path
if ! $(echo "$destination" | grep -q ^/); then
echo "Error: Destination ($destination) of $__object_id is not absolute." >&2
exit 1
fi
# FIXME: Add file copying part here
case "$type" in
directory)
echo mkdir \"$destination\"