When building Debian packages with debhelper, files in `/etc` are
automatically marked as configuration files (this is done since
compatibility level 3 which was introduced in 2000). Therefore, packages
built with fpm may come as a surprise since they don't do that. A user
can still add `--config-files /etc` but they have to know that (usually
after a valuable modification has been erased).
This change add `/etc` to the list of configuration files for Debian
unless fpm is invoked with `--deb-no-config-files`.
Closes: #873
This was accomlished with this sed invocation (OSX):
sed -Ei "" -e 's/ +$//' {lib,spec}/**/*.rb
(It would be `-r` instead of `-E` on systems with GNU sed)
Anyway. I did this because I'm frustrated folks unintentionally submit
patches with tons of whitespace changes done automatically by their
editor and without confirmation. The whitespace changes make `git blame`
lie, and it also makes doing the code review more difficult. While
Github is capable of showing a code diff that ignores whitespace (via
`?w=1`), that view does not permit commenting on the code change.
This makes use of shared examples, rspec's expect (instead of my
insist), and cleans up some longer tests that had complex 'it' blocks
into before/let/it.
lintian expects the package name to ends with ".deb". Also, rspec
disallows the use of a let variable in an `after(:context)` hook. Also
fix the name of instance variable `@staging_path`.
* Resolve any ruby warnings (ruby -wc)
* Use expect().to(...) instead of insist { ... }
* Avoid `:all` in hooks
* Use `let` instead of instance variables
* Use Stud::Temporary instead of Tempfile
Switched to using `ar p ... | tar -zx` instead. Test passes on OSX.
I also took this as an opportunity to update the style to use rspec a
bit better. Using `let` and avoiding `before :all` and such.
There are still 4 test failures:
* rspec ./spec/fpm/package/rpm_spec.rb:297 # FPM::Package::RPM#output package attributes should have the correct 'after_target_uninstall' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:288 # FPM::Package::RPM#output package attributes should have the correct 'before_uninstall' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:279 # FPM::Package::RPM#output package attributes should have the correct 'after_install' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:270 # FPM::Package::RPM#output package attributes should have the correct 'before_install' trigger script
Added test coverage to ensure a broken symlink doesn't throw a ENOENT
error. The test was written first, and failed, but now passes with the
fix to the dir package.
Fixes#658
Supported log levels: error, warn, info, debug.
--verbose is the same as --log=info
--debug is the same as --log=debug
--log=warn is the default
Requested by mattgreenrocks on irc.
When --rpm-dist is specified, pass the dist tag to rpmbuild and
correctly name the file to ensure packages can be built with a
specific distribution in mind.
tar flags.
The reason for this is that if we do output, it fails like so;
1) FPM::Package::Deb#tar_flags should set the group for the package's data files
Failure/Error: @package.output(@target)
FPM::Util::ProcessFailed:
tar failed (exit code 2). Full command was:["tar", "-C", "/tmp/package-deb-staging20140423-5427-10uiv96", "-z", "--numeric-owner", "--owner", "0", "--group", "nogroup", "-cf", "/tmp/package-deb-build20140423-5427-19uvbmw/data.tar.gz", "."]
Because 'nogroup' isn't a valid group when tar is run, but we want to check
that 'nogroup' is set in the tar args, not that tar works ;)
It was failing on OSX due to file searching occuring in a different
order, and frankly we can predict the path of the script dir, so
let's use that instead of searching for it.
The rpm-use-file-permissions setting asks each file who owns it and what
the mode is. Sometimes you only want the mode, or sometimes the user is
not correct for deployment. Now, specifying --rpm-user will force the
owner to be the given user but still respect the file modes gathered
by --rpm-use-file-permissions.
The intent of this change is:
* --rpm-use-file-permissions still works the same, when alone
* --rpm-user forces the 'user' owner regardless of the above
* --rpm-group forces the 'group' owner regardless of the above
This was identified by https://logstash.jira.com/browse/LOGSTASH-2012
Now uses Stud::Temporary. Much happier.
(Tempfile uses finalizers to remove files on disk during GC, which
messes things up if all you want is a temporary "path name" not a file
itself.)
Filenames containing special characters like '%' won't stat correctly
because they've already been sanitized and the current working directory could
potentially be off.
This is a failing spec to show a bug in FPM::Package#convert:
Default attributes of the target package format are applied when calling .new,
but then discarded and entirely replaced with the attributes of the source
package.
The flag options defined as "--[no-]foo" were being set in the
attributes hash as :"[no_]foo" => true/false.
This change may break other tests, as it sets up the defaults in the
test cases according to the option definition, rather than defaulting to
false (as previously).
Basic support for OS X flat packages (.pkg)
- input/output
- output supports scripts, postinstall actions (using --info option),
ownership option and bundle-id-prefix option
- requires pkgbuild (therefore OS X 10.7+ only), pkgutil for input
- no tests yet
ignore .DS_Store
ignore .pkg
identifier gets its own method
first few osxpkg spec tests
osxpkg: extract name and version from PackageInfo on input
osxpkg: rename option bundle-id-prefix to identifier-prefix
- 'bundle-id' is ambiguous, given the various 'bundle'-related logic possible with OS X packages
osxpkg: fix old 'osx_' attribute prefix to 'osxpkg' in osxpkg.erb
New option: --osxpkg-dont-obsolete, to add files to 'dont-obsolete' element in PackageInfo.
osxpkg: Define public/private methods.
osxpkg_spec: Tests for basic attributes through input/output
Added the following two flags:
--[no-]python-downcase-name
(python only) Should the target package name be in lowercase? (default: true)
--[no-]python-downcase-dependencies
(python only) Should the package dependencies be in lowercase? (default: true)
fixes#326
This ensures future regressions are caught before fpm releases.
- rpm: if epoch is nil, default to 1. This fixes a regression where fpm
0.4.3 generated rpms with an epoch of '1' and the fpm 0.4.17 (or
somewhere in between) started generating rpms with no epoch value.
This caused version comparisions of '15' and '10' to show '10' as
newer if you built the version 10 one in older fpms.