diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-02 15:29:57 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-02 15:29:57 +0000 |
| commit | 37d2850ade3c4e8e94f3abdbc01afc159ed7dbd0 (patch) | |
| tree | 650001a26c94d5ac684809a90d233212f35f2ee8 | |
| parent | 8b0481c391cd9c31a76c33eb66d4fb91fa8b7259 (diff) | |
| download | puppet-37d2850ade3c4e8e94f3abdbc01afc159ed7dbd0.tar.gz puppet-37d2850ade3c4e8e94f3abdbc01afc159ed7dbd0.tar.xz puppet-37d2850ade3c4e8e94f3abdbc01afc159ed7dbd0.zip | |
Switching to just using "preserve" for file copying in file#handlebackups
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1164 980ebf18-57e1-0310-9a29-db15c13687c0
| -rw-r--r-- | lib/puppet/type/pfile.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb index 44d888ce2..ef55eef0e 100644 --- a/lib/puppet/type/pfile.rb +++ b/lib/puppet/type/pfile.rb @@ -274,12 +274,10 @@ module Puppet # FIXME Shouldn't this just use a Puppet object with # 'source' specified? bfile = file + backup - FileUtils.cp(file, bfile) - unless File.stat(file).mode == File.stat(bfile).mode - mode = File.stat(file).mode & 007777 - File.chmod(mode, bfile) - end + # Ruby 1.8.1 requires the 'preserve' addition, but + # later versions do not appear to require it. + FileUtils.cp(file, bfile, :preserve => true) return true rescue => detail # since they said they want a backup, let's error out |
