bernd / fpm-cookery

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

calling configure with no args fails #92

Closed Xylakant closed 10 years ago

Xylakant commented 10 years ago

calling configure with no arguments from a recipe fails with

/usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/utils.rb:7:in `system': can't convert nil into String (TypeError)
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/utils.rb:7:in `safesystem'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/utils.rb:41:in `configure'
    from /home/vagrant/build-recipes/recipes/tarsnap/recipe.rb:32:in `build'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:114:in `dispense'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:104:in `chdir'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:104:in `dispense'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:101:in `chdir'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/packager.rb:101:in `dispense'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/cli.rb:113:in `exec'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/cli.rb:77:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/book.rb:16:in `call'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/book.rb:16:in `load_recipe'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/lib/fpm/cookery/cli.rb:73:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
    from /usr/lib/ruby/gems/1.8/gems/fpm-cookery-0.24.0/bin/fpm-cook:7
    from /home/vagrant/bin/fpm-cook:19:in `load'
    from /home/vagrant/bin/fpm-cook:19

The issue is in argument_build (https://github.com/bernd/fpm-cookery/blob/master/lib/fpm/cookery/utils.rb#L24) which returns nil if the last argument is not a hash.

Xylakant commented 10 years ago

workaround: call safesystem :configure

bernd commented 10 years ago

Thank you for the report!