/[smeserver]/rpms/smeserver-yum/sme8/smeserver-yum-1.2.0-dupkeys.patch
ViewVC logotype

Annotation of /rpms/smeserver-yum/sme8/smeserver-yum-1.2.0-dupkeys.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue Jun 12 21:14:56 2007 UTC (17 years, 4 months ago) by slords
Branch: MAIN
CVS Tags: smeserver-yum-1_2_0-37_el5_sme, smeserver-yum-1_2_0-39_el5_sme, smeserver-yum-1_2_0-49_el5_sme, smeserver-yum-1_2_0-46_el5_sme, smeserver-yum-1_2_0-55_el5_sme, smeserver-yum-1_2_0-47_el5_sme, smeserver-yum-1_2_0-44_el5_sme, smeserver-yum-1_2_0-41_el5_sme, smeserver-yum-1_2_0-51_el5_sme, smeserver-yum-1_2_0-48_el5_sme, smeserver-yum-1_2_0-45_el5_sme, smeserver-yum-1_2_0-50_el5_sme, smeserver-yum-1_2_0-53_el5_sme, smeserver-yum-1_2_0-56_el5_sme, smeserver-yum-1_2_0-36_el5_sme, smeserver-yum-1_2_0-40_el5_sme, smeserver-yum-1_2_0-58_el5_sme, smeserver-yum-1_2_0-54_el5_sme, smeserver-yum-1_2_0-57_el5_sme
Import on branch sme8 of package smeserver-yum-1.2.0-36.el5.sme.src.rpm

1 slords 1.1 diff -Nur -x '*.orig' -x '*.rej' smeserver-yum-1.2.0/root/etc/e-smith/events/actions/yum-import-keys mezzanine_patched_smeserver-yum-1.2.0/root/etc/e-smith/events/actions/yum-import-keys
2     --- smeserver-yum-1.2.0/root/etc/e-smith/events/actions/yum-import-keys 2005-09-25 20:30:54.000000000 -0600
3     +++ mezzanine_patched_smeserver-yum-1.2.0/root/etc/e-smith/events/actions/yum-import-keys 2007-01-17 16:39:51.000000000 -0700
4     @@ -23,16 +23,55 @@
5    
6     use constant KEYDIR => "/usr/share/rpm-gpg-keys";
7    
8     +sub parse_key {
9     + my @lines = @_;
10     + my ($key, $good);
11     +
12     + $good = 0;
13     + foreach (@lines) {
14     + chomp;
15     + next if m#Version:#i;
16     +
17     + if (m#BEGIN PGP PUBLIC KEY BLOCK#) {
18     + $good++;
19     + next;
20     + }
21     +
22     + return $key if m#END PGP PUBLIC KEY BLOCK#;
23     +
24     + $key .= $_ if m#^\S+$# && $good;
25     + }
26     + return undef;
27     +}
28     +
29     +my %keys;
30     +
31     +if(open (RPMS, '/bin/rpm -q gpg-pubkey 2> /dev/null|')) {
32     + foreach my $rpm (map { chomp; $_ } <RPMS>) {
33     + if(open (KEY, "/bin/rpm -q --qf \%{DESCRIPTION} $rpm|")) {
34     + my $key = parse_key(<KEY>);
35     + $keys{$key}++ if $key;
36     + close(KEY);
37     + }
38     + }
39     + close (RPMS);
40     +}
41     +
42     chdir KEYDIR or die "Couldn't chdir " . KEYDIR . "\n";
43    
44     opendir DIR, '.' or die "Couldn't opendir .\n";
45    
46     -for my $key ( grep {!/^\./} readdir(DIR) )
47     +for my $file ( grep { m#^RPM-GPG-KEY# } readdir(DIR) )
48     {
49     - warn "Importing key $key\n";
50     + if(open(KEY, "$file")) {
51     + my $key = parse_key(<KEY>);
52     + next if $key && $keys{$key};
53     + }
54     +
55     + warn "Importing key $file\n";
56    
57     - system("rpm", "--import", $key) == 0 or
58     - warn "Couldn't rpm --import $key\n";
59     + system("rpm", "--import", $file) == 0 or
60     + warn "Couldn't rpm --import $file\n";
61     }
62    
63     exit 0;

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed