Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351591 - sys-apps/portage-2.1.9.*: defaulted USE_EXPAND variables (APACHE2_MODULES) not handled properly in make.defaults in overlay profiles
Summary: sys-apps/portage-2.1.9.*: defaulted USE_EXPAND variables (APACHE2_MODULES) no...
Status: RESOLVED DUPLICATE of bug 530222
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Highest major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-13 19:23 UTC by Chris Frederick
Modified: 2015-03-04 22:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Frederick 2011-01-13 19:23:04 UTC
I recently updated several systems to 2.1.9.24 and 2.1.9.25.  I noticed that the APACHE2_MODULES was no longer being pulled from the local overlay profile's make.defaults.  To verify that this was really an issue I started a fresh build on and empty machine, and the same issue is happening.  These are the steps I used to reproduce on the fresh install:

#Using the following base:
install-x86-minimal-20110111.iso
stage3-i686-20110111.tar.bz2
portage-20110109.tar.bz2 (date of my last emerge sync)

#Follow gentoo handbook
#http://www.gentoo.org/doc/en/handbook/handbook-x86.xml
#stopping at 6.b (http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=6#doc_chap2)

#create local overlay (instructions from http://en.gentoo-wiki.com/wiki/Overlay#Creating_a_Local_Overlay_with_Portage)
mkdir -p /usr/local/portage/profiles/
echo "my_local_overlay" > /usr/local/portage/profiles/repo_name
echo 'PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage/"' >> /etc/make.conf

#copy 10.0 profile to empty overlay and fix parent paths
cp -a /usr/portage/profiles/default/linux/x86/10.0 /usr/local/portage/profiles/10.0_mod
echo /usr/portage/profiles/default/linux/x86 > /usr/local/portage/profiles/10.0_mod/parent
echo /usr/portage/profiles/releases/10.0 >> /usr/local/portage/profiles/10.0_mod/parent

#manually symlink make.profile
cd /etc/
rm make.profile
ln -s ../usr/local/portage/profiles/10.0_mod make.profile

#Verify overlay is working, get default APACHE2_MODULES, verify default DISTDIR, verify APACHE2_MPMS is not set, and test using apache ebuild
emerge --info | grep -o 'APACHE2_MODULES="[^"]*"'
emerge --info | grep -o 'APACHE2_MPMS="[^"]*"'
emerge --info | grep DISTDIR
emerge -pv apache

#Alter make.defaults, add APACHE2_MODULES removing all auth* modules, add DISTDIR and APACHE2_MPMS
emerge --info | grep --color=never -o 'APACHE2_MODULES="[^"]*"' | sed 's/ auth[^ ]*//g' > /usr/local/portage/profiles/10.0_mod/make.defaults
echo 'DISTDIR="/usr/local/distfiles"' >> /usr/local/portage/profiles/10.0_mod/make.defaults
echo 'APACHE2_MPMS="worker"' >> /usr/local/portage/profiles/10.0_mod/make.defaults

#Verify overlay is working, expecting altered APACHE2_* and DISTDIR, verify using apache ebuild
emerge --info | grep -o 'APACHE2_MODULES="[^"]*"'
emerge --info | grep -o 'APACHE2_MPMS="[^"]*"'
emerge --info | grep DISTDIR
emerge -pv apache

The last test shows that DISTDIR is set to /usr/local/distfiles, and APACHE2_MPMS is set to worker, but the APACHE2_MODULES is still using the defaults in /usr/portage/profiles/base/make.defaults.  I know this used to work in 2.1.6.13.
Comment 1 Zac Medico gentoo-dev 2011-01-13 19:35:34 UTC
The USE_EXPAND behavior changed between 2.1.9.24 and 2.1.9.25, in this commit:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=87da6752e50fd7658b53afb0fa2bd32b0d3ed64d

You can set USE="-apache2_modules_*" in make.defaults if you want to discard the corresponding flags from the parent profile.
Comment 2 Chris Frederick 2011-01-13 20:33:33 UTC
Is /etc/make.conf handled differently then?  If you add the same APACHE2_MODULES to /etc/make.conf it works as expected, completely overwriting the base/make.defaults value.  Is there a plan on migrating the changes to /etc/make.conf, or is the file considered special case?  I also noticed the same behavior in 2.1.8.3 as well.
Comment 3 Zac Medico gentoo-dev 2011-01-13 20:44:54 UTC
The code is a special case for make.defaults, and has no effect on make.conf handling. This was intended so that it would not conflict with the way that the majority of people do their USE_EXPAND settings in make.conf.
Comment 4 Chris Frederick 2011-01-13 22:22:36 UTC
Ok, thanks Zac, that explains things.  And using the USE flags works.
Comment 5 Dmitriy Bogun 2012-03-30 23:18:01 UTC
Now on portage-2.1.10.49 it not working in both variants. If I not add line "USE="$USE -apache2_modules_* -apache2_mpms_*"" into profile's make.default - then APACHE2_MODULES setting completely ignored. If I add line "USE="$USE -apache2_modules_* -apache2_mpms_*"", then all modules become disabled. 

So APACHE2_MODULES variable completely ignored in both cases. How can I override APACHE2_MODULES in my custom profile?
Comment 6 Zac Medico gentoo-dev 2012-03-30 23:21:47 UTC
(In reply to comment #5)
> "USE="$USE -apache2_modules_* -apache2_mpms_*"" into profile's make.default

Variables references like $USE are not supported in make.defaults. Use ${USE} instead.
Comment 7 Dmitriy Bogun 2012-03-30 23:25:49 UTC
Now works! Thanks! Sorry for not enough documentation "dig" from my side.
Comment 8 Dmitriy Bogun 2012-04-02 05:19:08 UTC
After all not working. :_:

I forgot to remove APACHE2_MODULES from /etc/make.conf, and if affect on results of my last test. :_:

So if USE variable contain "-apache2_modules_*" all apache modules will be disabled regardless of APACHE2_MODULE value.

But if I make one more profile:

(build-in profile)
  `- my dummy profile
    `- my profile

In "my dummy profile" put line "USE="-apache2_modules_* -apache2_mpms_*"" into make.defaults.

In "my profile" put required for me APACHE2_MODULES in make.defaults, then it will be applied to apache USE flags as expected.

----

I think that changes from USE variable applied after changes from APACHE2_MODULES and it overwrite all changes in APACHE2_MODULES if they present in one profile.
Comment 9 Zac Medico gentoo-dev 2012-04-02 05:30:30 UTC
(In reply to comment #8)
> In "my profile" put required for me APACHE2_MODULES in make.defaults, then
> it will be applied to apache USE flags as expected.

Yes, make.defaults has special support for setting of USE_EXPAND variables:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=637a13355cf4cc2906e34b61606d31d62acc9fcc
Comment 10 Dmitriy Bogun 2012-04-02 11:50:07 UTC
But it now work in incremental way, at least in portage-2.1.10.49. For example I set APACHE2_MODULES="-cgid" into my profile's make.defaults. 

And on emerge -pv apache, I got following:
--- << cut line << ---
# emerge -pv apache

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] www-servers/apache-2.2.21-r1  USE="ssl -debug -doc -ldap (-selinux) -static -suexec -threads" APACHE2_MODULES="-actions* -alias* -asis -auth_basic* -auth_digest -authn_alias* -authn_anon* -authn_dbd -authn_dbm* -authn_default* -authn_file* -authz_dbm* -authz_default* -authz_groupfile* -authz_host* -authz_owner* -authz_user* -autoindex* -cache* -cern_meta -cgi* -cgid* -charset_lite -dav* -dav_fs* -dav_lock* -dbd -deflate* -dir* -disk_cache* -dumpio -env* -expires* -ext_filter* -file_cache* -filter* -headers* -ident -imagemap -include* -info* -log_config* -log_forensic -logio* -mem_cache* -mime* -mime_magic* -negotiation* -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -proxy_scgi -reqtimeout -rewrite* -setenvif* -speling* -status* -substitute -unique_id* -userdir* -usertrack* -version -vhost_alias*" APACHE2_MPMS="peruser -event -itk -prefork -worker" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Invalid '-' operator in non-incremental variable 'APACHE2_MODULES': '-cgid'
--- << cut line << ---

And last line say that it should be used in incremental way.
Comment 11 Zac Medico gentoo-dev 2012-04-02 16:39:51 UTC
(In reply to comment #10)
> Invalid '-' operator in non-incremental variable 'APACHE2_MODULES': '-cgid'
> --- << cut line << ---
> 
> And last line say that it should be used in incremental way.

You can get the behavior that what you want like this:

   USE="${USE} -apache2_modules_cgid"
Comment 12 Dmitriy Bogun 2012-04-02 17:43:11 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > Invalid '-' operator in non-incremental variable 'APACHE2_MODULES': '-cgid'
> > --- << cut line << ---
> > 
> > And last line say that it should be used in incremental way.
> 
> You can get the behavior that what you want like this:
> 
>    USE="${USE} -apache2_modules_cgid"

I understand this.

But this not change situations with USE_EXPANDED variables, IMHO they support are completely broken in portage's profiles.
Comment 13 Zac Medico gentoo-dev 2012-04-02 17:50:33 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > Invalid '-' operator in non-incremental variable 'APACHE2_MODULES': '-cgid'
> > > --- << cut line << ---
> > > 
> > > And last line say that it should be used in incremental way.
> > 
> > You can get the behavior that what you want like this:
> > 
> >    USE="${USE} -apache2_modules_cgid"
> 
> I understand this.
> 
> But this not change situations with USE_EXPANDED variables, IMHO they
> support are completely broken in portage's profiles.

It works fine. Portage will automatically generate an appropriate APACHE2_MODULES value based on the corresponding USE flags.
Comment 14 Dmitriy Bogun 2012-04-02 18:26:50 UTC
In other world - you want say "this is not bug"... 

i.e. by design profiles must never define USE_EXTENDED variables? 
They must always use long variants of use flags?
Comment 15 Zac Medico gentoo-dev 2012-04-02 18:35:44 UTC
(In reply to comment #14)
> In other world - you want say "this is not bug"... 

Right.

> i.e. by design profiles must never define USE_EXTENDED variables?

Well, positive settings are supported, since there's a long history of setting positive defaults in profiles/base/make.defaults. I count approximately 12 such settings there now.

> They must always use long variants of use flags?

For negative settings, yes.
Comment 16 Dmitriy Bogun 2012-04-02 18:40:27 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > In other world - you want say "this is not bug"... 
> 
> Right.
> 
> > i.e. by design profiles must never define USE_EXTENDED variables?
> 
> Well, positive settings are supported, since there's a long history of
> setting positive defaults in profiles/base/make.defaults. I count
> approximately 12 such settings there now.
> 
> > They must always use long variants of use flags?
> 
> For negative settings, yes.

hmm... not intuitive at all. Where can I read about other underwater stones in creating portage's profiles?

PS man 5 portage, I have read already.
Comment 17 Zac Medico gentoo-dev 2012-04-02 19:06:03 UTC
The USE_EXPAND documentation could certainly be improved. Currently, it's only documented in the make.conf(5) man page, and there's no mention of it in portage(5).
Comment 18 Dmitriy Bogun 2012-04-02 19:10:08 UTC
(In reply to comment #17)
> The USE_EXPAND documentation could certainly be improved. Currently, it's
> only documented in the make.conf(5) man page, and there's no mention of it
> in portage(5).

I have read all portage related man pages, but there is too little info about cascading profiles. Where this info can be found?
Comment 19 Zac Medico gentoo-dev 2012-04-02 19:16:28 UTC
See Chapter 5 of app-doc/pms.
Comment 20 Zac Medico gentoo-dev 2015-03-04 22:26:35 UTC

*** This bug has been marked as a duplicate of bug 530222 ***