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