From dd562befc9d2d9e0dce1352b740e91b2b6ccfc07 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 25 Nov 2014 23:00:17 +0100 Subject: [PATCH] add support for --target-release for __package_apt Signed-off-by: Nico Schottelius --- cdist/conf/type/__file/gencode-local | 2 +- cdist/conf/type/__package_apt/gencode-remote | 10 +++++++++- cdist/conf/type/__package_apt/man.text | 3 +++ cdist/conf/type/__package_apt/parameter/optional | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__file/gencode-local b/cdist/conf/type/__file/gencode-local index 601705c8..ed7482cb 100755 --- a/cdist/conf/type/__file/gencode-local +++ b/cdist/conf/type/__file/gencode-local @@ -67,7 +67,7 @@ DONE if [ "$upload_file" ]; then echo upload >> "$__messages_out" cat << DONE -$__remote_copy $source ${__target_host}:\$destination_upload +$__remote_copy "$source" "${__target_host}:\$destination_upload" DONE fi # move uploaded file into place diff --git a/cdist/conf/type/__package_apt/gencode-remote b/cdist/conf/type/__package_apt/gencode-remote index 08216db1..1feec012 100755 --- a/cdist/conf/type/__package_apt/gencode-remote +++ b/cdist/conf/type/__package_apt/gencode-remote @@ -33,6 +33,14 @@ else state_should="present" fi +if [ -f "$__object/parameter/target-release" ]; then + target_release="--target-release $(cat "$__object/parameter/target-release")" +else + target_release="" +fi + + + # FIXME: use grep directly, state is a list, not a line! state_is="$(cat "$__object/explorer/state")" case "$state_is" in @@ -50,7 +58,7 @@ aptget="DEBIAN_FRONTEND=noninteractive apt-get --quiet --yes --no-install-recomm case "$state_should" in present) - echo $aptget install \"$name\" + echo $aptget install $target_release \"$name\" ;; absent) echo $aptget remove \"$name\" diff --git a/cdist/conf/type/__package_apt/man.text b/cdist/conf/type/__package_apt/man.text index 5d4656c1..c1f8ee1f 100644 --- a/cdist/conf/type/__package_apt/man.text +++ b/cdist/conf/type/__package_apt/man.text @@ -27,6 +27,9 @@ name:: state:: Either "present" or "absent", defaults to "present" +target-release:: + Passed on to apt-get install, see apt-get(8). + Essentially allows you to retrieve packages from a different release EXAMPLES -------- diff --git a/cdist/conf/type/__package_apt/parameter/optional b/cdist/conf/type/__package_apt/parameter/optional index 41b8e6cf..d6674f95 100644 --- a/cdist/conf/type/__package_apt/parameter/optional +++ b/cdist/conf/type/__package_apt/parameter/optional @@ -1,3 +1,4 @@ name version state +target-release