bernd / fpm-cookery

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

Stop translating underscores in configure args #107

Open runderwo opened 9 years ago

runderwo commented 9 years ago

This breaks nginx configuration. See the configure arguments here: https://github.com/nginx/nginx/blob/master/auto/options

Is there a good reason for this translation? Somehow the user didn't actually intend an underscore?

bernd commented 9 years ago

The translation was introduced as syntactic sugar so you can use :with_foo => 'bar'. I agree that it is confusing and breaks for some cases. But removing it might break lots of recipes.

You can use a regular string argument as a workaround though:

configure \
      '--with-http_stub_status_module',
      '--with-http_ssl_module',
      '--with-http_gzip_static_module',
      '--with-pcre',
      '--with-debug'

See my example nginx recipe: https://github.com/bernd/fpm-recipes/blob/master/nginx/recipe.rb#L24-L29

Hope that helps.

runderwo commented 9 years ago

If you're not going to fix it, then at least warn when you see an underscore in a configure argument and point to the recommended workaround.

My workaround was:

    configure = './configure'
    args.each do |k, v|
        if v == true
            configure += " --#{k}"
        else
            configure += " --#{k}=#{v}"
        end
    end
    safesystem configure