Permalink
Browse files

Verify checksums during fetch phase.

The checksums for required packages are now checked during the fetch
phase (in addition to the unpack phase) so that bad archives can be
detected and redownloaded earlier in the update process.
  • Loading branch information...
1 parent 8e1fc62 commit 36f8ba73cda3f650b77285e66cfce588069762bb @dustinac dustinac committed Feb 6, 2012
Showing with 9 additions and 8 deletions.
  1. +0 −6 TODO
  2. +9 −2 perlmod/Fink/PkgVersion.pm
View
6 TODO
@@ -17,12 +17,6 @@ Medium
* replace "fink list --help" by a general "fink --help [command]" similiar to
how CVS does it (e.g. try "cvs -H update")
-* checksums should always be checked whenever we know we are going to use a given
- source file later. E.g. if you run "fink rebuild foo", then Fink does check
- if the source files for package foo are present, and if not, downloads them.
- If present, fink should verify the checksum *immediatly*, in addition to the
- current check (just prior to decompressing the archive).
-
* add a mirror check utillity that given some testcases will verify that all mirrors
do still work
View
@@ -3240,8 +3240,13 @@ sub phase_fetch {
}
foreach $suffix ($self->get_source_suffixes) {
- if (not $conditional or not defined $self->find_tarball($suffix)) {
- $self->fetch_source($suffix,0,0,0,$dryrun);
+ if (not $conditional) {
+ $self->fetch_source($suffix, 0, 0, 0, $dryrun);
+ } elsif (not $dryrun) {
+ $self->fetch_source_if_needed($suffix);
+ # fetch_source_if_needed doesn't work with dryrun
+ } elsif (not defined $self->find_tarball($suffix)) {
+ $self->fetch_source($suffix, 0, 0, 0, $dryrun);
}
}
}
@@ -3456,6 +3461,8 @@ GCC_MSG
foreach $suffix ($self->get_source_suffixes) {
$archive = $self->get_tarball($suffix);
+ # We verified that the tar file exists with the right checksum during
+ # the fetch phase. This second check is redundant, but just in case...
$found_archive = $self->fetch_source_if_needed($suffix);
# Determine the name of the TarFilesRename in the case of multi tarball packages

0 comments on commit 36f8ba7

Please sign in to comment.