[projects/distfiles] find extra sources from detached checksum file

glen glen at pld-linux.org
Mon Dec 3 20:17:08 CET 2012


commit 0de41088c5bc84cc9a2a6b10acf79dd8eebcce48
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Dec 3 21:15:44 2012 +0200

    find extra sources from detached checksum file
    
    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 | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/specparser.pl b/specparser.pl
index e865609..e19ac6c 100755
--- a/specparser.pl
+++ b/specparser.pl
@@ -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);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/distfiles.git/commitdiff/0de41088c5bc84cc9a2a6b10acf79dd8eebcce48



More information about the pld-cvs-commit mailing list