diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-10-20 14:31:50 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-20 16:04:36 +1100 |
commit | 8585cf1a78c3352ef6a0d3b3f32f9aacc28b609c (patch) | |
tree | 1072c0606f5bdd394182c24c9b2dc57f033caff1 /source4/script | |
parent | 14111d606b6b922f861f8fd291267b0b902755dc (diff) | |
download | samba-8585cf1a78c3352ef6a0d3b3f32f9aacc28b609c.tar.gz samba-8585cf1a78c3352ef6a0d3b3f32f9aacc28b609c.tar.bz2 samba-8585cf1a78c3352ef6a0d3b3f32f9aacc28b609c.zip |
s4-script: cleanup tmp files in minimial_includes.pl
also changes to use perl fns, instead of shell
Diffstat (limited to 'source4/script')
-rwxr-xr-x | source4/script/minimal_includes.pl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/script/minimal_includes.pl b/source4/script/minimal_includes.pl index d64409ed13..990ff00025 100755 --- a/source4/script/minimal_includes.pl +++ b/source4/script/minimal_includes.pl @@ -67,7 +67,10 @@ sub test_include($$$$) $lines->[$i] = ""; - `/bin/mv -f $fname $fname.misaved` && die "failed to rename $fname"; + my $mname = $fname . ".misaved"; + + unlink($mname); + rename($fname, $mname) || die "failed to rename $fname"; save_lines($fname, $lines); my $out = test_compile($fname); @@ -79,6 +82,7 @@ sub test_include($$$$) print "$fname: not removing system include $line\n"; } else { print "$fname: removing $line\n"; + unlink($mname); return; } } else { @@ -87,7 +91,7 @@ sub test_include($$$$) } $lines->[$i] = $line; - `/bin/mv -f $fname.misaved $fname` && die "failed to restore $fname"; + rename($mname, $fname) || die "failed to restore $fname"; } sub process_file($) |