Re: support for environment variables in package.env

Petteri Räty <[email protected]>
Newsgroups gmane.linux.gentoo.java
Message-ID <[email protected]>
Vlastimil Babka kirjoitti:
> 
> Index: src/java_config/EnvironmentManager.py
> ===================================================================
> --- src/java_config/EnvironmentManager.py       (revision 4675)
> +++ src/java_config/EnvironmentManager.py       (working copy)
> @@ -308,6 +308,43 @@
> 
>          return path
> 
> +    def add_pkg_env(self, pkg, env):
> +        env_vars = pkg.query("ENV_VARS")
> +        if (env_vars):
> +            for var in env_vars.split(' '):
> +                val = pkg.query(var)
> +                assert val
> +                if (not env.has_key(var)):
> +                    env[var] = val

This probably could be named a bit better as I confuse pkg_env with the
package.env file.

if (not env.has_key(var)):

This is the same as not var in env
>>> dict = { "foo":"bar", "foo2":"bar2" }
>>> "foo" in dict
True
>>> "foo3" in dict
False


> +
> +    def build_dep_env(self, pkgs, missing_deps):
> +        env = {}
> +
> +        unresolved = Set()
> +        resolved = Set()
> +
> +        for p in pkgs[:]:

for p in pkgs:

Although the current functions are not documented, it would help if we
documented all new functions using pydoc:
http://www.python.org/dev/peps/pep-0287/

If it works, I am fine with you committing it. Should probably get a
couple of other fixes in there at the same time too for a new release.

Regards,
Petteri
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGTxBVcxLzpIGCsLQRAkYtAJ0Z7oDWTh1xXTcmcpStzpbQKteJPACeNDT+
RRlVGWY6VjIvVHVUqanOpz8=
=eIGV
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.