From 0f302b1e69881970bfd6ea5319d752a62572ab74 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 13 Dec 2007 17:39:07 +0000 Subject: when generating {info,changelog,files}.xml.lzma, add them to md5sum --- genhdlist2 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/genhdlist2 b/genhdlist2 index f4452a3..a32f7ba 100644 --- a/genhdlist2 +++ b/genhdlist2 @@ -99,13 +99,12 @@ sub do_it { build_synthesis($urpm, "$synthesis.tmp"); if (1) { - foreach my $name ('hdlist.cz', map { "$_.xml.lzma" } @xml_media_info) { + my @media_info_files = ('hdlist.cz', 'synthesis.hdlist.cz', map { "$_.xml.lzma" } @xml_media_info); + foreach my $name (@media_info_files) { print "replacing $media_info_dir/$name with $name.tmp\n" if $verbose >= 0; - rename "$media_info_dir/$name.tmp", "$media_info_dir/$name" or die "rename $media_info_dir/$name failed: $?\n"; + rename "$media_info_dir/$name.tmp", "$media_info_dir/$name" or die "rename $media_info_dir/$name failed: $!\n"; } - print "replacing $synthesis with synthesis.hdlist.cz.tmp\n" if $verbose >= 0; - rename "$synthesis.tmp", $synthesis or die "ERROR: this should not happen: rename $synthesis failed\n"; - generate_md5sum($media_info_dir) if !$options{no_md5sum}; + generate_md5sum($media_info_dir, \@media_info_files) if !$options{no_md5sum}; } } @@ -332,9 +331,9 @@ sub build_synthesis { } sub generate_md5sum { - my ($media_info_dir) = @_; + my ($media_info_dir, $media_info_files) = @_; print "updating $media_info_dir/MD5SUM\n" if $verbose >= 0; - my $m = `cd '$media_info_dir' ; /usr/bin/md5sum hdlist.cz synthesis.hdlist.cz`; + my $m = `cd '$media_info_dir' ; /usr/bin/md5sum @$media_info_files`; unlink "$media_info_dir/MD5SUM"; # ensure no hard link is used open(my $f, '>', "$media_info_dir/MD5SUM") or die "Can't write MD5SUM: $!\n"; print $f $m; -- cgit v1.2.1