Hi all,

I filed a bug under BUILDR-578.

tar task does not preserve uid/gid on folders, but it does on files.
I wasn't able to write a test to show the defect without being root for running tests, but I can submit a working patch.

--
Jean-Philippe Caruana
----------------------------------------------------------------------
sorry for the crap that will be appended here:

********************************
Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'attention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration. Multimedia Business 
Services decline
toute responsabilite au titre de ce message s'il a ete altere, deforme
ou falsifie.
Si vous n'etes pas destinataire de ce message, merci de le detruire
immediatement et d'avertir l'expediteur.
*********************************
This message and any attachments (the "message") are confidential and
intended solely for the addressees. Any unauthorised use or
dissemination is prohibited.
Messages are susceptible to alteration. Multimedia Business Services shall not 
be liable for the
message if altered, changed or falsified.
If you are not the intended addressee of this message, please cancel it
immediately and inform the sender..
********************************
diff --git a/lib/buildr/packaging/tar.rb b/lib/buildr/packaging/tar.rb
index 4bae322..7ad6c39 100644
--- a/lib/buildr/packaging/tar.rb
+++ b/lib/buildr/packaging/tar.rb
@@ -98,7 +98,7 @@ module Buildr
           elsif content.nil?
           elsif File.directory?(content.to_s)
             stat = File.stat(content.to_s)
-            tar.mkdir(path, options.merge(:mode=>stat.mode, :mtime=>stat.mtime))
+            tar.mkdir(path, options.merge(:mode=>stat.mode, :mtime=>stat.mtime, :uid=>stat.uid, :gid=>stat.gid))
           else
             File.open content.to_s, 'rb' do |is|
               tar.add_file path, options.merge(:mode=>is.stat.mode, :mtime=>is.stat.mtime, :uid=>is.stat.uid, :gid=>is.stat.gid) do |os, opts|

Reply via email to