Fpm: .script directory always created and in tar file

Created on 31 May 2016  路  6Comments  路  Source: jordansissel/fpm

When creating tar packages (-d tar), a directory .script is always part of the tar file even if there is no script. In tar.rb:

# Write the scripts, too.
scripts_path = File.join(staging_path, ".scripts")
::Dir.mkdir(scripts_path)
[:before_install, :after_install, :before_remove, :after_remove].each do |name|
next unless script?(name)
out = File.join(scripts_path, name.to_s)
logger.debug("Writing script", :source => name, :target => out)
File.write(out, script(name))
File.chmod(0755, out)
end

mkdir is done in all cases and not removed if there is no script.
The tar file is created from '.' which will include the superfluous and unwanted .script directory.

bug

All 6 comments

Indeed, this sounds like a bug.

Ans has it a sense for creating .script for tar output even if there is scripts defined for before/after-install/remove ?

This bug is affecting me. If no one else is planning to work on it I'm happy to have a crack. @jordansissel, that ok with you?

@thiagofigueiro go for it :)

Thanks for the PR @thiagofigueiro. This was also something I noticed today while starting a new task to support tar packages. My luck a PR was created a day ago! Hoping this goes mainline soon! :+1:

1374 is merged and fixes this thanks to @thiagofigueiro :)

Was this page helpful?
0 / 5 - 0 ratings