Closed haf closed 9 years ago
From this line of code https://github.com/bernd/fpm-cookery/blob/master/lib/fpm/cookery/source_handler/curl.rb#L71
def extracted_source
entries = Dir['*'].select {|dir| File.directory?(dir) }
case entries.size
when 0
files = Dir['*'].select {|dir| File.file?(dir) }
if files.size > 0
builddir
else
raise "Empty archive! (#{local_path})"
end
when 1
entries.first
else
# Use the directory that was created last.
dir = entries.sort do |a, b|
File.stat(a).ctime <=> File.stat(b).ctime
end.last
if File.exist?(dir)
dir
else
raise "Could not find source directory for #{local_path.basename}"
end
end
end
Why would it just pick a single of all the directories?
For most software projects you get one folder in a tarball/zip and that's why fpm-cookery changes into that directory by default.
If you want to get all directories in tmp-build
into the package you can do the following.
Dir.chdir(builddir) do
(opt/'eventstore').install Dir['*']
end
Closing this, please re-open if you still have problems. Thank you!
Hi,
I'm trying to get it to pick up ALL files in the tmp-build folder. How do I do that?
(opt/'eventstore').install Dir['*']
only picks up a single subfolder:https://github.com/haf/fpm-recipes/blob/master/eventstore/recipe.rb