+mass cleanup

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-08 00:08:05 +01:00
parent 425f2bb71a
commit 2f926582e0
5 changed files with 16 additions and 11 deletions

View File

@ -13,19 +13,21 @@ What you can do so far: (executed from top level directory)
# prepare use: # prepare use:
export PATH="$PATH:$(pwd -P)/bin" export PATH="$PATH:$(pwd -P)/bin"
object_tmp=/tmp/localhost/objects
explorer_tmp=/tmp/localhost/explorers
# Test first level manifest execution # Test first level manifest execution
__cdist_config=$(pwd -P)/conf __cdist_target_host=localhost cdist-manifest-init __cdist_config=$(pwd -P)/conf cdist-manifest-init localhost $object_tmp
# See what it generated # See what it generated
find conf/cache find $object_tmp
# Run explorer on a "remote" host # Run explorer on a "remote" host
__cdist_config=$(pwd -P)/conf __cdist_target_host=localhost cdist-explorer-run __cdist_config=$(pwd -P)/conf cdist-explorer-run localhost $explorer_tmp
# Display result # Display result
find conf/cache/hosts/localhost find $explorer_tmp
# Soon working: # Soon working:
__cdist_config=$(pwd -P)/conf __cdist_target_host=localhost cdist-manifest-recursive-run ~/p/cdist/conf/cache/hosts/localhost/objects __cdist_config=$(pwd -P)/conf cdist-manifest-recursive-run localhost $object_tmp

View File

@ -29,12 +29,13 @@
. cdist-config . cdist-config
if [ $# -ne 1 ]; then if [ $# -ne 2 ]; then
__cdist_usage "<object_dir>" __cdist_usage "<target host> <object_dir>"
fi fi
set -eu set -eu
__cdist_target_host="$1"; shift
__cdist_object_dir="$1"; shift __cdist_object_dir="$1"; shift
# change to directory containing objects # change to directory containing objects
@ -67,7 +68,7 @@ while [ "$__cdist_object_created_new" = 1 ]; do
if [ -x "${manifest}" ]; then if [ -x "${manifest}" ]; then
echo "Running manifest of type ${type} ..." echo "Running manifest of type ${type} ..."
cdist-manifest-run "${__cdist_tmp_dir}" "${manifest}" cdist-manifest-run "$__cdist_target_host" "${manifest}" "${__cdist_tmp_dir}"
echo "Trying to merge... " echo "Trying to merge... "
@ -80,8 +81,7 @@ while [ "$__cdist_object_created_new" = 1 ]; do
while read newobject; do while read newobject; do
if [ -e "$__cdist_object_dir/${newobject}" ]; then if [ -e "$__cdist_object_dir/${newobject}" ]; then
echo FAIIIIIIIIL __cdist_exit_err "${newobject} already exists, merge failed."
exit 23
else else
# Fine, merge back! # Fine, merge back!
pax -r -w "$newobject" "$__cdist_object_dir" pax -r -w "$newobject" "$__cdist_object_dir"

View File

@ -28,7 +28,6 @@ if [ $# -ne 3 ]; then
__cdist_usage "<target host> <manifest> <outdir>" __cdist_usage "<target host> <manifest> <outdir>"
fi fi
set -x
set -aeu set -aeu
export __cdist_target_host="$1"; shift export __cdist_target_host="$1"; shift

View File

@ -2,6 +2,8 @@
# This is a sample manifest, but used in real world # This is a sample manifest, but used in real world
# #
set -x
# All ikqs get a sample file # All ikqs get a sample file
case "$__cdist_target_host" in case "$__cdist_target_host" in
ikq*|localhost) ikq*|localhost)

View File

@ -30,6 +30,8 @@ unsorted: cache / objects
myhost/__file/cdist_bin/destination myhost/__file/cdist_bin/destination
... ...
--------------------------------------------------------------------------------
ENVIRONMENT ENVIRONMENT
----------- -----------