<html>
  <head>

  </head>
  <body style="margin-right: 4px; font-variant: normal; margin-left: 4px; line-height: normal; font-weight: normal; font-style: normal; margin-top: 4px; margin-bottom: 1px; font-family: Dialog; font-size: 10pt">
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">Steve,</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">Here is what I do to get the packages from RHN. </font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">1. Using </font><a href="https://xmlrpc.rhn.redhat.com/XMLRPC"><i><font color="#0000ff" size="2" face="Dialog"><u>https://xmlrpc.rhn.redhat.com/XMLRPC</u></font></i></a><font size="2" face="Dialog">  as the URL , I invoke the "up2date.login" method with "system id file" (an XML string basically)  as it's parameter.</font>    </p>
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">    </font>    </p>
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">    As a result of this , I get the list of channels I am entitled for.  For example,</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">    [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.</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">2. Once I get the channel information :  I go ahead to get the package details using </font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">    "</font><a href="https://xmlrpc.rhn.redhat.com/XMLRPC/$RHN/rhel-x86_64-server-5/listPackages/"><i><font color="#0000ff" size="2" face="Dialog"><u>https://xmlrpc.rhn.redhat.com/XMLRPC/$RHN/rhel-x86_64-server-5/listPackages/</u></font></i></a><font size="2" face="Dialog"><last modified time for the channel>"</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog"> 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. </font>    </p>
<br>      <br>
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">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. </font><a href="https://rhn.redhat.com/rhn/apidoc/index.jsp"><i><font color="#0000ff" size="2" face="Dialog"><u>https://rhn.redhat.com/rhn/apidoc/index.jsp</u></font></i></a><font size="2" face="Dialog"></font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">I believe the code was written long time back and was (in fact is ) fairly stable. :-) </font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">However, I am also open to re-implementation of the same in case there are some better approaches. </font>    </p>
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">So any suggestions are most welcome. </font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">Thanks,</font>    </p>
    <p style="margin-top: 0; margin-bottom: 0">
      <font size="2" face="Dialog">Amit</font>    </p>
<br>      
    <p style="margin-top: 0; margin-bottom: 0">
      <br>
      <br>
      >>> On 1/12/2010 at 09:53 PM, in message <4B4CA20E.9010604@hmdc.harvard.edu>, Steve Huff <shuff@hmdc.harvard.edu> wrote:<br>    </p>
    <table style="margin-right: 0; margin-left: 15px; margin-top: 0; margin-bottom: 0; font-size: 1em" bgcolor="#f3f3f3" border="0">
      <tr>
        <td>
          <div style="border-left: solid 1px #050505; padding-left: 7px">
            <p style="margin-top: 0; margin-bottom: 0">
              On 1/12/10 2:21 AM, Amit Laxmikant Pande wrote:<br>><br>> I get RHN package updates from <a href="https://xmlrpc.rhn.redhat.com/XMLRPC">https://xmlrpc.rhn.redhat.com/XMLRPC</a><br><br>yes, that should work.<br><br>> The XML-RPC method "listPackages" is used to list all the available<br>> packages and method "getPackage" is used to get the package details<br>> such as NEVRA.<br><br>just to be clear: do you mean "errata.listPackages", or do you mean<br>"channel.software.listAllPackages" (or one of the other calls in<br>channel.software)?<br><br>also, i suspect you mean "packages.getDetails"; is that correct?<br><br>> I want to check if I already have the package and use NEVRA + checksum<br>> logic for identifying the package uniquely.<br>><br>> For the methods mentioned above, I am not getting the checksum and hence<br>> my package existence check up fails resulting in package download every<br>> time.<br><br>here's a sample of the output i get from calling packages.getDetails on<br>a package_id (don't be confused by the output format, it's a dump of a<br>Perl data structure, but the content is all there):<br><br>%details = (<br>              'package_size' => '17855',<br>              'package_epoch' => '',<br>              'package_build_date' => '2009-04-28 12:18:05.0',<br>              'package_last_modified_date' => '2009-05-07 07:37:30.0',<br>              'package_id' => '479048',<br>              'package_md5sum' => '85fb43b78dc61d880457bc704300ace7',<br>              'package_arch_label' => 'x86_64',<br>              'package_license' => 'GPLv2+',<br>              'package_vendor' => 'Red Hat, Inc.',<br>              'package_summary' => 'ACPI Event Daemon',<br>              'package_file' => 'acpid-1.0.2-4.x86_64.rpm',<br>              'package_release' => '4',<br>              'package_version' => '1.0.2',<br>              'providing_channels' => [<br>                                      'rhel-x86_64-desktop-3',<br>                                      'rhel-x86_64-as-3',<br>                                      'rhel-x86_64-es-3',<br>                                      'rhel-x86_64-ws-3'<br>                                    ],<br>              'package_build_host' => 'ls20-bc2-14.build.redhat.com',<br>              'package_description' => 'acpid is a daemon that<br>dispatches ACPI events to user-space programs.',<br>              'package_payload_size' => '29296',<br>              'package_name' => 'acpid',<br>              'package_cookie' => ''<br>            );<br><br>as you can see, the checksum is in there.  how are you making the API<br>call, and what (if anything) do you get back?<br><br>-steve<br><br>--<br>Steve Huff - Systems Administrator, HMDC - shuff@hmdc.harvard.edu<br><br>_______________________________________________<br>rhn-users mailing list<br>rhn-users@redhat.com<br><a href="https://www.redhat.com/mailman/listinfo/rhn-users">https://www.redhat.com/mailman/listinfo/rhn-users</a><br>
            </p>
          </div>
        </td>
      </tr>
    </table>
  </body>
</html>