Nothing wrong with this patch whatsoever.

But do note that there is a common API and naming
in hdrfmt.c prepared for a major trash hauling
one of these days.

The additional integer argument "breaks" the rule and
it literally does not matter until all the trash gets hauled.

The --queryformat code -- while quite general -- was never
intended for (but is handling) the spewage load that --qf is being
repurposed for. Can't be helped, can clean up the trash any time
its clearer what spewage is _REALLY_ needed, and a commitment to UUID
and RPMTAG_HDRID and RPMTAG_PKGID is a huge step in the right direction.

just fyi

73 de Jeff

On May 13, 2011, at 7:59 AM, Anders F. Björklund wrote:

>  RPM Package Manager, CVS Repository
>  http://rpm5.org/cvs/
>  ____________________________________________________________________________
> 
>  Server: rpm5.org                         Name:   Anders F. Björklund
>  Root:   /v/rpm/cvs                       Email:  a...@rpm5.org
>  Module: rpm                              Date:   13-May-2011 13:59:38
>  Branch: HEAD                             Handle: 2011051311593800
> 
>  Modified files:
>    rpm/rpmdb               hdrfmt.c
> 
>  Log:
>    ISO timestamps are UTC in yaml, make it explicit
> 
>  Summary:
>    Revision    Changes     Path
>    1.159       +8  -5      rpm/rpmdb/hdrfmt.c
>  ____________________________________________________________________________
> 
>  patch -p0 <<'@@ .'
>  Index: rpm/rpmdb/hdrfmt.c
>  ============================================================================
>  $ cvs diff -u -r1.158 -r1.159 hdrfmt.c
>  --- rpm/rpmdb/hdrfmt.c       12 May 2011 08:54:47 -0000      1.158
>  +++ rpm/rpmdb/hdrfmt.c       13 May 2011 11:59:38 -0000      1.159
>  @@ -195,7 +195,7 @@
>    * @return          formatted string
>    */
>   static char * realDateFormat(HE_t he, /*@unused@*/ /*@null@*/ const char ** 
> av,
>  -            const char * strftimeFormat)
>  +            const char * strftimeFormat, int utc)
>       /*@*/
>   {
>       char * val;
>  @@ -208,7 +208,10 @@
> 
>       /* this is important if sizeof(rpmuint64_t) ! sizeof(time_t) */
>       {   time_t dateint = he->p.ui64p[0];
>  -        tstruct = localtime(&dateint);
>  +        if (utc)
>  +            tstruct = gmtime(&dateint);
>  +        else
>  +            tstruct = localtime(&dateint);
>       }
>       buf[0] = '\0';
>       if (tstruct)
>  @@ -229,7 +232,7 @@
>   static char * dateFormat(HE_t he, /*@null@*/ const char ** av)
>       /*@*/
>   {
>  -    return realDateFormat(he, av, _("%c"));
>  +    return realDateFormat(he, av, _("%c"), 0);
>   }
> 
>   /**
>  @@ -241,7 +244,7 @@
>   static char * dayFormat(HE_t he, /*@null@*/ const char ** av)
>       /*@*/
>   {
>  -    return realDateFormat(he, av, _("%a %b %d %Y"));
>  +    return realDateFormat(he, av, _("%a %b %d %Y"), 0);
>   }
> 
>   /**
>  @@ -253,7 +256,7 @@
>   static char * isodateFormat(HE_t he, /*@null@*/ const char ** av)
>       /*@*/
>   {
>  -    return realDateFormat(he, av, _("%Y-%m-%dT%H:%M:%S"));
>  +    return realDateFormat(he, av, "%Y-%m-%dT%H:%M:%SZ", 1);
>   }
> 
>   /**
>  @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-...@rpm5.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to