util-linux: [hwclock] want option to suppress drift information in --show

Bug #7097 reported by Debian Bug Importer
6
Affects Status Importance Assigned to Milestone
util-linux (Debian)
Fix Released
Unknown
util-linux (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Automatically imported from Debian bug report #260272 http://bugs.debian.org/260272

Revision history for this message
In , Colin Watson (cjwatson) wrote : patch to add hwclock --noshowdrift

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 [<email address hidden>]

Revision history for this message
In , Colin Watson (cjwatson) wrote : tagging 260272

tag 260272 patch

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Automatically imported from Debian bug report #260272 http://bugs.debian.org/260272

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Mon, 19 Jul 2004 18:34:49 +0100
From: Colin Watson <email address hidden>
To: <email address hidden>
Subject: util-linux: [hwclock] want option to suppress drift information in --show

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 [<email address hidden>]

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Mon, 19 Jul 2004 19:19:19 +0100
From: Colin Watson <email address hidden>
To: <email address hidden>
Cc: <email address hidden>
Subject: patch to add hwclock --noshowdrift

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 [<email address hidden>]

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Mon, 19 Jul 2004 19:20:09 +0100
From: Colin Watson <email address hidden>
To: <email address hidden>
Subject: tagging 260272

tag 260272 patch

Revision history for this message
Colin Watson (cjwatson) wrote :

This isn't RC for warty (#140 can be fixed another way), although it would be nice.

Revision history for this message
In , Martin Michlmayr (tbm) wrote : Re: patch to add hwclock --noshowdrift
Download full text (3.8 KiB)

* Colin Watson <email address hidden> [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;...

Read more...

Revision history for this message
Debian Bug Importer (debzilla) wrote :
Download full text (4.0 KiB)

Message-ID: <email address hidden>
Date: Sat, 24 Jul 2004 03:30:05 +0100
From: Martin Michlmayr <email address hidden>
To: <email address hidden>
Subject: Re: patch to add hwclock --noshowdrift

* Colin Watson <email address hidden> [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...

Read more...

Revision history for this message
In , Thomas Hood (jdthood-aglu) wrote : Re: Debian hwclock bug reports

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 <email address hidden>

Revision history for this message
In , Thomas Hood (jdthood-aglu) wrote :

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 <email address hidden>

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <1104449725.15291.111.camel@thanatos>
Date: Fri, 31 Dec 2004 00:35:24 +0100
From: Thomas Hood <email address hidden>
To: <email address hidden>
Cc: Martin Michlmayr <email address hidden>
Subject: Re: Debian hwclock bug reports

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 <email address hidden>

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <1104450501.15291.122.camel@thanatos>
Date: Fri, 31 Dec 2004 00:48:21 +0100
From: Thomas Hood <email address hidden>
To: <email address hidden>
Subject: Re: Debian hwclock bug reports

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 <email address hidden>

Revision history for this message
Lakin Wecker (lakin) wrote :

Setting status as confirmed -- the bug has been acknowledged and is being watched upstream.

Changed in util-linux:
status: Unconfirmed → Confirmed
Revision history for this message
In , Moritz Muehlenhoff (jmm-inutil) wrote : No longer needed

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

Changed in util-linux:
status: New → Fix Released
Revision history for this message
trollord (trollenlord) wrote :

Seems the Debian upstream was closed, because the issue has been obsoleted entirely. Shouldn't this one be WONTFIX and closed too or something like that? (Just browsing the oldest open bugs through for my amusement and wondering..)

trollord (trollenlord)
Changed in util-linux:
status: Confirmed → Fix Released
Revision history for this message
In , Debbugs Internal Request (owner-bugs) wrote : Internal Control

# A New Hope
# A log time ago, in a galaxy far, far away
# something happened.
#
# Magically this resulted in the following
# action being taken, but this fake control
# message doesn't tell you why it happened
#
# The action:
# Bug archived.
thanks
# This fakemail brought to you by your local debbugs
# administrator

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.