]> git.pld-linux.org Git - projects/distfiles.git/commitdiff
find extra sources from detached checksum file
authorElan Ruusamäe <glen@delfi.ee>
Mon, 3 Dec 2012 19:15:44 +0000 (21:15 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 3 Dec 2012 19:15:44 +0000 (21:15 +0200)
so, this is valid:

vim.spec:
Source0: ftp://ftp.vim.org/pub/editors/vim/patches/7.3/7.3.738

sources:
41a709ad15a1dfb5e1405fb2e618f173  7.3.738

specparser.pl

index e8656094cdd6bb117ac8d649816c45e0076f385c..e19ac6cdce3a7b3a52ab7fa59a9e9c0621d95348 100755 (executable)
@@ -321,6 +321,16 @@ sub add_md5_to_print($) # {{{
                }
        }
        close(F);
+
+       # find extra sources from detached checksum file
+       my $checksums = read_sources_file();
+       my @mapped = map { $_->[0] } @sources;
+       delete @sourcemap{@mapped};
+       while (my($source, $url) = each %sourcemap) {
+               my ($basename) = $url =~ m{/([^/]+$)};
+               my $hash = $checksums->{$basename} or next;
+               push @sources, [$source, $hash, $url];
+       }
 } # }}}
 
 next_spec(shift);
This page took 0.125497 seconds and 4 git commands to generate.