`rpmlint` considers a lack of a changelog an error.
this is a similar behaviour to the DEB packager, where a generic
default changelog is generated unless one is provided explicitly.
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
A hopefully-actionable error message is provided when an invalid version
is given when making a Debian package.
To aid readability, rewrote the relationship pattern as a multiline regex. Added separate pattern for version field.
Test coverage added for #1969's "v" prefix removal.
For #1847
A user reported that on macOS Catalina, the default pkgbuild install
location may result in a .pkg file which cannot be installed.
This change makes fpm's `--prefix` option pass through to `pkgbuild`'s
`--install-location` flag
> With macOS Catalina, you can no longer store files or data in the read-only system volume, nor can you write to the "root" directory ( / ) from the command line, such as with Terminal.
References:
* macOS Catalina's new read-only root filesystem: https://support.apple.com/en-us/HT210650Fixes#1908
On older versions of rubygems, `Gem::Version.new(...)` calls
`String#strip!` on the argument in the constructor. This causes a
problem on Ruby 1.9.3 where the RUBY_VERSION constant is a frozen
string.
The workaround is to make a copy of this string that is unfrozen, and
`String#dup` seems to work :)
The original `json` gem dependency was added in the original fpm.gemspec
because, at the time, Ruby 1.8.7 was common and required an external
`json` dependency for parsing JSON.
Later, Ruby releases since 1.9.1 have bundled `json`[1].
Therefore, it feels safe to remove this dependency. As a bonus, the
rubygems `json` gem places requirements on the minimum version of Ruby.
At this time, the latest `json` gem requires Ruby >= 2.3.
If the `json` gem dependency is removed, fpm will still retain the
ability to process JSON while lowering the minimum required Ruby version
to Ruby 1.9.x -- It's not perfect, but it's a start! :)
[1] https://docs.ruby-lang.org/en/2.3.0/NEWS-1_9_1.html
The idea for this change change came originally from a discussion
with @edolnx in #1949Fixes#1741, #1264, #1949
Cases:
* Option ordering (the flag operates in-place)
* Multiple --long-flags on a single line
* Multiple single flags on a single line (both like '-ff' and '-f -f')
* File self-reference errors
This option flag will cause fpm to load additional flags, in place, from
the given file.
For example, if a file "foo" contains one line, "--version 5.10", then
`fpm -s empty -t deb -n example --fpm-options-file foo` act as if
`--version 5.10` was given on the command-line in the same position as
the `--fpm-options-file` flag.
Error conditions checked:
* Has the file already been loaded?
* Does the file exist?
* Is the file readable?
No tests included at this time. This code is likely missing some edge
cases (combined single-letter flags, multiple flag entries on a line,
etc).
Folks are reporting that fpm cannot be installed easily (or at all) on
older systems because a transitive dependency(1) rejects ruby versions
older than 2.6.
(1) rubygem git depends on addressable which depends on public_suffix
Since the `git` dependency is only used in the `gem` source when
using a git repo as a installation source, and that usage seems pretty
simple -- clone a repo, checkout a branch, etc -- it feels safe to
remove this dependency while still keeping the same functionality.
Fixes#1923