Hey,

On 12/09/2013, at 7:40 PM, Michael Mraka <michael.mr...@redhat.com> wrote:

> as we discussed on IRC - currently spacewalk doesn't correctly recognize
> signature type so you need to fix _extract_signatures() in rhn_rpm.py to
> get it right; your proposed change works for me.


So, I've now tried this on Oracle Linux 6 (x86_64) with both Oracle Database 
11.2.0.4 and PostgreSQL (embedded) and both times, with the following changes:

diff --git a/schema/spacewalk/common/data/rhnPackageKey.sql 
b/schema/spacewalk/common/data/rhnPackageKey.sql
index ff1ba26..ce9d378 100644
--- a/schema/spacewalk/common/data/rhnPackageKey.sql
+++ b/schema/spacewalk/common/data/rhnPackageKey.sql
@@ -93,6 +93,9 @@ insert into rhnPackageKey (id, key_id, key_type_id, 
provider_id) values
 insert into rhnPackageKey (id, key_id, key_type_id, provider_id) values
 (sequence_nextval('rhn_pkey_id_seq'), '2e2bcdbcb38a8516', 
lookup_package_key_type('gpg'), lookup_package_provider('Oracle Inc.'));

+insert into rhnPackageKey (id, key_id, key_type_id, provider_id) values
+(sequence_nextval('rhn_pkey_id_seq'), '72f97b74ec551f03', 
lookup_package_key_type('pgp'), lookup_package_provider('Oracle Inc.'));
+


diff --git a/backend/common/rhn_rpm.py b/backend/common/rhn_rpm.py
index f06fbd5..bfa9d82 100644
--- a/backend/common/rhn_rpm.py
+++ b/backend/common/rhn_rpm.py
@@ -128,6 +128,8 @@ class RPM_Header:
                 key_id = ret[9:17]
             elif ret_len <= 72: # V4 DSA signature
                 key_id = ret[18:26]
+            elif ret_len <= 280: # V3 RSA/8 signature
+                key_id = ret[10:18]
             elif ret_len <= 287: # V4 RSA/SHA1 signature
                 key_id = ret[19:27]
             elif ret_len <= 536: # V3 RSA/SHA256 signature


I get the following results (using spacewalk-repo-sync to pull packages):

1. Packages are listed in Channels -> Manage Software Channels -> Manage 
Software Packages -> (channel) but with "Content Provider" as "Unknown"

2. Packages are not listed at all in Channels -> Software Channels -> (channel) 
-> Packages

However, if I look in both databases, I see the rhnPackageKey entry is created 
correctly and linked to the correct provider_id and the 
rhnPackageKeyAssociation table lists the correct key_id for each package_id. 
Also, if I run the packages_in_channel SQL query on both databases, I get 
exactly the same (correct) result:

SELECT P.id AS ID,
   PN.name as package_name,
   P.summary,
   PN.name || '-' || evr_t_as_vre_simple(PE.evr) || '.' || PA.label AS nvrea,
   PP.name AS provider
FROM rhnPackage P inner join
   rhnPackageArch PA on P.package_arch_id = PA.id inner join
   rhnPackageName PN on P.name_id = PN.id inner join
   rhnPackageEVR PE on P.evr_id = PE.id  inner join
   rhnChannelPackage CP on P.id = CP.package_id left join
   rhnPackageKeyAssociation assoc on assoc.package_id = P.id left join
   rhnPackageKey KEY on KEY.id = assoc.key_id left join
   rhnPackageProvider PP on KEY.provider_id = PP.id
WHERE CP.channel_id = :cid

id |     package_name     |                       summary                       
 |                  nvrea                   |  provider
----+----------------------+------------------------------------------------------+------------------------------------------+-------------
 55 | mysql                | MySQL client programs and shared libraries         
  | mysql-5.5.33-1.el6.x86_64                | Oracle Inc.
 47 | mysql                | MySQL client programs and shared libraries         
  | mysql-5.5.32-2.el6.x86_64                | Oracle Inc.
...

So, I could use some assistance to work out why it's working for you guys, but 
not on my test rigs. 

Thanks,
Avi

--
Oracle <http://www.oracle.com>
Avi Miller | Principal Program Manager | +61 (412) 229 687
Oracle Linux and Virtualization
417 St Kilda Road, Melbourne, Victoria 3004 Australia


_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to