public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: Re: [gentoo-catalyst] [PATCH] lint: fix bad env dict handling
Date: Mon, 5 Oct 2015 23:27:03 -0700	[thread overview]
Message-ID: <20151005232703.613ac61e.dolsen@gentoo.org> (raw)
In-Reply-To: <1444103282-14476-1-git-send-email-vapier@gentoo.org>

On Mon,  5 Oct 2015 23:48:02 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> By using a kwarg default of {}, the value is retained across multiple
> calls (and the linter warns about it).  Use the standard "if None"
> style to avoid that.
> 
> Also fix the write to the dict passed in by creating a local copy
> before we insert BASH_ENV into it.
> ---
>  catalyst/support.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/catalyst/support.py b/catalyst/support.py
> index b6705c9..78942a7 100644
> --- a/catalyst/support.py
> +++ b/catalyst/support.py
> @@ -120,11 +120,14 @@ def find_binary(myc):
>  	return None
>  
>  
> -def cmd(mycmd, myexc="", env={}, debug=False, fail_func=None):
> +def cmd(mycmd, myexc="", env=None, debug=False, fail_func=None):
> +	if env is None:
> +		env = {}
>  	#print "***** cmd()"
>  	sys.stdout.flush()
>  	args=[BASH_BINARY]
>  	if "BASH_ENV" not in env:
> +		env = env.copy()
>  		env["BASH_ENV"] =
> "/etc/spork/is/not/valid/profile.env" if debug:
>  		args.append("-x")


How the hell did I miss that one, I've worked on this function a few
times.

Please merge :)
-- 
Brian Dolbec <dolsen>



      reply	other threads:[~2015-10-06  6:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06  3:48 [gentoo-catalyst] [PATCH] lint: fix bad env dict handling Mike Frysinger
2015-10-06  6:27 ` Brian Dolbec [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151005232703.613ac61e.dolsen@gentoo.org \
    --to=dolsen@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox