There's actually a design deficiency in *.rpm
packaging that forces hex strings (and thereby doubling
the file digest bloat in *.rpm package metadata needelessly,
see my message on the Cooker mailing list today).

A better implementation would be to flip to an octet
array in *.rpm and coerce back to hex strings in
URPM.xs.

But you well know how much pain would be involved in
doing the correct engineering. I had no idea the
number of places (like ABRT and GDB) that RPM has infected
in modern linux distros.

hth

73 de Jeff

On Dec 10, 2010, at 5:03 PM, Per Øyvind Karlsen wrote:

>  RPM Package Manager, CVS Repository
>  http://rpm5.org/cvs/
>  ____________________________________________________________________________
> 
>  Server: rpm5.org                         Name:   Per Øyvind Karlsen
>  Root:   /v/rpm/cvs                       Email:  pkarl...@rpm5.org
>  Module: rpm                              Date:   10-Dec-2010 23:03:46
>  Branch: HEAD                             Handle: 2010121022034600
> 
>  Modified files:
>    rpm/perl                RPM_Files.xs
> 
>  Log:
>    return digest properly as hex string for RPM::Files->digest()
> 
>  Summary:
>    Revision    Changes     Path
>    1.10        +6  -5      rpm/perl/RPM_Files.xs
>  ____________________________________________________________________________
> 
>  patch -p0 <<'@@ .'
>  Index: rpm/perl/RPM_Files.xs
>  ============================================================================
>  $ cvs diff -u -r1.9 -r1.10 RPM_Files.xs
>  --- rpm/perl/RPM_Files.xs    30 Jul 2008 22:14:34 -0000      1.9
>  +++ rpm/perl/RPM_Files.xs    10 Dec 2010 22:03:46 -0000      1.10
>  @@ -156,11 +156,12 @@
>       size_t lenp = 0;
>       PPCODE:
>       if ((digest = rpmfiDigest(Files, &algop, &lenp)) != NULL
>  -        /* return undef if empty */) {
>  -        if (lenp) {
>  -        XPUSHs(sv_2mortal(newSVpv((const char*)digest, lenp)));
>  -        XPUSHs(sv_2mortal(newSViv(algop)));
>  -        }
>  +    /* return undef if empty */) {
>  +    if (lenp && strlen((const char*)digest)) {
>  +        const char * hexDigest = pgpHexStr(digest, lenp);
>  +        XPUSHs(sv_2mortal(newSViv(algop)));
>  +        XPUSHs(sv_2mortal(newSVpv(hexDigest, lenp<<1)));
>  +    }
>       }
> 
>   const char *
>  @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-...@rpm5.org

______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

Reply via email to