aboutsummaryrefslogtreecommitdiffstats
path: root/genhdlist2
diff options
context:
space:
mode:
Diffstat (limited to 'genhdlist2')
-rw-r--r--genhdlist213
1 files 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;