gecko-dev/config/aboutime.pl

31 строка
569 B
Perl
Исходник Обычный вид История

1998-08-25 03:08:56 +04:00
open INFILE, "<$ARGV[1]";
$build = <INFILE>;
close INFILE;
chop $build;
open INFILE, "<$ARGV[0]" || die;
open OUTFILE, ">$ARGV[0].old" || die;
1998-08-25 03:08:56 +04:00
while (<INFILE>) {
$id = $_;
if ($id =~ "Build ID:") {
1999-04-07 21:00:27 +04:00
$temp = "Build ID: " . $build;
$id =~ s/Build ID:\s\d+/$temp/;
print OUTFILE $id;
}
elsif ($id =~ "NS_BUILD_ID") {
$temp = "NS_BUILD_ID " . $build;
$id =~ s/NS_BUILD_ID\s\d+/$temp/;
print OUTFILE $id;
}
else {
print OUTFILE $_;
}
1998-08-25 03:08:56 +04:00
}
close INFILE;
close OUTFILE;
unlink $ARGV[0];
1998-08-25 03:08:56 +04:00
rename "$ARGV[0].old", "$ARGV[0]";