[zypp-devel] Refreshing of Repositories and GPG Keys
Hi, I need to refresh the repository metadata, in case a repository has been added. I am currently using this line rman.refreshMetadata(repoinfo,zypp::RepoManager::RefreshIfNeeded); where rman is an object of zypp::RepoManager. Is this right, or something else needs to be done? Also, I could not get how to get the GPG keys for the particular repository if it exists. I have currently avoided the check for GPG keys. Regards,. Saurabh -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
On 05/30/2012 09:43 PM, Saurabh Sood wrote:
Hi, I need to refresh the repository metadata, in case a repository has been added. I am currently using this line rman.refreshMetadata(repoinfo,zypp::RepoManager::RefreshIfNeeded);
where rman is an object of zypp::RepoManager. Is this right, or something else needs to be done?
Also, I could not get how to get the GPG keys for the particular repository if it exists. I have currently avoided the check for GPG keys.
Why do you need to get the gpg keys? This is handled mostly automatically, and you only need to implement the callbacks (Reports). e.g.: https://github.com/openSUSE/zypper/blob/master/src/callbacks/keyring.h Duncan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
Hi,
I implemented the callbacks, but I could not get how the connection to
the callbacks will be made. I want the GPG keys to be imported
whenever the repository is to be added. I have so far instantiated the
class, which uses the struct for KeyRingReport.
Regards,.
Saurabh
On Thu, May 31, 2012 at 7:21 PM, Duncan Mac-Vicar P.
On 05/30/2012 09:43 PM, Saurabh Sood wrote:
Hi, I need to refresh the repository metadata, in case a repository has been added. I am currently using this line rman.refreshMetadata(repoinfo,zypp::RepoManager::RefreshIfNeeded);
where rman is an object of zypp::RepoManager. Is this right, or something else needs to be done?
Also, I could not get how to get the GPG keys for the particular repository if it exists. I have currently avoided the check for GPG keys.
Why do you need to get the gpg keys? This is handled mostly automatically, and you only need to implement the callbacks (Reports).
e.g.: https://github.com/openSUSE/zypper/blob/master/src/callbacks/keyring.h
Duncan
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
On Tuesday 05 June 2012 21:19:11 Saurabh Sood wrote:
Hi, I implemented the callbacks, but I could not get how the connection to the callbacks will be made. I want the GPG keys to be imported whenever the repository is to be added. I have so far instantiated the class, which uses the struct for KeyRingReport.
http://doc.opensuse.org/projects/libzypp/HEAD/namespacezypp_1_1callback.html Those callbacks are simple one-to-one connections. You can e.g. call connect() in the ctor. Then create a variable with appropriate scope. struct KeyRingSignalsReceive : public callback::ReceiveReport<KeyRingSignals> { KeyRingSignalsReceive() { connect(); } ... }; ... KeyRingSignalsReceive keyRingSignalsReceiver; See also: http://doc.opensuse.org/projects/libzypp/HEAD/classzypp_1_1KeyRing.html 'enum DefaultAcceptBits' and 'KeyRing::setDefaultAccept'. Callback is interesting if you want to give feedback. You can also set a desired default without need to use callbacks: KeyRing::setDefaultAccept( KeyRing::ACCEPT_UNKNOWNKEY | KeyRing::TRUST_KEY_TEMPORARILY ); -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres SUSE LINUX Products GmbH, Development, ma@suse.de GF:Jeff Hawn,Jennifer Guild,Felix Imendörffer, HRB16746(AG Nürnberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
participants (3)
-
Duncan Mac-Vicar P.
-
Michael Andres
-
Saurabh Sood