From c012d8b882480151d8eb7da92c4cca80d1d9b814 Mon Sep 17 00:00:00 2001 From: pmichaud Date: Tue, 28 Aug 2012 00:36:53 -0500 Subject: Move skel/ into top-level directory, to try building directly from the repo. --- tools/build/bin-install.pl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tools/build/bin-install.pl (limited to 'tools/build/bin-install.pl') diff --git a/tools/build/bin-install.pl b/tools/build/bin-install.pl new file mode 100644 index 0000000..1c71cea --- /dev/null +++ b/tools/build/bin-install.pl @@ -0,0 +1,28 @@ +#! perl + +use strict; +use warnings; +use File::Spec; + +my ($p6bin, $dest, @files) = @ARGV; +die "Usage: $0 " + unless $p6bin && $dest; + +for my $filename (@files) { + open my $IN, '<', $filename + or die "Cannot read file '$filename' for installing it: $!"; + my $basename = (File::Spec->splitpath($filename))[2]; + open my $OUT, '>', "$dest/$basename" + or die "Cannot write file '$dest/$basename' for installing it: $!"; + while (<$IN>) { + if ($. == 1 && /^#!/) { + print { $OUT } "#!$p6bin\n"; + } + else { + print { $OUT } $_; + } + } + close $OUT or die "Error while closing file '$dest/$basename': $!"; + close $IN; + chmod 0755, "$dest/$basename"; +} -- cgit v1.1