[rhn-users] Checksum for RHN packages

Amit Laxmikant Pande pamitlaxmikant at novell.com
Wed Jan 13 04:53:58 UTC 2010


Steve, 

Here is what I do to get the packages from RHN.  

1. Using https://xmlrpc.rhn.redhat.com/XMLRPC  as the URL , I invoke the "up2date.login" method with "system id file" (an XML string basically)  as it's parameter. 
     
    As a result of this , I get the list of channels I am entitled for.  For example, 

    [rhel-x86_64-server-5, 20100112174250, 1, 1]        : Here the first entry in the tuple is the channel name and 2nd entry is the last modified time for this channel. 

2. Once I get the channel information :  I go ahead to get the package details using  

    "https://xmlrpc.rhn.redhat.com/XMLRPC/$RHN/rhel-x86_64-server-5/listPackages/<last modified time for the channel>" 

 As a response to this method, I get package attributes such as name , version , release , arch , size, epoch . But no checksum information is returned as a result of this call which causes  the problem.  


I am not sure of why mirroring RHN updates is done this way. I could not co-relate the code written (XML RPC methods used) with the list of API provided here. https://rhn.redhat.com/rhn/apidoc/index.jsp 

I believe the code was written long time back and was (in fact is ) fairly stable. :-)  

However, I am also open to re-implementation of the same in case there are some better approaches.  
So any suggestions are most welcome.  

Thanks, 
Amit 



>>> On 1/12/2010 at 09:53 PM, in message <4B4CA20E.9010604 at hmdc.harvard.edu>, Steve Huff <shuff at hmdc.harvard.edu> wrote:


On 1/12/10 2:21 AM, Amit Laxmikant Pande wrote:
>
> I get RHN package updates from https://xmlrpc.rhn.redhat.com/XMLRPC

yes, that should work.

> The XML-RPC method "listPackages" is used to list all the available
> packages and method "getPackage" is used to get the package details
> such as NEVRA.

just to be clear: do you mean "errata.listPackages", or do you mean
"channel.software.listAllPackages" (or one of the other calls in
channel.software)?

also, i suspect you mean "packages.getDetails"; is that correct?

> I want to check if I already have the package and use NEVRA + checksum
> logic for identifying the package uniquely.
>
> For the methods mentioned above, I am not getting the checksum and hence
> my package existence check up fails resulting in package download every
> time.

here's a sample of the output i get from calling packages.getDetails on
a package_id (don't be confused by the output format, it's a dump of a
Perl data structure, but the content is all there):

%details = (
              'package_size' => '17855',
              'package_epoch' => '',
              'package_build_date' => '2009-04-28 12:18:05.0',
              'package_last_modified_date' => '2009-05-07 07:37:30.0',
              'package_id' => '479048',
              'package_md5sum' => '85fb43b78dc61d880457bc704300ace7',
              'package_arch_label' => 'x86_64',
              'package_license' => 'GPLv2+',
              'package_vendor' => 'Red Hat, Inc.',
              'package_summary' => 'ACPI Event Daemon',
              'package_file' => 'acpid-1.0.2-4.x86_64.rpm',
              'package_release' => '4',
              'package_version' => '1.0.2',
              'providing_channels' => [
                                      'rhel-x86_64-desktop-3',
                                      'rhel-x86_64-as-3',
                                      'rhel-x86_64-es-3',
                                      'rhel-x86_64-ws-3'
                                    ],
              'package_build_host' => 'ls20-bc2-14.build.redhat.com',
              'package_description' => 'acpid is a daemon that
dispatches ACPI events to user-space programs.',
              'package_payload_size' => '29296',
              'package_name' => 'acpid',
              'package_cookie' => ''
            );

as you can see, the checksum is in there.  how are you making the API
call, and what (if anything) do you get back?

-steve

--
Steve Huff - Systems Administrator, HMDC - shuff at hmdc.harvard.edu

_______________________________________________
rhn-users mailing list
rhn-users at redhat.com
https://www.redhat.com/mailman/listinfo/rhn-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhn-users/attachments/20100112/19219dcd/attachment.htm>


More information about the rhn-users mailing list