Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 578658

Summary: www-servers/nginx: should use REQUIRED_USE for http-modules rather than silently ignoring USE=http
Product: Gentoo Linux Reporter: Sam Jorna (wraeth) <wraeth>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: CONFIRMED ---    
Severity: normal CC: anthonyryan1, bugs, dev-zero, proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Sam Jorna (wraeth) gentoo-dev 2016-03-31 05:22:13 UTC
At present, nginx defines a 'http' flag in IUSE, however as noted in the ebuild:

> # - any http-module activates the main http-functionality and overrides USE=-http

This then goes on to set a 'http_enabled' variable during configure and uses that as the status of the http flag:

> # HTTP modules
> for mod in $NGINX_MODULES_STD; do
>     if use nginx_modules_http_${mod}; then
>         http_enabled=1
>     else
>         myconf+=( --without-http_${mod}_module )
>     fi
> done

And finally:

> if [ $http_enabled ]; then
>     use http-cache || myconf+=( --without-http-cache )
>     use ssl && myconf+=( --with-http_ssl_module )
> else
>     myconf+=( --without-http --without-http-cache )
> fi

This should instead be handled with a REQUIRED_USE rather than silently ignoring the USE flag. This could be done with something like:

> for mod in $NGINX_MODULES_STD; do
>     REQUIRED_USE="${REQUIRED_USE}
>         nginx_modules_http_${mod}? ( http )"
> done
> for mod in $NGINX_MODULES_OPT; do
>     REQUIRED_USE="${REQUIRED_USE}
>         nginx_modules_http_${mod}? ( http )"
> done
> for mod in $NGINX_MODULES_3RD; do
>     # all current 3rd-party mods are http-*
>     REQUIRED_USE="${REQUIRED_USE}
>         nginx_modules_${mod}? ( http )"
> done

The setting/checking of ${http_enabled} would also then need to be reworked.