59: def self.pack(src, destname, signer = nil)
60: TarOutput.open(destname, signer) do |outp|
61: dir_class.chdir(src) do
62: outp.metadata = (file_class.read("RPA/metadata") rescue nil)
63: find_class.find('.') do |entry|
64: case
65: when file_class.file?(entry)
66: entry.sub!(%r{\./}, "")
67: next if entry =~ /\ARPA\//
68: stat = File.stat(entry)
69: outp.add_file_simple(entry, stat.mode, stat.size) do |os|
70: file_class.open(entry, "rb") do |f|
71: os.write(f.read(4096)) until f.eof?
72: end
73: end
74: when file_class.dir?(entry)
75: entry.sub!(%r{\./}, "")
76: next if entry == "RPA"
77: outp.mkdir(entry, file_class.stat(entry).mode)
78: else
79: raise "Don't know how to pack this yet!"
80: end
81: end
82: end
83: end
84: end