Skip to content

Commit

Permalink
vms: .tmp => _tmp for multi-dot filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Aug 23, 2012
1 parent 664aa36 commit 8ca2aba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/Parrot/Configure/Compiler.pm
Expand Up @@ -208,7 +208,7 @@ sub shebang_mod {
my ( $source, $target ) = @_;

open my $in, '<', $source or die "Can't open $source: $!";
open my $out, '>', "$target.tmp" or die "Can't open $target.tmp: $!";
open my $out, '>', "${target}_tmp" or die "Can't open ${target}_tmp: $!";

my $line = <$in>;

Expand All @@ -232,7 +232,7 @@ sub shebang_mod {
close($in) or die "Can't close $source: $!";
close($out) or die "Can't close $target: $!";

move_if_diff( "$target.tmp", $target );
move_if_diff( "${target}_tmp", $target );
}

=item C<genfile()>
Expand Down Expand Up @@ -397,7 +397,7 @@ sub genfile {
}

open my $in, '<', $source or die "Can't open $source: $!";
open my $out, '>', "$target.tmp" or die "Can't open $target.tmp: $!";
open my $out, '>', "${target}_tmp" or die "Can't open ${target}_tmp: $!";

if ( !exists $options{file_type}) {
if ( $target =~ m/makefile$/i || $target =~ m/\.mak/) {
Expand Down Expand Up @@ -608,7 +608,7 @@ sub genfile {
close($in) or die "Can't close $source: $!";
close($out) or die "Can't close $target: $!";

move_if_diff( "$target.tmp", $target, $options{ignore_pattern} );
move_if_diff( "${target}_tmp", $target, $options{ignore_pattern} );
}

# Return the next subexpression from the expression in $_[0]
Expand Down
2 changes: 1 addition & 1 deletion t/steps/gen/makefiles-01.t
Expand Up @@ -180,7 +180,7 @@ ok($error eq "invalid op \"bla\" in \"IF(bla)\" at \"(bla)\" at Makefile_$$.in l
pass("Completed all tests in $0");

END {
unlink "Makefile_$$.in", "Makefile_$$.out", "Makefile_$$.out.tmp";
unlink "Makefile_$$.in", "Makefile_$$.out", "Makefile_$$.out_tmp";
}

################### DOCUMENTATION ###################
Expand Down
8 changes: 4 additions & 4 deletions tools/release/update_version.pl
@@ -1,5 +1,5 @@
#! perl
# Copyright (C) 2011, Parrot Foundation.
# Copyright (C) 2011-2012, Parrot Foundation.
use strict;
use warnings;
use Carp;
Expand Down Expand Up @@ -60,7 +60,7 @@ =head1 AUTHOR
);

foreach my $f ( @simple_files ) {
my $new = "$f.tmp";
my $new = "${f}_tmp";
open my $IN, '<', $f or croak "Unable to open $f for reading";
open my $OUT, '>', $new or croak "Unable to open $new for writing";
while (<$IN>) {
Expand Down Expand Up @@ -89,7 +89,7 @@ sub bump_gen_code_version {
my $new_h_version = join("_", @new_version);

open my $gen_c_in, '<', "$filename";
open my $gen_c_out, '>', "$filename.tmp";
open my $gen_c_out, '>', "${filename}_tmp";
while(<$gen_c_in>) {
s/$old_h_version/$new_h_version/g;
s?\d+, /\* major_version \*/?$new_version[0], /* major_version */?;
Expand All @@ -99,7 +99,7 @@ sub bump_gen_code_version {
}
close $gen_c_in;
close $gen_c_out;
rename "$filename.tmp", $filename;
rename "${filename}_tmp", $filename;
}


Expand Down

0 comments on commit 8ca2aba

Please sign in to comment.