jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.09k stars 1.07k forks source link

Use a temporary path when testing archive commands. #1993

Closed jordansissel closed 1 year ago

jordansissel commented 1 year ago

Previously, fpm would write to the current directory when using methods to check for the correct ar and tar commands.

This now uses Stud::Temporary to get a random path in the system temporary directory.

I found this error in the test suite when the fpm git workspace was not writable -- for example, when mounted read-only through a container.

Error message, for posterity:

1) FPM::Command -p | --package when given a directory should write the package to the given directory.
   Failure/Error: cmd.run(["-s", "empty", "-t", "deb", "-n", "example", "-p", path])
   Errno::EACCES:
     Permission denied @ rb_sysopen - fpm-dummy.tmp