Commit Graph

222 Commits

Author SHA1 Message Date
Jordan Sissel 3bfb7dd64e Merge pull request #828 from gerbercj/feature/sh_metadata
Add package metadata to slug file format
2015-05-07 13:17:31 -07:00
Daniel Haskin 2135264dbe Remove unnecessary requires lines from spec 2015-05-06 21:17:26 -06:00
Daniel Haskin b78e36cd26 Add empty as output target for testing purposes 2015-05-06 21:13:48 -06:00
Daniel Haskin 0ec2e599c3 Add TODO 2015-05-06 20:30:02 -06:00
Adam Lamar e3a8f2f8ef Scope --rpm-dist to rpm.rb 2015-05-06 20:54:51 +00:00
Daniel Haskin 829b664584 Write the test that duplicates the file permissions pacman bug 2015-05-05 23:28:55 -06:00
Daniel Haskin ad4e7572d6 Add bogus dependencies test & functionality 2015-05-05 22:10:26 -06:00
Daniel Haskin 0591af7ab2 Ensure basic unit tests pass for pacman 2015-05-05 00:10:03 -06:00
Daniel Haskin 6136ae409d Add preliminary unit tests for pacman 2015-05-02 21:52:49 -06:00
Jordan Sissel 9f9635d2b3 Merge pull request #877 from vincentbernat/fix/debian-etc-in-conffiles
For Debian packages, register files in `/etc` as conf files
2015-04-24 16:47:17 -07:00
Vincent Bernat 5ecda8ba17 For Debian packages, register files in `/etc` as conf files
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
2015-04-15 17:26:17 +02:00
Maxime Caumartin 2e937359dc Add RPM input tests 2015-04-13 22:56:34 -07:00
Jordan Sissel 88ec5da177 Strip trailing whitespace
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.
2015-04-13 22:32:31 -07:00
Jordan Sissel 4d58315679 Merge pull request #890 from vincentbernat/fix/lintian-rspec
rspec: fix lintian test
2015-04-13 16:22:20 -07:00
Jordan Sissel cd423a2dd7 Continuation of efforts to improve how fpm uses rspec.
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.
2015-04-10 16:52:06 -07:00
Vincent Bernat 682ed48715 rspec: fix lintian test
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`.
2015-04-10 13:49:38 +02:00
Jordan Sissel b8a4a3fbc7 Grand refactor to use my newer rspec style
* 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
2015-04-09 23:42:41 -07:00
Jordan Sissel a1ad3e4760 Fix a failing test on OSX that required 'dpkg-deb'
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.
2015-04-09 23:13:43 -07:00
Ward Vandewege 04804f672c Add tests for python dependency manipulation. Also switch
spec/fixtures/python/setup.py from distutils to setuptools.
2015-03-14 21:02:16 -04:00
Chris Gerber ccc0d9075c Add some basic specs for the SH package 2015-01-28 15:02:33 -05:00
Jordan Sissel 8679dcb26c Fix a whole bunch of Ruby 1.8.7 bugs
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
2014-10-25 21:23:49 +00:00
Jordan Sissel d9df69cf4a Add npm specs 2014-10-25 05:41:28 +00:00
Maxime Caumartin 8d38574b7e Add input and output rpm trigger support
This adds several rpm-specific flags:

--before-install
--after-install
--before-uninstall
--after-target-uninstall

Fixes #626 (merged by hand)
2014-10-25 05:36:37 +00:00
Jordan Sissel a04a3bcb9a Move from @logger ivar to logger method.
Tests pass. Hope is all we have. And hugs.
2014-10-25 05:28:16 +00:00
Jordan Sissel 025642814a Fix typo from previous commit 2014-10-25 04:51:53 +00:00
Grantlyk df56dcc01f Adding validation to stop debian users entering names with spaces
Fixes #779
2014-10-25 04:51:53 +00:00
Jordan Sissel 0045f0095a Don't follow symlinks when copying files.
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
2014-10-25 01:39:42 +00:00
Jordan Sissel 8a29dd5ea0 Add --log=xxx support
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.
2014-10-15 18:29:42 +00:00
Jordan Sissel 811148e5c5 Merge pull request #694 from vStone/bugfix/fix-python-tests-python3
Fixes 2 python issues within the tests
2014-09-18 10:44:35 -07:00
Jordan Sissel 99ffdcd986 Fix typo in test that was causing it to fail. 2014-07-25 13:43:43 +00:00
Jordan Sissel db8ddf4ce2 Ignore cabin subscriptions during testing
This prevents the command lib from subscribing to stdout and causing
warnings to show up during tests.
2014-07-24 19:24:28 +00:00
Jordan Sissel 4c17e1c048 Merge pull request #688 from vStone/bugfix/fix_version_bins_with_no_bins
Fixes an issue where gem-version-bins is enabled but there are no binaries
2014-07-24 12:06:07 -07:00
Jordan Sissel f6379e02a7 Merge pull request #695 from dwb/triggers
dpkg arbitary meta files and triggers
2014-07-24 11:36:55 -07:00
Jordan Sissel 2902c04620 Merge pull request #696 from vStone/bugfix/debian-control-file-permissions
Bugfix/debian control file permissions
2014-07-24 11:29:55 -07:00
Jordan Sissel 9ae5c753b6 Merge branch 'pr/693' (from #693 + typo patch fix) 2014-06-19 05:59:39 +00:00
Jordan Sissel e1a397a69c Fix typo 2014-06-19 05:59:09 +00:00
Jordan Sissel d3e72d36f5 Use rspec 3.0.0
Ran transpec on spec/ directory for automatic and delicious upgrades.

Also removed minitest dependency since fpm doesn't use it.
2014-06-19 05:32:11 +00:00
Jordan Sissel b3d315b470 Merge branch 'master' of https://github.com/remh/fpm into remh-master
Conflicts:
	lib/fpm/package/rpm.rb
2014-06-18 06:52:42 +00:00
Jan Vansteenkiste 2bd2a1e179 Since #480, no default path is set so we should define one for testing python 2014-06-10 08:21:21 +02:00
Jan Vansteenkiste 43ea0a4bdb Fixes python tests where python 3.x is installed 2014-06-10 08:21:21 +02:00
Jan Vansteenkiste e1e35f8dfb Ignore lsb init scripts warning since we are not providing a proper init script for testing 2014-06-10 08:21:04 +02:00
Jan Vansteenkiste 97326059d6 Updated the example gem with as little changes as possible
checksums.yaml.gz has been stripped as in the current gem.

Changes:

```diff
diff --git a/spec/fixtures/gem/example/example-1.0.gem b/spec/fixtures/gem/example/example-1.0.gem
index 0241779..9238a4a 100644
--- a/spec/fixtures/gem/example/example-1.0.gem
+++ b/spec/fixtures/gem/example/example-1.0.gem
@@ -46,10 +46,12 @@ dependencies:
         version: '0'
 description: sample description
 email: sample email
-executables: []
+executables:
+- example
 extensions: []
 extra_rdoc_files: []
-files: []
+files:
+- bin/example
 homepage: http://sample-url/
 licenses: []
 post_install_message:
@@ -78,3 +80,5 @@ test_files: []
 has_rdoc:
 ============== checksums =============
 =============== files ================
+bin/example
+#!/usr/bin/env ruby

```

See http://vstone.eu/diffing-gems-in-git/
2014-06-10 08:19:49 +02:00
Jan Vansteenkiste 43464f7990 Added tests. Rebuild of example-1.0.0.gem required though 2014-06-10 08:19:49 +02:00
Remi Hakim ffef1e762a Fix specs 2014-05-06 18:35:21 -04:00
Tom Duckering c5a2ad35d4 Merge branch 'master' of https://github.com/jordansissel/fpm 2014-05-06 12:41:45 +01:00
Jan Vansteenkiste b3bf553abd Added tests for commands without package -p <dir> 2014-05-05 18:51:02 +02:00
Adam Lamar 9bdd40ddec Support RPM dist tag
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.
2014-05-01 18:33:49 +01:00
Dan Brown 6822e3bd50 Added support for dpkg triggers (fixes #595) 2014-05-01 14:43:54 +01:00
tduckeri a5cbda9db0 @tomduckering - adding a fix for the bug in the pessimistic constraint fixing for RPMs converted from Gems. 2014-05-01 14:30:46 +01:00
Dan Brown 3609a449a3 Added support for extra control files for debs (fixes #599) 2014-04-30 16:05:39 +01:00
Jordan Sissel dba0559d8a Support being given a directory for the output path (-p flag)
This should fix #656 and maybe a few other things.
2014-04-29 22:15:41 -07:00
Remi Hakim e7a9db50d4 Move logic in rpm specific places 2014-04-29 23:06:23 +02:00
Jordan Sissel 34897389b1 Don't require full output of a deb package if we're just checking for
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 ;)
2014-04-23 13:49:13 -07:00
Jordan Sissel ebd6289838 Make python_scripts_executable test more deterministic
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.
2014-04-22 21:52:48 -07:00
Jordan Sissel 208e0709c7 Skip if we don't have rpmbuild 2014-04-22 21:52:43 -07:00
Jordan Sissel 1cb9d75e48 Add test coverage for rpm --architecture flags
This covers a code from #676
2014-04-23 00:52:06 +00:00
Jordan Sissel 9f73d94a06 Merge pull request #679 from jordansissel/fix-rpm-permissions-and-user-settings
Allow forcing ownership even when using --rpm-use-file-permissions
2014-04-22 11:48:13 -07:00
Jordan Sissel c12991dc90 Allow forcing ownership even when using --rpm-use-file-permissions
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
2014-04-22 18:43:37 +00:00
Remi Hakim 2ba425f4bd Fix specs for new rpms scripts support 2014-04-14 15:32:38 +02:00
Remi Hakim 03323f5af9 Revert "Move rpm specific packages scripts to a more adequate location"
This reverts commit adf75fae02.
2014-04-14 15:14:01 +02:00
Remi Hakim 025b5b135a Move rpm specific packages scripts to a more adequate location 2014-04-07 18:22:15 -04:00
Remi Hakim ebb7ebd55e Fix missing spec 2014-03-18 11:07:20 -04:00
Remi Hakim f49a1309ca Fix specs 2014-03-18 11:06:15 -04:00
Remi Hakim abdbbf9a18 verify_script => verifyscript 2014-03-18 11:04:00 -04:00
Remi Hakim 1c49288d48 Add support for pretrans script 2014-03-18 11:00:50 -04:00
Remi Hakim 9c5815e96e Add postttrans support 2014-03-17 19:55:29 -04:00
Remi Hakim 2bb380d931 Fixes the specs 2014-03-14 17:02:44 -04:00
Remi Hakim e7d7755d00 First pass at adding support for rpm "verify" script 2014-03-14 16:44:07 -04:00
Sam Crang d3636f42b7 Fix `relative-conffile` error from lintian 2014-03-08 14:53:42 +00:00
Jordan Sissel e5076584de Add test coverage for #628 2014-03-07 07:13:06 +00:00
Jordan Sissel cc4167e4c4 Merge pull request #621 from btisdall/deb_use_file_perms_inc_tests
Deb use file perms inc tests
2014-03-06 22:36:39 -08:00
Jordan Sissel d42f302681 Build on #623 adding todos and some code style changes
Also added a test to cover hardlink support for FPM::Util.copy_entry
2014-03-07 06:01:25 +00:00
Jordan Sissel 49eae2a0fb Use program_exists? instead of program_in_path?
This additionally checks that the program exists and is executable if
the path given is either a path or a program name.
2014-02-09 22:25:38 -08:00
Jordan Sissel f81c4c554c typo 2014-02-05 06:53:05 +00:00
Jordan Sissel b74d269c37 Goodbye, Tempfile, I hated you always.
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.)
2014-02-05 06:53:05 +00:00
Jordan Sissel 2ebb4665f3 Add test coverage for #607 (safesystem w/ no $SHELL)
Also: Add missing SecureRandom.uuid under 1.8.x (for the tests)
2014-02-05 06:52:34 +00:00
bentis d8d820e774 Add an interface to the tar flags for the data archive so that they are testable. Add some tests. 2014-01-20 12:42:29 +01:00
Jordan Sissel c9390c8374 Merge pull request #556 from r4um/issue-554
Fixes #554 do not map existing paths with = in them
2013-12-05 23:03:27 -08:00
Jordan Sissel 74d00c655f Add test coverage for #585 2013-12-05 22:47:55 -08:00
Jordan Sissel 0d50267663 - fix whitespace 2013-12-05 22:40:59 -08:00
Jordan Sissel 9e108e5690 Add test coverage for #591
This also required fixing some bugs where FPM::Package::Deb mistakenly
made 'provides' a string (in the tests and in the 'input' method)
2013-12-05 22:23:43 -08:00
Jordan Sissel 9702eba6b7 Merge pull request #547 from cchandler/master
Bugfix: filenames w/ special characters and permissions
2013-10-29 14:37:58 -07:00
Pranay Kanwar 9a101386c9 Fixes #554 do not map existing paths with = in them 2013-09-19 15:55:57 +05:30
Chris Chandler 7de4b2a351 Bugfix: filenames w/ special characters and permissions
Filenames containing special characters like '%' won't stat correctly
because they've already been sanitized and the current working directory could
potentially be off.
2013-09-12 20:02:35 +00:00
Josh Kline a2228c9e07 FPM::Package#convert does not keep defaults attrs
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.
2013-09-03 20:51:09 -07:00
Matt Sharpe bc199f92b0 fix annoying rspec warnings 2013-08-14 19:12:22 +10:00
Jordan Sissel f3e46514ca - write tests to cover the rsync-style path mapping 2013-07-23 14:33:54 -07:00
Derek Ludwig 5e7c6a8a32 Set default flag attributes
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).
2013-07-18 16:58:17 -07:00
Jordan Sissel a5cb2286b6 - Add path mapping
Behavior
    * some/file=/some/path
      Result: /some/path
    * some/directory=/some/path
      Result: /some/path/directory/...
- drop dependency on Rush
2013-07-11 22:23:29 -07:00
Jordan Sissel 2ea44c4085 Merge pull request #461 from r4um/pr_452
python: handle == dependency requirement correctly
2013-06-05 00:22:34 -07:00
Pranay Kanwar e59509966a python: handle == dependency requirement correctly 2013-05-30 11:14:03 +05:30
Tray Torrance 59e7fb3f37 Add support for setting build-depends on debian targets 2013-05-23 12:31:07 -07:00
Jordan Sissel e129cb57f4 Merge pull request #419 from r4um/fix_411
Closes #411 Translate 'noarch' architecture to 'all' for debian
2013-05-06 23:56:39 -07:00
Jordan Sissel ae1d45e377 - improve cpan support (now with tests) 2013-05-06 23:51:12 -07:00
Jordan Sissel 54d30b15fc Fix failing spec caused by race conditions in Tempfile... which I should really stop using... 2013-04-30 16:36:15 -07:00
Pranay Kanwar ff79f40452 #411 Translate noarch architecture to all for debian 2013-04-22 11:19:39 +05:30
Jordan Sissel 60ba82de65 - Add test coverage for '%' in filenames
- Verify the rpm has the expected file paths when testing escapes and
  other stuff.
  (done during investigation of #416)
2013-04-18 10:45:19 -07:00
Jordan Sissel 79c2f8ef58 - fix_dependency on Conflicts and Breaks (#410)
- add test coverage for #410
2013-04-11 10:12:53 -07:00
Pranay Kanwar babb7ff72b rpm, epoch should not be set by default 2013-03-22 09:28:38 +00:00
Jordan Sissel 2ac77005c1 Merge pull request #323 from r4um/fix_exclude
Remove empty directories only if they match exclude pattern.
2013-03-21 15:30:11 -07:00