delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/10/22/04:46:49

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=ZL7fKR2DjoUV2csw6BRbLLdPWM1BFf0A1hVu/PQOgpXr1KM+MSaK7
CvizONHDLMed2uqBCllry9AzatKA1A3BiMmGg0t+Wrekx9EeeS23iBZwL1+yqWIn
b+D76laqqWMvdL7NnRrppAYkqzMtMBEJOT2iBr4Kv1dKoza/drbx5c=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=8gerua2W+ASbK0v4UWxjLN/H9xg=; b=aHlWOkafkDwJjyu715QzfznGlOtd
hOZ9XJ+FqoCRkGv0Q4ArWkenElacg1zhbSwlT4Zp986qT3iAl1GsHD8bTlYKlKad
Z7ycDyfc/3Ik9sIKXFpuxO64PRfoN/jIBonpHEdE0NTSUyVoP293Sv6LB8+V2NQ4
JjwaX5p7YKcgM6o=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Thu, 22 Oct 2015 10:46:26 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Bash unable to print epoch timestamp
Message-ID: <20151022084626.GX5319@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <loom DOT 20151022T010214-951 AT post DOT gmane DOT org> <loom DOT 20151022T084651-899 AT post DOT gmane DOT org>
MIME-Version: 1.0
In-Reply-To: <loom.20151022T084651-899@post.gmane.org>
User-Agent: Mutt/1.5.23 (2014-03-12)

--su+CkryO4QJrkqP3
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Brian,

On Oct 22 07:03, Brian Inglis wrote:
> Brian Inglis <Brian.Inglis <at> SystematicSw.ab.ca> writes:
>=20
> >=20
> > Don Harrop <don <at> effx.us> writes:
> > > Bash outputs no value when using it's built in method of printing an=
=20
> > > "epoch" timestamp.
> > > BashCommandLine#: printf '%(%s)T' -1
> >=20
> > bash printf depends on underlying strftime in newlib, which does not su=
pport
> > %s, as it is conditional on _WANT_C99_TIME_FORMATS being defined, and t=
hat
> > is presumably not defined in the config, as %s is not shown in man strf=
time.=20
> > Workaround for now is use=20
> >     date +%s=20
> > for current time, and=20
> >    date -d $(printf '%(%T)T' -2) +%s
> > for shell invocation time.
>=20
> > %s, as it is conditional on _WANT_C99_TIME_FORMATS being defined, and t=
hat
> Wrong! Misread the code, strftime %s is not supported!=20
>=20
> STC and suggested patch appended (posting from gmane), compiles, but can't
> build STC as ld fails with undef refs, and I don't know all the correct
> LD..., -L and -l incantations. Email me for original files.=20

Cool, thanks for the patch.  Unfortunately it doesn't apply cleanly.
There are several unexpected line wraps and there's this:

> --- a/newlib/time/strftime.c        2015-08-20 03:39:24.000000000 -0600
> +++ b/newlib/time/strftime.c        2015-10-21 20:15:22.367453000 -0600

How did this happen?  If you checkout the newlib-cygwin git repo,
strftime.c is under newlib/libc/time, not under newlib/time :o

Would you mind to attach a patch generated with git format-patch?


Thanks in advance,
Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--su+CkryO4QJrkqP3
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWKKJiAAoJEPU2Bp2uRE+gY0gP/0GTL3rH1JM3O/8rlzR8n82G
Lhuq9Xnq+TbyxtjNr2Z3Eo4c/4hpnemIpZAiiPgvXw1OmKuW15zUT7YuM9vU5prA
WzkRN6lFvowew98z7KIBAyIj1p2xz5Ckmy+HCJfIMNzeC/nijwb4rMzpUly1QBD7
EHRRJUoqyC1Kw1dvpnKb3f88Fgnr+HLMFDnWUypD8rWRQeORwAffSfuA2t+4Dhl0
xAI1cNKk7kwSvXXVlj2z2WaAkjiQGgH8x9YnOjfJ3iTMoWbxiY0WmRCOk2Jp5TVY
GieCDHqrBKqr7sLNi5rNCeF0NwfjxGW4nEUwQVWby+UgSbJMej4K8oG3Fe7itOoL
rb/IkBX2ymZC4Pr7xeHWHkjYmgbew5Mu5QpNHUiBj/IJV7+vHnHPJASXcMTZ9Kuu
xegXJJtGj+FnhRRGC8teXJykEqtEUpNRARLwErBQEJzpIUBho72v7eVdJ0BlMrGf
3o3Ao7dOtEELyOQhDTabyyl6lf9R5Ppoe1EqW9kZHZgo1UaXvTGhokn61WLD14hP
l80yZzhQ50GkvIg2suB5SuMcrqUhEqWq1ry7k3MTZ7QGoAIl6u+ut+uTOXYuMTPi
0zRrM+BoAUfRgT5skp4Wy+fH2hZW2XVEPCbowCRjdFji5MXvy5epDqw/mQDZCtnt
Pqmod/3TwkF4Ro9Fpkt8
=YFXT
-----END PGP SIGNATURE-----

--su+CkryO4QJrkqP3--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019