From 489639f8e0ab8723efb261a3f5aa648d00dbe7d2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 2 Feb 2011 19:15:53 +0100 Subject: [PATCH] split: cdist-build-host-cconfig to cdist-manifest-init and cdist-manifest-run Signed-off-by: Nico Schottelius --- bin/cdist-manifest-init | 29 +++++++++++++++++++ ...-build-host-cconfig => cdist-manifest-run} | 13 ++++----- 2 files changed, 35 insertions(+), 7 deletions(-) create mode 100755 bin/cdist-manifest-init rename bin/{cdist-build-host-cconfig => cdist-manifest-run} (79%) diff --git a/bin/cdist-manifest-init b/bin/cdist-manifest-init new file mode 100755 index 00000000..2ab2b758 --- /dev/null +++ b/bin/cdist-manifest-init @@ -0,0 +1,29 @@ +#!/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 . +# +# +# Let's build a cconfig tree from a configuration +# And save it into the cache tree +# + +. cdist-config + +[ "${__cdist_target_host}" ] || __cdist_usage "Need \$__cdist_target_host setup" + +cdist-manifest-run "$(__cdist_cache_host)" "${__cdist_manifest_init}" diff --git a/bin/cdist-build-host-cconfig b/bin/cdist-manifest-run similarity index 79% rename from bin/cdist-build-host-cconfig rename to bin/cdist-manifest-run index 0fb7817f..cf8417cc 100755 --- a/bin/cdist-build-host-cconfig +++ b/bin/cdist-manifest-run @@ -24,11 +24,15 @@ . cdist-config -[ "${__cdist_target_host}" ] || __cdist_usage "Need \$__cdist_target_host setup" -[ "${__cdist_output_dir}" ] || __cdist_usage "Need \$__cdist_output_dir setup" +if [ $# -ne 2 ]; then + __cdist_usage " " +fi set -au +__cdist_output_dir="$1"; shift +__cdist_manifest="$1"; shift + # prepend our path, so all cdist tools come before other tools PATH="${__cdist_cache_bin}:$PATH" @@ -37,10 +41,5 @@ if [ ! -x "${__cdist_manifest_init}" ]; then __cdist_exit_err "${__cdist_manifest_init} needs to be executable." fi -# create output dir ?? mkdir -p "$(__cdist_output_dir)" - -# Create output / take manifest as argument? "${__cdist_manifest_init}" - -echo "Finished tree generation, have a look at ${__cdist_output_dir}."