Skip to content

Stop translating underscores in configure args#107

Open
runderwo wants to merge 2 commits intobernd:mainfrom
runderwo:master
Open

Stop translating underscores in configure args#107
runderwo wants to merge 2 commits intobernd:mainfrom
runderwo:master

Conversation

@runderwo
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Owner

bernd commented Jul 25, 2015

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
Copy link
Copy Markdown
Author

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

@bernd bernd changed the base branch from master to main July 13, 2022 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants