[Pkg-pascal-devel] help needed

Paul Gevers elbrus at debian.org
Fri Nov 20 21:22:12 UTC 2015


Hi Abou,

On 20-11-15 15:12, Abou Al Montacir wrote:
> For sure this patch is ugly compared to the first one.

Can you please elaborate on why? I believed the second one was cleaner.

> It definitely affects the compiler when compiling other programs also.

I had the believe the the first one was more definite. So I like to
learn here.

> I'd prefer some thing like similar to your first path but where your
> variable contains the SOURCE_DATE_EPOCH in the format of Date function
> output.

I hope you understand that the format of SOURCE_DATE_EPOCH is outside of
our control. It is defined¹ as "A UNIX timestamp, defined as the number
of seconds (excluding leap seconds) since 01 Jan 1970 00:00:00 UTC."
Where: "The value MUST be an ASCII representation of an integer with no
fractional component, identical to the output of date +%s."

> Function UnixToDateTime(const AValue: Int64): TDateTime;
> 
> begin
> 
>   Result:=IncSecond(UnixEpoch, AValue);
> 
> end;
> 
> Function IncSecond(const AValue: TDateTime; const ANumberOfSeconds: Int64): TDateTime;
> 
> begin
> 
>   Result:=AValue+ANumberOfSeconds / SecsPerDay;
> 
>   MaybeSkipTimeWarp(AValue,Result);
> 
> end;
> 
> Procedure MaybeSkipTimeWarp(OldDate: TDateTime; var NewDate: TDateTime);
> 
> begin
> 
>   if (OldDate>0) and (NewDate<0) then
> 
>     NewDate:=NewDate-0.5
> 
>   else if (OldDate<-1.0) and (NewDate>-1.0) then
> 
>     NewDate:=NewDate+0.5;
> 
> end;
> 
> You can also put all this code in makefile or in a function that you add
> it in your patch. We are talking about 3 lines of code here.

Can you elaborate on what you have in mind exactly? I would really like
to come to a patch that would be acceptable by upstream in the upstream
code. I currently believe that scanner.pas is really the appropriate
place, with maybe globals.pas as an alternative. But maybe you have
great alternatives in mind.

Paul

¹ https://reproducible-builds.org/specs/source-date-epoch/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-pascal-devel/attachments/20151120/c26fe529/attachment.sig>


More information about the Pkg-pascal-devel mailing list