bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

Reworked generation of cookie names to include recipe.revision #157

Closed tomeon closed 8 years ago

tomeon commented 8 years ago

I hit an issue building a package with an updated revision -- because the extact cookie from a previous build with a different revision number was still hanging around, fpm-cookery didn't copy the updated source to builddir and the resulting package contained out-of-date code. This PR alters FPM::Cookery::Packager so that the build and extract cookies contain recipe.revision, if defined, in addition to recipe.name and recipe.version.


I also extended SourceHandler#handler_to_class to verify that the const_get lookup returns the name of a class that implements extract and fetch. My test build failed because I used source /a/path, :with => :dir rather than source /a/path, :with => :directory, and handler_to_class loaded the core Dir class.


One other thing -- I changed the packager to always run FileUtils.touch(build_cookie) -- it seems to me that Recipe#build shouldn't need to return true in order to indicate a successful build; anything that doesn't raise an exception should be fine.

tomeon commented 8 years ago

Hm, looks like the Travis build for Ruby 1.9 failed due to https://github.com/jordansissel/fpm/pull/1146 / https://github.com/jordansissel/fpm/issues/1147? Not entirely certain -- looking at the bundle install output in the Travis build console, I don't see any mention of fpm itself, just json.

bernd commented 8 years ago

Thank you!