From fa80fc2b311b689c41b4ee2913f6bfb9f7c159c6 Mon Sep 17 00:00:00 2001 From: Jonathan Boyett Date: Fri, 3 Dec 2010 12:35:23 -0800 Subject: add a -g flag to concatfragments.sh to disable GNU extensions to find, sort and xargs; makes concat work on Solaris. Add a $gnu parameter to make use of the aforementioned -g flag, and a $order parameter to make use of the -n flag in concatfragments.sh --- manifests/init.pp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index b94411c..909d7b6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -87,7 +87,7 @@ # ALIASES: # - The exec can notified using Exec["concat_/path/to/file"] or Exec["concat_/path/to/directory"] # - The final file can be referened as File["/path/to/file"] or File["concat_/path/to/file"] -define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $force = "false", $backup = "puppet") { +define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $force = "false", $backup = "puppet", $gnu = "true", $order="alpha") { $safe_name = regsubst($name, '/', '_', 'G') $concatdir = $concat::setup::concatdir $version = $concat::setup::majorversion @@ -113,6 +113,18 @@ define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $ default: { fail("Improper 'force' value given to concat: $force") } } + case $gnu { + 'true',true,yes,on: { $gnuflag = "" } + 'false',false,no,off: { $gnuflag = "-g" } + default: { fail("Improper 'gnu' value given to concat: $gnu") } + } + + case $order { + numeric: { $orderflag = "-n" } + alpha: { $orderflag = "" } + default: { fail("Improper 'order' value given to concat: $order") } + } + File{ owner => root, group => root, @@ -158,7 +170,7 @@ define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $ subscribe => File[$fragdir], alias => "concat_${fragdir}", require => [ File["/usr/local/bin/concatfragments.sh"], File[$fragdir], File["${fragdir}/fragments"], File["${fragdir}/fragments.concat"] ], - unless => "/usr/local/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} -t ${warnflag} ${forceflag}", - command => "/usr/local/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} ${warnflag} ${forceflag}", + unless => "/usr/local/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} -t ${warnflag} ${forceflag} ${orderflag} ${gnuflag}", + command => "/usr/local/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} ${warnflag} ${forceflag} ${orderflag} ${gnuflag}", } } -- cgit v1.2.3