diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-12-13 17:39:07 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-12-13 17:39:07 +0000 |
commit | 0f302b1e69881970bfd6ea5319d752a62572ab74 (patch) | |
tree | fa9cbf84cde0d6bc94b68bc2ac0663b40aedf821 | |
parent | 497d39635bdf86176c92fafc79addf4c70eaf46f (diff) | |
download | rpmtools-0f302b1e69881970bfd6ea5319d752a62572ab74.tar rpmtools-0f302b1e69881970bfd6ea5319d752a62572ab74.tar.gz rpmtools-0f302b1e69881970bfd6ea5319d752a62572ab74.tar.bz2 rpmtools-0f302b1e69881970bfd6ea5319d752a62572ab74.tar.xz rpmtools-0f302b1e69881970bfd6ea5319d752a62572ab74.zip |
when generating {info,changelog,files}.xml.lzma, add them to md5sum
-rw-r--r-- | genhdlist2 | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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; |