[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make check fails on redhat 6.2

From: Derek R. Price
Subject: Re: make check fails on redhat 6.2
Date: Fri, 01 Jun 2001 11:30:49 -0400

Larry Jones wrote:

> Derek R. Price writes:
> >
> > Larry, unfortunately, 'date +%z' doesn't appear to be portable, but 'date 
> > -u' is
> > defined to return UTC by SUS2.  Any objections to something like 'expr 
> > abs\(`date
> > +%M` - `date -u +%M`\)/10' to grab the minute differential?
> Other than the fact that most expr's don't understand abs()?

I didn't look that up.  I figured 'if x < 0 then x *= -1' is easy enough to 
even in shell...

>  And that it doesn't work unless the offset is 0 or 30 minutes? (If the 
> offset is
> negative, you need to add 60, not negate it.)

Good point, I was assuming that the only fractional timezones would be 0 or 30, 
that's easy enough to do if others exist... now 'if x < 0 then x+= 60'...  
Okay, the
third timezone page I found actually lists some of the odd island states with 45
minute offsets for their zones, so I guess this would be the way to go.

>  Also, I'm not sure how
> common date -u is -- a quick check here didn't turn up any systems
> without it, but it's not in V7 Unix which is my touchstone for *real*
> portability.  Fractional timezones are rare enough that I'm not sure
> it's worth worrying about, other than noting in TESTS (which I've
> already done, but haven't checked in pending the outcome of this
> discussion).

Well, if we add this and get too many complaints, we could back it out.  The 
option is to fall back on the old code if 'date -u' fails...  it would be a net 

> > We could probably get the hours exact this way too with a little bit of 
> > effort.
> > I don't know if that's important to this particular test.
> It's somewhat important -- the point of that test (and some of its
> neighbors) is to ensure that imported files get timestamped correctly in
> the repository.  Right now, they make sure it's at least in the right
> ballpark (assuming you're not in a fractional timezone), but it would be
> better to check it exactly if there's a highly portable way to do that
> that isn't too complicated.

Well, I say the above might add 50 lines of code so far.  Not so bad.


Derek Price                      CVS Solutions Architect ( )
mailto:address@hidden         CollabNet ( )
I am not a dentist.
I am not a dentist.
I am not a dentist...

          - Bart Simpson on chalkboard, _The Simpsons_

reply via email to

[Prev in Thread] Current Thread [Next in Thread]