All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Sam Bobroff <sam.bobroff@au1.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH v2 1/1] merge_config.sh: exit on missing input files
Date: Thu, 20 Aug 2015 14:06:31 +0200	[thread overview]
Message-ID: <55D5C2C7.7060002@suse.cz> (raw)
In-Reply-To: <400239d8e6d962b6bb752136ac9eef704f1eb31f.1437369135.git.sam.bobroff@au1.ibm.com>

On 2015-07-20 07:12, Sam Bobroff wrote:
> Add a check for the existence of input files and exit (with failure)
> if they are missing.
> 
> Without this additional check, missing files produce error messages
> but still result in an output file being generated and a successful
> exit code.
> 
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>

Thanks, applied to kbuild.git#kconfig.


> Additionally, it seems like it might be a good idea (either with or
> without this patch) to add "set -e" to the script because this patch
> only handles missing files, not other errors (which will currently be
> ignored and return a successful exit code). Should I add this to the
> patch?

I'd prefer proper error handling over set -e. set -e usually bites you
when you expect it the least, e.g. inside the loop at the end of the script:

	REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
	ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config)

The second grep call can return 1, but in this case we want to report
the difference.

Michal

      reply	other threads:[~2015-08-20 12:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20  5:12 [PATCH v2 1/1] merge_config.sh: exit on missing input files Sam Bobroff
2015-08-20 12:06 ` Michal Marek [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=55D5C2C7.7060002@suse.cz \
    --to=mmarek@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam.bobroff@au1.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.