diff options
author | David Schmitt <david@schmitt.edv-bus.at> | 2008-06-26 12:01:24 +0200 |
---|---|---|
committer | David Schmitt <david@schmitt.edv-bus.at> | 2008-06-26 12:01:24 +0200 |
commit | 07ebdfa2c59684e79b0a1904858c9072b47601c5 (patch) | |
tree | 98e766ea2e63462c2161cf483765bb0c445bb688 | |
parent | 7820051c671cf47043bb15ad646e32c6a73d61a6 (diff) | |
download | puppet-common-07ebdfa2c59684e79b0a1904858c9072b47601c5.tar.gz puppet-common-07ebdfa2c59684e79b0a1904858c9072b47601c5.tar.bz2 |
line: do a full string match of $line instead of a regex match
This allows $line to contain '/' characters and is generally the safer
thing to do.
Patch from Francois Deppierraz <francois.deppierraz@camptocamp.com>
-rw-r--r-- | manifests/defines/line.pp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/manifests/defines/line.pp b/manifests/defines/line.pp index 2eb8f98..c055f5b 100644 --- a/manifests/defines/line.pp +++ b/manifests/defines/line.pp @@ -32,7 +32,7 @@ define line($file, $line, $ensure = 'present') { } } absent: { - exec { "perl -ni -e 'print unless /^\\Q${line}\\E\$/' '${file}'": + exec { "perl -ni -e 'print if \$_ ne \"${line}\n\";' '${file}'": onlyif => "grep -qFx '${line}' '${file}'" } } |