merge master

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-03-28 15:27:00 +02:00
commit db66d3731d
18 changed files with 295 additions and 56 deletions

37
bin/cdist-cache Executable file
View file

@ -0,0 +1,37 @@
#!/bin/sh
#
# 2010 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
#
# Let's build a cconfig tree from a configuration
# And save it into the cache tree
#
. cdist-config
[ $# -eq 1 ] || __cdist_usage "<target host>"
set -u
__cdist_target_host="$1"; shift
mkdir -p "${__cdist_local_base_cache_dir}"
__cdist_abs_cache_dir="$(cd "$__cdist_local_base_cache_dir" && pwd -P)"
__cdist_abs_ddir="$__cdist_abs_cache_dir/$__cdist_target_host"
echo "Saving cache to $__cdist_abs_ddir ..."
rm -rf "$__cdist_abs_ddir"
mv "$__cdist_local_base_dir" "$__cdist_abs_ddir"

View file

@ -19,7 +19,7 @@
#
#
__cdist_version="1.4.1"
__cdist_version="1.5.0pre"
# Fail if something bogus is going on
set -u
@ -41,6 +41,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
#
: ${__cdist_name_bin:=bin}
: ${__cdist_name_cache:=cache}
: ${__cdist_name_code:=code}
: ${__cdist_name_code_finished:=codedone}
: ${__cdist_name_conf_dir:=conf}
@ -100,6 +101,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
# Local Base
#
: ${__cdist_local_base_dir:=$__cdist_tmp_dir}
: ${__cdist_local_base_cache_dir:=$__cdist_abs_mydir/../$__cdist_name_cache}
: ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"}

View file

@ -155,7 +155,7 @@ if [ -e "${__cdist_object_dir}" ]; then
# Allow diff to fail
set +e
diff -ru "${__cdist_new_object_dir}/${__cdist_name_parameter}" \
"${__cdist_object_dir}/${__cdist_name_parameter}" \
"${__cdist_object_dir}/${__cdist_name_parameter}" \
> "$__cdist_tmp_file"; ret=$?
set -e