Mailinglist Archive: zypp-devel (68 mails)

< Previous Next >
[zypp-devel] Fetcher::FileChecker for validaton of downloaded files.
  • From: Duncan Mac-Vicar Prett <dmacvicar@xxxxxxx>
  • Date: Mon, 21 May 2007 14:24:46 +0200
  • Message-id: <200705211424.47205.dmacvicar@xxxxxxx>

Before, the code to check the checksums on downloaded files was somewhere in 
the SourceImpl, the super class that did everything except coffee and good 
error reporting :-P-

I have added support to the Fetcher class for file checking using functors.
The Fetcher class defines the checking function interface as 
Fetcher::FileChecker and provides 4 built-in ones:

- CheckSumFileChecker
- SignatureFileChecker
- NullFileChecker
- CompositeFileChecker (allows to create one checker from various one)

The enqueue( const OnMediaLocation &loc) method now accepts a FileChecker as a 
second argument. The enqueueDigested method too, but it also appends a 
checksum checker based on the OnMediaLocation::checksum() automatically.

You can see the documentation and examples here:
http://svn.opensuse.org/svn/zypp/trunk/libzypp/zypp/Fetcher.h

See how it is used to download a signed index file in YUMDownloader::download( 
onst Pathname &dest_dir ) :
http://svn.opensuse.org/svn/zypp/trunk/libzypp/zypp/source/yum/YUMDownloader.cc

If anyone has a suggestion how to handle the reasons the file did not validate 
to the user, please tell me.

-- 
Duncan Mac-Vicar Prett  
Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages