From debbugs-submit-bounces@debbugs.gnu.org Fri May 05 02:05:00 2017 Received: (at submit) by debbugs.gnu.org; 5 May 2017 06:05:00 +0000 Received: from localhost ([127.0.0.1]:55205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6WMN-0003Zb-MG for submit@debbugs.gnu.org; Fri, 05 May 2017 02:05:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6WKt-0003Wz-AP for submit@debbugs.gnu.org; Fri, 05 May 2017 02:03:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6WKm-0001xM-Rk for submit@debbugs.gnu.org; Fri, 05 May 2017 02:03:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58651) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6WKm-0001xE-OV for submit@debbugs.gnu.org; Fri, 05 May 2017 02:03:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6WKl-0000bg-4g for bug-coreutils@gnu.org; Fri, 05 May 2017 02:03:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6WKj-0001v7-QU for bug-coreutils@gnu.org; Fri, 05 May 2017 02:03:19 -0400 Received: from mail-ua0-x229.google.com ([2607:f8b0:400c:c08::229]:33851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d6WKj-0001rj-KJ; Fri, 05 May 2017 02:03:17 -0400 Received: by mail-ua0-x229.google.com with SMTP id g49so22781954uaa.1; Thu, 04 May 2017 23:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=o0e7BnCyMKUcaA3xHkPUiO0UHDpAJgaqSvqPruxAbZA=; b=L6rkxmIiyQeogWREOWwrIsvFiSD2Kiuq5c2toRIIjcq8ZCET+VVnBBnwSLlvWx1Ymk 6sLa/YoBV42xrdpnzVM1sovyLz1S92KrWoqMbmZ2MeJsiqh91RqolonPRSNbUvIXbljr lmYDDCqpHhUGwn5a+9C7dju4nTxZJJpFRP8crpTiJcjQXKoGGbQo+0d8OsiFeRQRSueL 2BVuTP/0u2f7m0kxF2Ij8r5Ch8cywYRGuCXBOMR/3Tr2224mJZcCkqAKSOldcz7CDHHy q0wrshPxfio1jQ7FCAmskZxUYjtcSbdS1FsmYvAZLc1iiK/zmy34/GpxB85ic3hrSHQt 5kyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=o0e7BnCyMKUcaA3xHkPUiO0UHDpAJgaqSvqPruxAbZA=; b=i4saMZ3vqpZtpiWLLSwzhKI2j0Cp7NG1SR+XxyMxsOPIgABcc16g8xAdJYi03YZfTw 1lCGAjSSaoWMRDiPFBu2d7Vg1ydJWfwKeZViPMW34YTnLvrDd/BReO6vnDm8o+pjmhTA hfDL4r7xL0RT5cHtuMnaNC+9JYMESb9pYZ7JM223aeNEdsQ+Han2QBG5s0ODy3pFccXZ UctoDampLPEE0ipaEOEZLPvHPbQa5OFfBWgvrevKJ3ewe7zk8xWwIspMxdlgu54+Iv1a ZP3vcgPRJ8lGsciuhwsR3JXFM2QjF8XHshZi2q3leqnKhcezI41qLh0QdPSjhd5liaJH ghqw== X-Gm-Message-State: AN3rC/5lLq30O/DcDkzJ09sZ6Jp06BDyazTiWpKdgbuTIp2U/2kuCMQk F3Sip6RnHVDYcckzEY8o2Yv+EDp5Yw== X-Received: by 10.176.8.68 with SMTP id b4mr24089470uaf.58.1493964195114; Thu, 04 May 2017 23:03:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.71.70 with HTTP; Thu, 4 May 2017 23:03:14 -0700 (PDT) From: Prateek saxena Date: Fri, 5 May 2017 11:33:14 +0530 Message-ID: Subject: Discrepancy with uptime added as part of "[PATCH] Document uptime." To: bug-coreutils@gnu.org Content-Type: multipart/mixed; boundary=f403045f8cc6287842054ec0a500 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 05 May 2017 02:04:58 -0400 Cc: jay@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) --f403045f8cc6287842054ec0a500 Content-Type: multipart/alternative; boundary=f403045f8cc628783f054ec0a5fe --f403045f8cc628783f054ec0a5fe Content-Type: text/plain; charset=UTF-8 Hi, We found some discrepancy with uptime utility of coreutils package. In my system using coreutils package with version 8.26, uptime output prints PM/AM for 24 hour time format. Logs: ------------------------------------------------------------------------------------ # uptime 17:19pm up 6 days 10:02, 1 user, load average: 0.18, 0.14, 0.10 # uptime --version uptime (GNU coreutils) 8.26 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi ------------------------------------------------------------------------------------ The time is in 24 hours format and PM is not expected to be printed. We can see latest patch for uptime utility, use of fprintftime to print the time (http://lists.gnu.org/archive/html/bug-coreutils/2008-08/msg00035.html). ------------------------------------------------------------------------------------ diff --git a/src/uptime.c b/src/uptime.c index 9e3384f..5bdc230 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -36,6 +36,7 @@ #include "long-options.h" #include "quote.h" #include "readutmp.h" +#include "fprintftime.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "uptime" @@ -126,12 +127,10 @@ print_uptime (size_t n, const STRUCT_UTMP *this) uphours = (uptime - (updays * 86400)) / 3600; upmins = (uptime - (updays * 86400) - (uphours * 3600)) / 60; tmn = localtime (&time_now); + /* procps' version of uptime also prints the seconds field, but + previous versions of coreutils don't. */ if (tmn) - printf (_(" %2d:%02d%s up "), - ((tmn->tm_hour % 12) == 0 ? 12 : tmn->tm_hour % 12), - /* FIXME: use strftime, not am, pm. Uli reports that - the german translation is meaningless. */ - tmn->tm_min, (tmn->tm_hour < 12 ? _("am") : _("pm"))); + fprintftime (stdout, _(" %H:%M%P up "), tmn, 0, 0); else printf (_(" ??:???? up ")); if (uptime == (time_t) -1) ----------------------------------------------------------------------------------- Can you please verify whether PM/AM should be avoided from uptime print. Please find attach patch to remove AM/PM from the print for your reference. Please provide your inputs for same. Thanks & Regards, Prateek --f403045f8cc628783f054ec0a5fe Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

We found some discrepancy with uptime util= ity of coreutils package.

In my system using coreutils package with = version 8.26, uptime output prints
PM/AM for 24 hour time format.
Logs:
-----------------------------------------------------------------= -------------------
# uptime
=C2=A017:19pm=C2=A0 up 6 days 10:02,=C2= =A0 1 user,=C2=A0 load average: 0.18, 0.14, 0.10

# uptime --version=
uptime (GNU coreutils) 8.26
Copyright (C) 2016 Free Software Foundat= ion, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.=
This is free software: you are free to change and redistribute it.
T= here is NO WARRANTY, to the extent permitted by law.
Written by Joseph A= rceneaux, David MacKenzie, and Kaveh Ghazi
-----------------------------= -------------------------------------------------------

The time is = in 24 hours format and PM is not expected to be printed.
We can see late= st patch for uptime utility, use of fprintftime to print the time
=C2=A0= (http://lists.gnu.org/archive/html/bug-coreutils/2008-08/msg00035.ht= ml).

-----------------------------------------------------------= -------------------------
diff --git a/src/uptime.c b/src/uptime.c
in= dex 9e3384f..5bdc230 100644
--- a/src/uptime.c
+++ b/src/uptime.c
= @@ -36,6 +36,7 @@
=C2=A0#include "long-options.h"
=C2=A0#in= clude "quote.h"
=C2=A0#include "readutmp.h"
+#inc= lude "fprintftime.h"
=C2=A0
=C2=A0/* The official name of t= his program (e.g., no `g' prefix).=C2=A0 */
=C2=A0#define PROGRAM_NA= ME "uptime"
@@ -126,12 +127,10 @@ print_uptime (size_t n, cons= t STRUCT_UTMP *this)
=C2=A0=C2=A0 uphours =3D (uptime - (updays * 86400)= ) / 3600;
=C2=A0=C2=A0 upmins =3D (uptime - (updays * 86400) - (uphours = * 3600)) / 60;
=C2=A0=C2=A0 tmn =3D localtime (&time_now);
+=C2= =A0 /* procps' version of uptime also prints the seconds field, but
= +=C2=A0=C2=A0=C2=A0=C2=A0 previous versions of coreutils don't. */
= =C2=A0=C2=A0 if (tmn)
-=C2=A0=C2=A0=C2=A0 printf (_(" %2d:%02d%s=C2= =A0 up "),
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ((tmn->tm_hour % 12) =3D=3D 0 ? 12 : tmn->tm_hour % 12),
-= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* FIXME: use = strftime, not am, pm.=C2=A0 Uli reports that
-=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 the german translati= on is meaningless.=C2=A0 */
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 tmn->tm_min, (tmn->tm_hour < 12 ? _("am&qu= ot;) : _("pm")));
+=C2=A0=C2=A0=C2=A0 fprintftime (stdout, _(&= quot; %H:%M%P=C2=A0 up "), tmn, 0, 0);
=C2=A0=C2=A0 else
=C2=A0= =C2=A0=C2=A0=C2=A0 printf (_(" ??:????=C2=A0 up "));
=C2=A0=C2= =A0 if (uptime =3D=3D (time_t) -1)
-------------------------------------= ----------------------------------------------

Can you please verify= whether PM/AM should be avoided from uptime print.

Pleas= e find attach patch to remove AM/PM from the print for your reference.
<= br>
Please provide your inputs for same.

Thanks= & Regards,
Prateek
--f403045f8cc628783f054ec0a5fe-- --f403045f8cc6287842054ec0a500 Content-Type: application/octet-stream; name="0001-uptime_am_pm_print_remove.patch" Content-Disposition: attachment; filename="0001-uptime_am_pm_print_remove.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j2bfbu1q0 ZGlmZiAtLWdpdCBhL3NyYy91cHRpbWUuYyBiL3NyYy91cHRpbWUuYwppbmRleCBlYTAzMTlmLi40 YjFjNWNlIDEwMDY0NAotLS0gYS9zcmMvdXB0aW1lLmMKKysrIGIvc3JjL3VwdGltZS5jCkBAIC0x MzQsNyArMTM0LDggQEAgcHJpbnRfdXB0aW1lIChzaXplX3QgbiwgY29uc3QgU1RSVUNUX1VUTVAg KnRoaXMpCiAgICAgIHByZXZpb3VzIHZlcnNpb25zIG9mIGNvcmV1dGlscyBkb24ndC4gKi8KICAg aWYgKHRtbikKICAgICAvKiBUUkFOU0xBVE9SUzogVGhpcyBwcmludHMgdGhlIGN1cnJlbnQgY2xv Y2sgdGltZS4gKi8KLSAgICBmcHJpbnRmdGltZSAoc3Rkb3V0LCBfKCIgJUg6JU0lUCAgIiksIHRt biwgMCwgMCk7CisgICAgZnByaW50ZnRpbWUgKHN0ZG91dCwgXygiICVIOiVNICAiKSwgdG1uLCAw LCAwKTsKKyAgICAvL2ZwcmludGZ0aW1lIChzdGRvdXQsIF8oIiAlSDolTSVQICAiKSwgdG1uLCAw LCAwKTsKICAgZWxzZQogICAgIHByaW50ZiAoXygiID8/Oj8/Pz8gICIpKTsKICAgaWYgKHVwdGlt ZSA9PSAodGltZV90KSAtMSkK --f403045f8cc6287842054ec0a500-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 05 16:19:06 2017 Received: (at 26783) by debbugs.gnu.org; 5 May 2017 20:19:06 +0000 Received: from localhost ([127.0.0.1]:56811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6jgw-00088g-GB for submit@debbugs.gnu.org; Fri, 05 May 2017 16:19:06 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:39264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6jgt-000888-40 for 26783@debbugs.gnu.org; Fri, 05 May 2017 16:19:05 -0400 Received: from localhost.localdomain (unknown [166.177.249.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id E3B7498D5; Fri, 5 May 2017 21:19:00 +0100 (IST) Subject: Re: bug#26783: Discrepancy with uptime added as part of "[PATCH] Document uptime." To: Prateek saxena , 26783@debbugs.gnu.org References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: Date: Fri, 5 May 2017 13:18:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 26783 Cc: jay@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 04/05/17 23:03, Prateek saxena wrote: > Hi, > > We found some discrepancy with uptime utility of coreutils package. > > In my system using coreutils package with version 8.26, uptime output prints > PM/AM for 24 hour time format. > > Logs: > ------------------------------------------------------------------------------------ > # uptime > 17:19pm up 6 days 10:02, 1 user, load average: 0.18, 0.14, 0.10 > > # uptime --version > uptime (GNU coreutils) 8.26 > Copyright (C) 2016 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later > . > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > Written by Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi > ------------------------------------------------------------------------------------ > > The time is in 24 hours format and PM is not expected to be printed. > We can see latest patch for uptime utility, use of fprintftime to print the > time > (http://lists.gnu.org/archive/html/bug-coreutils/2008-08/msg00035.html). > > ------------------------------------------------------------------------------------ > diff --git a/src/uptime.c b/src/uptime.c > index 9e3384f..5bdc230 100644 > --- a/src/uptime.c > +++ b/src/uptime.c > @@ -36,6 +36,7 @@ > #include "long-options.h" > #include "quote.h" > #include "readutmp.h" > +#include "fprintftime.h" > > /* The official name of this program (e.g., no `g' prefix). */ > #define PROGRAM_NAME "uptime" > @@ -126,12 +127,10 @@ print_uptime (size_t n, const STRUCT_UTMP *this) > uphours = (uptime - (updays * 86400)) / 3600; > upmins = (uptime - (updays * 86400) - (uphours * 3600)) / 60; > tmn = localtime (&time_now); > + /* procps' version of uptime also prints the seconds field, but > + previous versions of coreutils don't. */ > if (tmn) > - printf (_(" %2d:%02d%s up "), > - ((tmn->tm_hour % 12) == 0 ? 12 : tmn->tm_hour % 12), > - /* FIXME: use strftime, not am, pm. Uli reports that > - the german translation is meaningless. */ > - tmn->tm_min, (tmn->tm_hour < 12 ? _("am") : _("pm"))); > + fprintftime (stdout, _(" %H:%M%P up "), tmn, 0, 0); > else > printf (_(" ??:???? up ")); > if (uptime == (time_t) -1) > ----------------------------------------------------------------------------------- > > Can you please verify whether PM/AM should be avoided from uptime print. > > Please find attach patch to remove AM/PM from the print for your reference. > > Please provide your inputs for same. > > Thanks & Regards, > Prateek > Nice catch. I'm happy to simplify and switch to 24 hour (which also matches procps-ng normally used on Linux) thanks Pádraig From debbugs-submit-bounces@debbugs.gnu.org Thu May 11 01:40:56 2017 Received: (at 26783) by debbugs.gnu.org; 11 May 2017 05:40:56 +0000 Received: from localhost ([127.0.0.1]:37490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8gqN-0001E4-RS for submit@debbugs.gnu.org; Thu, 11 May 2017 01:40:56 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:33120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8gqM-0001Dr-PZ for 26783@debbugs.gnu.org; Thu, 11 May 2017 01:40:55 -0400 Received: by mail-ua0-f195.google.com with SMTP id x55so2294723uax.0 for <26783@debbugs.gnu.org>; Wed, 10 May 2017 22:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=069O1LtyyqBYHpWucY4ZAsXaKG8jDJLRHXLeCcnJT6w=; b=jGHT1uMiV6HlDlBt6P4xIO1c4TdKKVfSPBfjdQEZL1OziU3uvtd4DCjqlRzng685Rz u6FVVLHovRJdSRABnudmAh0/+VnnZ6UluN9dbgsl02xDg7fqmGbJ+/UcnXz4ZMTdoKGJ tndv0zXUWsqkNn2xt5JfqYdiwWyIn6TVnavViIHPlKch/Wult0ZbNBkKBvyZt8oxI7qT bONyN6wM4LLvtGmuzXmqgHE5jqgVx70Vq4NRcjwdAwxf0ymnmALQVZaFZ+ZLkXwtzLI8 hl/mG3QJaQm3TTzvKpf0T+HLAm0DMdu+pGEZphEDnHvH7IUdt2kJCL6nODrglNbJDEfu tN/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=069O1LtyyqBYHpWucY4ZAsXaKG8jDJLRHXLeCcnJT6w=; b=ll0wsBF6U2nBjVQlUOi6nQLegGqyMkx59hVP1sxBCWZ+BSXMPN1w6azZakHg6o+JqM tpfPZmKo6YveRWThM1xdqJC9gtRh7Ea6eWZXAiJs5R3SNztr5/5sdt+F/RSmQXtvPm/i Df4E8AvN6bFUCRblGwMXi1+5oIdF8jIjwT9SElF6YVRFmz9Wk9wcZNpmaTNQAgiSzluM i85QPjahEEzxtLCTORu8gqqDldjolPI+TftMMbwmn9DxgEgRSBHh/cZZV6J6ZKmK2LLh t4iJVLZTpKAXEiMxpyWl5B2I+JK8K9ndFSG1zoq2J0SfVpUbXX0742TNOpBQ6FVHDoc0 Ja9A== X-Gm-Message-State: AODbwcBUSFQKSoNziMWYHXsUNPgs8ai7GITlTpNH3Pj7NzRNtr/k9afp V8/hLv6wbKOFzydPQHpmSVk6AUkgdw== X-Received: by 10.31.215.194 with SMTP id o185mr4721093vkg.100.1494481249150; Wed, 10 May 2017 22:40:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.71.93 with HTTP; Wed, 10 May 2017 22:40:48 -0700 (PDT) In-Reply-To: References: From: Prateek saxena Date: Thu, 11 May 2017 11:10:48 +0530 Message-ID: Subject: Re: bug#26783: Discrepancy with uptime added as part of "[PATCH] Document uptime." To: =?UTF-8?Q?P=C3=A1draig_Brady?= Content-Type: multipart/mixed; boundary=001a114ee3bafb7c3c054f390776 X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 26783 Cc: jay@gnu.org, 26783@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --001a114ee3bafb7c3c054f390776 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi P=C3=A1draig, Thanks for replying. When we can expect the fix. Can we use the attached patch as workaround for time been. whether it would be sufficient. Thanks & Regards, Prateek On Sat, May 6, 2017 at 1:48 AM, P=C3=A1draig Brady wrote= : > On 04/05/17 23:03, Prateek saxena wrote: >> Hi, >> >> We found some discrepancy with uptime utility of coreutils package. >> >> In my system using coreutils package with version 8.26, uptime output pr= ints >> PM/AM for 24 hour time format. >> >> Logs: >> ------------------------------------------------------------------------= ------------ >> # uptime >> 17:19pm up 6 days 10:02, 1 user, load average: 0.18, 0.14, 0.10 >> >> # uptime --version >> uptime (GNU coreutils) 8.26 >> Copyright (C) 2016 Free Software Foundation, Inc. >> >> License GPLv3+: GNU GPL version 3 or later >> . >> This is free software: you are free to change and redistribute it. >> There is NO WARRANTY, to the extent permitted by law. >> Written by Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi >> ------------------------------------------------------------------------= ------------ >> >> The time is in 24 hours format and PM is not expected to be printed. >> We can see latest patch for uptime utility, use of fprintftime to print = the >> time >> (http://lists.gnu.org/archive/html/bug-coreutils/2008-08/msg00035.html)= . >> >> ------------------------------------------------------------------------= ------------ >> diff --git a/src/uptime.c b/src/uptime.c >> index 9e3384f..5bdc230 100644 >> --- a/src/uptime.c >> +++ b/src/uptime.c >> @@ -36,6 +36,7 @@ >> #include "long-options.h" >> #include "quote.h" >> #include "readutmp.h" >> +#include "fprintftime.h" >> >> /* The official name of this program (e.g., no `g' prefix). */ >> #define PROGRAM_NAME "uptime" >> @@ -126,12 +127,10 @@ print_uptime (size_t n, const STRUCT_UTMP *this) >> uphours =3D (uptime - (updays * 86400)) / 3600; >> upmins =3D (uptime - (updays * 86400) - (uphours * 3600)) / 60; >> tmn =3D localtime (&time_now); >> + /* procps' version of uptime also prints the seconds field, but >> + previous versions of coreutils don't. */ >> if (tmn) >> - printf (_(" %2d:%02d%s up "), >> - ((tmn->tm_hour % 12) =3D=3D 0 ? 12 : tmn->tm_hour % 12), >> - /* FIXME: use strftime, not am, pm. Uli reports that >> - the german translation is meaningless. */ >> - tmn->tm_min, (tmn->tm_hour < 12 ? _("am") : _("pm"))); >> + fprintftime (stdout, _(" %H:%M%P up "), tmn, 0, 0); >> else >> printf (_(" ??:???? up ")); >> if (uptime =3D=3D (time_t) -1) >> ------------------------------------------------------------------------= ----------- >> >> Can you please verify whether PM/AM should be avoided from uptime print. >> >> Please find attach patch to remove AM/PM from the print for your referen= ce. >> >> Please provide your inputs for same. >> >> Thanks & Regards, >> Prateek >> > > > Nice catch. > I'm happy to simplify and switch to 24 hour > (which also matches procps-ng normally used on Linux) > > thanks > P=C3=A1draig --001a114ee3bafb7c3c054f390776 Content-Type: application/octet-stream; name="0001-uptime_am_pm_print_remove.patch" Content-Disposition: attachment; filename="0001-uptime_am_pm_print_remove.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j2jzfjox0 ZGlmZiAtLWdpdCBhL3NyYy91cHRpbWUuYyBiL3NyYy91cHRpbWUuYwppbmRleCBlYTAzMTlmLi4w NzJjYTgwIDEwMDY0NAotLS0gYS9zcmMvdXB0aW1lLmMKKysrIGIvc3JjL3VwdGltZS5jCkBAIC0x MzQsNyArMTM0LDcgQEAgcHJpbnRfdXB0aW1lIChzaXplX3QgbiwgY29uc3QgU1RSVUNUX1VUTVAg KnRoaXMpCiAgICAgIHByZXZpb3VzIHZlcnNpb25zIG9mIGNvcmV1dGlscyBkb24ndC4gKi8KICAg aWYgKHRtbikKICAgICAvKiBUUkFOU0xBVE9SUzogVGhpcyBwcmludHMgdGhlIGN1cnJlbnQgY2xv Y2sgdGltZS4gKi8KLSAgICBmcHJpbnRmdGltZSAoc3Rkb3V0LCBfKCIgJUg6JU0lUCAgIiksIHRt biwgMCwgMCk7CisgICAgZnByaW50ZnRpbWUgKHN0ZG91dCwgXygiICVIOiVNICAiKSwgdG1uLCAw LCAwKTsKICAgZWxzZQogICAgIHByaW50ZiAoXygiID8/Oj8/Pz8gICIpKTsKICAgaWYgKHVwdGlt ZSA9PSAodGltZV90KSAtMSkK --001a114ee3bafb7c3c054f390776-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 11 07:56:19 2017 Received: (at 26783-done) by debbugs.gnu.org; 11 May 2017 11:56:19 +0000 Received: from localhost ([127.0.0.1]:37760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8mhf-0005Bx-6R for submit@debbugs.gnu.org; Thu, 11 May 2017 07:56:19 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:35076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8mhd-0005Bn-7P for 26783-done@debbugs.gnu.org; Thu, 11 May 2017 07:56:17 -0400 Received: from localhost.localdomain (unknown [109.77.143.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 77C7F9C; Thu, 11 May 2017 12:56:15 +0100 (IST) Subject: Re: bug#26783: Discrepancy with uptime added as part of "[PATCH] Document uptime." To: Prateek saxena References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <50f8c234-67a5-6bab-0b1d-099cfb018e01@draigBrady.com> Date: Thu, 11 May 2017 12:56:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 26783-done Cc: 26783-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 11/05/17 06:40, Prateek saxena wrote: > Hi Pádraig, > > Thanks for replying. > > When we can expect the fix. > > Can we use the attached patch as workaround for time been. whether it > would be sufficient. Your patch is now applied at: http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.27-35-g82911c5 and will be made available in the next release. thanks, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Fri May 12 06:54:35 2017 Received: (at 26783-done) by debbugs.gnu.org; 12 May 2017 10:54:35 +0000 Received: from localhost ([127.0.0.1]:39799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d98DS-00045Q-Rb for submit@debbugs.gnu.org; Fri, 12 May 2017 06:54:34 -0400 Received: from mail-ua0-f175.google.com ([209.85.217.175]:33465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d98DP-000458-Fd for 26783-done@debbugs.gnu.org; Fri, 12 May 2017 06:54:33 -0400 Received: by mail-ua0-f175.google.com with SMTP id e28so44510703uah.0 for <26783-done@debbugs.gnu.org>; Fri, 12 May 2017 03:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=B5ikyJxRDJ2uQPTQUfGgjuKgKjlfcHtmsaRPToLR+S8=; b=VA4IsOpSAA+GLNvKS09Zt8e4QVPid7O7zSnLb47EAhxQN0L9Qn+/QTPeen5HZkxp5u MnNbtO7djElHfRwuH1sXgiWBZf+8UvnFhKkkitjQSs2oOgLetqnpqu/P81hQZzFnBeJ0 2rcRzK/e5joL9fwrIScAUzFMYiGG4+0n9gQAdou2mXV8wtiscpzDkaIjN3WmHDjzVtSO R+jx3LQuPcvJWsCaUyEcnd7mcQW8j1l0Qi5cPuyPJXUXM2z2O+8179boWC3jz/rOubHN dnA5nEonJevv9QQN5la0rORgAbWVaMfri28IcWgUpLundActiFvVv6sTYj5XkiA3GuPu rtsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=B5ikyJxRDJ2uQPTQUfGgjuKgKjlfcHtmsaRPToLR+S8=; b=Y2aIGGkK56HQ6ID+TLpERfUsFAiPz0RQrac/oDrY7zPaVaXBxTbDmwhU8qJC6izMuP dkmf45WhrHtLBfMSQJ1ZN869qXXZBsvRHYBlxYqWigviLhrDoKIVZu90DQrZTUYRgvTy e5jQXBZEj1ofDi6ZgYCIGRw/FLci7iCsNgYO2Gu6sXSAdEGnepLB2wz9I0+ZuSJWXtaz ZwgukkeGirrwwCC4NsDR0cAiQcGwFvWhMpVc+pX7ned6umfWdP4CjpuZh8XX5XNQkCj/ 9wNo2QjsfYX3yIW2EEkeoIc9Y+hI/1Cl9PPTFJvE5jd2o6Bf2Z4Su4M45bVXbYnHAR2Q FzEA== X-Gm-Message-State: AODbwcCmB5/hcG+WSNS/5noXpNh761Dh0GMlJEQwvZUTiEPFI6+JLqnr eh2wH3Lsp/Ft6oUz17medTDhSB3VRg== X-Received: by 10.176.16.16 with SMTP id f16mr1686507uab.132.1494586465693; Fri, 12 May 2017 03:54:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.71.93 with HTTP; Fri, 12 May 2017 03:54:25 -0700 (PDT) In-Reply-To: <50f8c234-67a5-6bab-0b1d-099cfb018e01@draigBrady.com> References: <50f8c234-67a5-6bab-0b1d-099cfb018e01@draigBrady.com> From: Prateek saxena Date: Fri, 12 May 2017 16:24:25 +0530 Message-ID: Subject: Re: bug#26783: Discrepancy with uptime added as part of "[PATCH] Document uptime." To: =?UTF-8?Q?P=C3=A1draig_Brady?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 26783-done Cc: 26783-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) Thanks P=C3=A1draig !! Regards, Prateek On Thu, May 11, 2017 at 5:26 PM, P=C3=A1draig Brady wrot= e: > On 11/05/17 06:40, Prateek saxena wrote: >> Hi P=C3=A1draig, >> >> Thanks for replying. >> >> When we can expect the fix. >> >> Can we use the attached patch as workaround for time been. whether it >> would be sufficient. > > Your patch is now applied at: > http://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommitdiff;h=3Dv8.27-= 35-g82911c5 > and will be made available in the next release. > > thanks, > P=C3=A1draig From unknown Fri Sep 19 16:07:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 09 Jun 2017 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator