All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaromir Capik <jcapik@redhat.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] Avoiding warnings when piping to sensors-detect
Date: Fri, 26 Jul 2013 14:31:02 +0000	[thread overview]
Message-ID: <375932844.7422415.1374849062126.JavaMail.root@redhat.com> (raw)
In-Reply-To: <699701256.6909990.1374770991358.JavaMail.root@redhat.com>

> Hi Jaromir,

Hi Jean

> > Please, teplace the following line:
> > 
> > 	return <STDIN>;
> > 
> > with this:
> > 
> > 	return <STDIN> || '';
> > 
> > 
> > This would prevent the script from printing warnings about uninitialised
> > value. <STDIN> acts as uninitialised value when there are no more data
> > on the standard input. The modified expression returns empty string
> > instead.
> 
> Yes, I understand that. However I'm not sure we want to encourage
> people to use this.

> But I do agree that the warnings are ugly and should be avoided in all
> cases. My proposal would be to first detect when <STDIN> can't be read
> (eof(STDIN) should do) and bail out with an error message pointing the
> user to the new --auto parameter.
> 
> Would it be OK with you? Or do you prefer that we keep supporting the
> old way, even if it was never documented? If so, we could still print a
> warning but go on, and remove support for piping in a couple years,
> when everyone have updated their scripts.

I prefer to keep support for the old way -AND- write a message instructing
users to use the --auto switch instead. The message should be displayed
at the bottom of the listing. Such way is the least invasive one.
We'll not break the current solutions running with redirection while
encouraging users to use the new way. Preventing users from using /dev/null
as the input source would cause unwanted regressions in their current
solutions and we don't want to make them angry, right? :]

Please, let me know about your decision.

Thank you.

Regards,
Jaromir.

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2013-07-26 14:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 16:49 [lm-sensors] [PATCH] Avoiding warnings when piping to sensors-detect Jaromir Capik
2013-07-25 18:45 ` Jean Delvare
2013-07-26 10:01 ` Jaromir Capik
2013-07-26 12:58 ` Jean Delvare
2013-07-26 14:31 ` Jaromir Capik [this message]
2013-07-28 12:17 ` Jean Delvare
2013-07-30 17:50 ` Jaromir Capik
2013-09-11 11:47 ` Jean Delvare

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=375932844.7422415.1374849062126.JavaMail.root@redhat.com \
    --to=jcapik@redhat.com \
    --cc=lm-sensors@vger.kernel.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 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.