summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2013-03-21 18:36:47 (GMT)
committerChristian Pointner <equinox@helsinki.at>2013-03-21 18:36:47 (GMT)
commit8671790ad6f1e314918e0f6fb9b407d7b510918c (patch)
tree58b471dcfd610720575ee4edcfcbe47c05ea4193
parent28642305e978c91c5ca60f99f1ff26b6944a5c1b (diff)
updating .current file
-rwxr-xr-xrhimport-mz15
1 files changed, 12 insertions, 3 deletions
diff --git a/rhimport-mz b/rhimport-mz
index 7d26830..30dfd48 100755
--- a/rhimport-mz
+++ b/rhimport-mz
@@ -104,17 +104,20 @@ unless(-e $ZF_NEW_FILE) {
sub read_first_line {
my ($file) = @_;
- my @lines = read_file($file, binmode => ':utf8', err_mode => 'quiet', chomp => 1);
+ my @lines = read_file($file, binmode => ':utf8', err_mode => 'quiet');
return "" unless ($lines[0]);
+
+ chomp($lines[0]);
return $lines[0];
};
sub get_note {
my ($file) = @_;
my @lines = read_file($file, binmode => ':utf8', err_mode => 'quiet');
+ return "" unless ($lines[0]);
+
chomp($lines[0]);
$lines[0] = "<p><strong>$lines[0]</strong></p>\n";
- return "" unless ($lines[0]);
return join('',@lines);
};
@@ -160,7 +163,8 @@ foreach my $dir (@STATIC_FILES) {
} else {
print " $dir: adding $file\n (this was the last file!!!!)\n";
}
-
+ $next_files{$dir} = $next_file;
+
$sum_title = "$sum_title, " . read_first_line("$dir/.sum_title");
$sum_text = $sum_text . "<br />\n" . get_note("$dir/$file" . "_notes");
foreach my $ext ("flac", "wav", "ogg", "mp3") {
@@ -212,5 +216,10 @@ if(!$ret) {
}
unlink($ZF_NEW_FILE);
+foreach my $dir (@STATIC_FILES) {
+ open(my $fhs, '>', "$dir/.current");
+ print $fhs $next_files{$dir} if ($next_files{$dir});
+ close($fhs);
+}
exit 0;