[Yum-devel] gpg importing script

Menno Smits menno-yum at freshfoo.com
Sat Jan 15 06:48:17 UTC 2005


seth vidal wrote:

>>>I could make it so if gpgkey is not defined anywhere and gpgcheck=1 then
>>>throw up the warning.
>>
>>I think this is the way to go. Something like:
>>
>>if (there are no gpg keys in rpmdb) and
>>    ((gpgcheck is 1 globally and gpgkey is not set for any repo) or
>>     (gpgcheck=1 for a repo and gpgkey is not set for that repo)):
>>	display_warning()
>>  	exit()
> 
> 
> I got it.
> 
> I did it this way:
> if not self.gpgKeyCheck(): # if we don't have any gpg keys in the rpmdb
>     for repo in self.repos.listEnabled(): 
>         if repo.gpgcheck and repo.gpgkey == '': # if a repo is set to   
>                                                 # check and no gpgkey
>         display_warning()
>         exit()
> 
> since the gpgcheck globally is only used as default setting for the
> repositories' gpgcheck value it seemed to make sense to do it this way.
> 
> and I updated the warning message, too:
> 
> You have enabled checking of packages via GPG keys. 
> This is a good thing. However, you do not have any GPG public keys
> installed. You need to download the keys for packages you wish to
> install and install them. You can do that by running the command:
>     rpm --import public.gpg.key
> 
> 
> Alternatively you can specify the url to the key you would like to use
> for a repository in the 'gpgkey' option in a repository section and yum 
> will install it for you.
> 
> For more information contact your distribution or package provider.
> 
> 
> work for you?

Perfect!

I'm getting closer with the key ID stuff. I've found that pgpmsg.py 
doesn't quite go far enough with providing key information so I'm making 
some small additions. If it all works I'll send the changes upstream and 
provide a patch to yum to take advantage. It should mean that we can 
display the correct key ID and simplfy the checks for installed keys.

Still a little more development and a lot more testing to do though...

Menno



Scanned by the NetBox from NetBox Blue
(http://netboxblue.com/)




More information about the Yum-devel mailing list