> -----Original Message----- > From: yocto-boun...@yoctoproject.org [mailto:yocto- > boun...@yoctoproject.org] On Behalf Of Patrick Doyle > Sent: den 16 augusti 2016 17:13 > To: yocto@yoctoproject.org > Subject: Re: [yocto] How to maintain a global DL_DIR? > > Oh this is ugly... > I tried setting BB_ENV_EXTRAWHITE to DL_DIR in my .bashrc, but found > that BB_ENV_EXTRAWHITE gets overwritten by oe-buildenv-internal as I > mentioned previously.
You seem to be using an old version of Poky. The code in oe-buildenv-internal was changed in Krogoth to add the variables that OE requires to BB_ENV_EXTRAWHITE. So if you are using Krogoth or later it should be possible to do export BB_ENV_EXTRAWHITE="DL_DIR" in your .bashrc and get it to work as expected... If you do not have the option of using Krogoth or newer, you could use this trick in your .bashrc: alias bitbake="BB_ENV_EXTRAWHITE=\"$BB_ENV_EXTRAWHITE DL_DIR\" bitbake" It may not be kosher, but it works. ;) > I tried setting BB_ENV_WHITELIST to DL_DIR in my .bashrc and found > that bitbake just stopped working. > > After rereading the manual > (https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake- > user-manual.html#var-BB_ENV_WHITELIST) > I tried setting BB_ENV_WHITELIST to "BBPATH BB_RESERVE_ENV > BB_ENV_WHITELIST BB_ENV_EXTRAWHITE DL_DIR", and bitbake still didn't > work. > > So I looked in poky/bitbake/lib/bb/utils.py and found the following: > > def preserved_envvars_exported(): > """Variables which are taken from the environment and placed in and > exported > from the metadata""" > return [ > 'BB_TASKHASH', > 'HOME', > 'LOGNAME', > 'PATH', > 'PWD', > 'SHELL', > 'TERM', > 'USER', > ] > > def preserved_envvars(): > """Variables which are taken from the environment and placed in > the metadata""" > v = [ > 'BBPATH', > 'BB_PRESERVE_ENV', > 'BB_ENV_WHITELIST', > 'BB_ENV_EXTRAWHITE', > ] > return v + preserved_envvars_exported() > > ... > if 'BB_ENV_WHITELIST' in os.environ: > approved = os.environ['BB_ENV_WHITELIST'].split() > approved.extend(['BB_ENV_WHITELIST']) > else: > approved = preserved_envvars() > > This looks like, if BB_ENV_WHITELIST is defined in the environment, > bitbake will use it (arbitrarily appending BB_ENV_WHITELIST to the end > of whatever was defined in the environment variable). If it is not > defined, then BB_ENV_WHITELIST is initialized to be: > > ['BBPATH', 'BB_PRESERVE_ENV', 'BB_ENV_WHITELIST', 'BB_ENV_EXTRAWHITE', > 'BB_TASKHASH', 'HOME', ...] > > So I finally tried setting BB_ENV_WHITELIST in .bashrc to be "BBPATH > BB_PRESERVE_ENV BB_ENV_EXTRAWHITE BB_TASKHASH HOME LOGNAME PATH PWD > SHELL TERM USER DL_DIR" > > But it is very sadly ugly... not terribly maintainable... and makes me > think I'm missing something important. > > Please tell me I'm missing something important. > > --wpd //Peter -- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto