New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.script directory always created and in tar file #1123

Closed
ppoilbarbe opened this Issue May 31, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@ppoilbarbe
Contributor

ppoilbarbe commented May 31, 2016

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.

@jordansissel jordansissel added the bug label May 31, 2016

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 31, 2016

Indeed, this sounds like a bug.

@ppoilbarbe

This comment has been minimized.

Contributor

ppoilbarbe commented Jun 1, 2016

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

@thiagofigueiro

This comment has been minimized.

Contributor

thiagofigueiro commented Mar 7, 2017

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?

@josegonzalez

This comment has been minimized.

Collaborator

josegonzalez commented Mar 7, 2017

@thiagofigueiro go for it :)

thiagofigueiro added a commit to thiagofigueiro/fpm that referenced this issue Mar 7, 2017

thiagofigueiro added a commit to thiagofigueiro/fpm that referenced this issue Mar 7, 2017

thiagofigueiro added a commit to thiagofigueiro/fpm that referenced this issue Mar 7, 2017

thiagofigueiro added a commit to thiagofigueiro/fpm that referenced this issue Mar 7, 2017

@jvasallo

This comment has been minimized.

jvasallo commented Mar 8, 2017

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! 👍

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Jul 20, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment