From c35efbcae1b0a3006de692ab7915331acbec9245 Mon Sep 17 00:00:00 2001
From: Marc Fournier <marc.fournier@camptocamp.com>
Date: Thu, 24 Sep 2009 09:43:05 +0200
Subject: [PATCH/puppet 1/1] Fix 2675 - re-add ending slash to directory names

The ending slash in resource file name gets stripped off by the File.split
operation in munge(). This patch adds it back again.

Signed-off-by: Marc Fournier <marc.fournier@camptocamp.com>
---
 lib/puppet/type/file.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index 34dc445..b870d48 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -39,7 +39,8 @@ module Puppet
             # path name. The aim is to use less storage for all common paths in a hierarchy
             munge do |value|
                 path, name = File.split(value)
-                { :index => Puppet::FileCollection.collection.index(path), :name => name }
+                terminator = (value[-1,1] == File::SEPARATOR) ? File::SEPARATOR : ''
+                { :index => Puppet::FileCollection.collection.index(path), :name => name + terminator }
             end
 
             # and the reverse
-- 
1.6.3.3


