Debian Bug report logs -
#260272
util-linux: [hwclock] Please add option to suppress fractional second output of --show
Reported by: Colin Watson <cjwatson@debian.org>
Date: Mon, 19 Jul 2004 17:48:02 UTC
Severity: wishlist
Tags: patch
Found in version 2.12-5
Done: Moritz Muehlenhoff <jmm@inutil.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, LaMont Jones <lamont@debian.org>:
Bug#260272; Package util-linux.
(full text, mbox, link).
Acknowledgement sent to Colin Watson <cjwatson@debian.org>:
New Bug report received and forwarded. Copy sent to LaMont Jones <lamont@debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: util-linux
Version: 2.12-5
Severity: wishlist
It would be nice to have an option to suppress the drift information in
'hwclock --show', say --nodrift.
base-config wants to display the hardware clock information to the user
during Debian installations, and tries to remove the drift information
using 'cut'. However, this is very unreliable in the presence of
localization. An option to avoid displaying it in the first place would
be much better.
Thanks,
--
Colin Watson [cjwatson@flatline.org.uk]
Information forwarded to debian-bugs-dist@lists.debian.org, LaMont Jones <lamont@debian.org>:
Bug#260272; Package util-linux.
(full text, mbox, link).
Acknowledgement sent to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to LaMont Jones <lamont@debian.org>.
(full text, mbox, link).
Message #10 received at 260272@bugs.debian.org (full text, mbox, reply):
The patch at the following URL adds support for a --noshowdrift option.
However, the change to the --help output breaks translations, so you
might want to either (a) drop that chunk temporarily or (b) wait for
upstream to comment. (b) might be safer anyway for a new option, I
guess.
http://www.no-name-yet.com/patches/util-linux.260272.diff
Thanks,
--
Colin Watson [cjwatson@flatline.org.uk]
Tags added: patch
Request was from Colin Watson <cjwatson@debian.org>
to control@bugs.debian.org.
(full text, mbox, link).
Information forwarded to debian-bugs-dist@lists.debian.org, LaMont Jones <lamont@debian.org>:
Bug#260272; Package util-linux.
(full text, mbox, link).
Acknowledgement sent to Martin Michlmayr <tbm@cyrius.com>:
Extra info received and forwarded to list. Copy sent to LaMont Jones <lamont@debian.org>.
(full text, mbox, link).
Message #17 received at 260272@bugs.debian.org (full text, mbox, reply):
* Colin Watson <cjwatson@debian.org> [2004-07-19 19:19]:
> http://www.no-name-yet.com/patches/util-linux.260272.diff
diff -u util-linux-2.12/hwclock/hwclock.8 util-linux-2.12/hwclock/hwclock.8
--- util-linux-2.12/hwclock/hwclock.8
+++ util-linux-2.12/hwclock/hwclock.8
@@ -182,6 +182,12 @@
must be specified when using this option.
.TP
+.B \-\-noshowdrift
+suppresses the display of drift information when using the
+.B \-\-show
+option.
+
+.TP
.B \-\-directisa
is meaningful only on an ISA machine or an Alpha (which implements enough
of ISA to be, roughly speaking, an ISA machine for
only in patch2:
unchanged:
--- util-linux-2.12.orig/hwclock/hwclock.c
+++ util-linux-2.12/hwclock/hwclock.c
@@ -533,7 +533,7 @@
static void
display_time(const bool hclock_valid, const time_t systime,
- const double sync_duration) {
+ const double sync_duration, const bool showdrift) {
/*----------------------------------------------------------------------------
Put the time "systime" on standard output in display format.
Except if hclock_valid == false, just tell standard output that we don't
@@ -552,7 +552,10 @@
lt = localtime(&systime);
strftime(ctime_now, sizeof(ctime_now), format, lt);
- printf(_("%s %.6f seconds\n"), ctime_now, -(sync_duration));
+ if (showdrift)
+ printf(_("%s %.6f seconds\n"), ctime_now, -(sync_duration));
+ else
+ puts(ctime_now);
}
}
@@ -1023,7 +1026,7 @@
const bool hctosys, const bool systohc,
const struct timeval startup_time,
const bool utc, const bool local_opt,
- const bool testing) {
+ const bool testing, const bool showdrift) {
/*---------------------------------------------------------------------------
Do all the normal work of hwclock - read, set clock, etc.
@@ -1083,7 +1086,7 @@
if (show) {
display_time(hclock_valid, hclocktime,
- time_diff(read_time, startup_time));
+ time_diff(read_time, startup_time), showdrift);
} else if (set) {
set_hardware_clock_exact(set_time, startup_time,
universal, testing);
@@ -1217,6 +1220,7 @@
" hardware clock's epoch value\n"
" --noadjfile do not access /etc/adjtime. Requires the use of\n"
" either --utc or --localtime\n"
+ " --noshowdrift suppress drift information from --show\n"
),RTC_DEV);
#ifdef __alpha__
fprintf(usageto, _(
@@ -1265,6 +1269,7 @@
{ "test", 0, 0, 135 },
{ "date", 1, 0, 136 },
{ "epoch", 1, 0, 137 },
+ { "noshowdrift", 0, 0, 138 },
{ NULL, 0, 0, 0 }
};
@@ -1291,7 +1296,7 @@
/* Variables set by various options; show may also be set later */
/* The options debug, badyear and epoch_option are global */
bool show, set, systohc, hctosys, adjust, getepoch, setepoch;
- bool utc, testing, local_opt, noadjfile, directisa;
+ bool utc, testing, local_opt, noadjfile, directisa, showdrift;
bool ARCconsole, Jensen, SRM, funky_toy;
char *date_opt;
@@ -1311,6 +1316,7 @@
/* Set option defaults */
show = set = systohc = hctosys = adjust = noadjfile = FALSE;
getepoch = setepoch = utc = local_opt = testing = debug = FALSE;
+ showdrift = TRUE;
ARCconsole = Jensen = SRM = funky_toy = directisa = badyear = FALSE;
date_opt = NULL;
@@ -1379,6 +1385,9 @@
case 137:
epoch_option = atoi(optarg); /* --epoch */
break;
+ case 138:
+ showdrift = FALSE; /* --noshowdrift */
+ break;
case 'v': /* --version */
case 'V':
out_version();
@@ -1492,7 +1501,7 @@
return manipulate_clock(show, adjust, noadjfile, set, set_time,
hctosys, systohc, startup_time, utc,
- local_opt, testing);
+ local_opt, testing, showdrift);
}
/* A single routine for greater uniformity */
--
Martin Michlmayr
tbm@cyrius.com
Changed Bug title.
Request was from Thomas Hood <jdthood@aglu.demon.nl>
to control@bugs.debian.org.
(full text, mbox, link).
Message sent on to Colin Watson <cjwatson@debian.org>:
Bug#260272.
(full text, mbox, link).
Message #22 received at 260272-submitter@bugs.debian.org (full text, mbox, reply):
retitle 260272 util-linux: [hwclock] Please add option to suppress fractional second output of --show
thanks
On Wed, 2004-12-29 at 15:04 +0100, Andries Brouwer wrote:
> #260272 might be user error, but nevertheless reasonable.
> The submitter seems to think that what is printed is drift
> information. It is not. Therefore, the patch given should not be
> applied as is, the option name is wrong. But an option to suppress
> this fractional second part might still be a good idea.
--
Thomas Hood <jdthood@aglu.demon.nl>
Message sent on to Colin Watson <cjwatson@debian.org>:
Bug#260272.
(full text, mbox, link).
Message #25 received at 260272-submitter@bugs.debian.org (full text, mbox, reply):
On Wed, 2004-12-29 at 15:33 +0100, Andries Brouwer wrote:
> Probably a --dontsync option is better.
> One does not only want to suppress the printing,
> but also the waiting until the hw clock starts a new second.
> Saves half a second.
--
Thomas Hood <jdthood@aglu.demon.nl>
Reply sent to Moritz Muehlenhoff <jmm@inutil.org>:
You have taken responsibility.
(full text, mbox, link).
Notification sent to Colin Watson <cjwatson@debian.org>:
Bug acknowledged by developer.
(full text, mbox, link).
Message #30 received at 260272-done@bugs.debian.org (full text, mbox, reply):
Discussion with Colin Watson showed that this specific functionality
was only needed for base-config, which has been obsoleted by current
d-i development. As the requested functionaliy is very unlikely ever
to be needed outside the original d-i use case, I'm closing this bug.
Cheers,
Moritz
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Tue, 21 Aug 2007 07:30:54 GMT) (full text, mbox, link).
Bug unarchived.
Request was from Stefano Zacchiroli <zack@debian.org>
to control@bugs.debian.org.
(Sun, 10 Apr 2011 08:43:24 GMT) (full text, mbox, link).
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Mon, 09 May 2011 07:47:16 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Wed Oct 11 12:05:21 2017;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.