Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adapt shebang line on installing

  • Loading branch information...
commit 089584d3577b72ed3fb405a32f35469ca7b939ab 1 parent c4afc58
@moritz moritz authored
Showing with 30 additions and 5 deletions.
  1. +2 −5 skel/tools/build/Makefile.in
  2. +28 −0 skel/tools/build/bin-install.pl
View
7 skel/tools/build/Makefile.in
@@ -97,12 +97,9 @@ rakudo-install: rakudo
modules-install: rakudo
@echo "== Installing 'ufo'"
- $(CP) modules/ufo/bin/ufo $(DESTDIR)$(PARROT_BIN_DIR)/ufo
- $(CHMOD) 755 $(DESTDIR)$(PARROT_BIN_DIR)/ufo
$(PERL) tools/build/module-install.pl $(DESTDIR)$(PARROT_BIN_DIR)/$(PERL6_EXE) $(DESTDIR)$(PERL6_LANG_DIR)/lib $(MODULES)
- @echo "Installing 'panda'"
- $(CP) modules/panda/bin/panda $(DESTDIR)$(PARROT_BIN_DIR)/panda
- $(CHMOD) 755 $(DESTDIR)$(PARROT_BIN_DIR)/panda
+ @echo "== Installing binaries"
+ $(PERL) tools/build/bin-install.pl $(DESTDIR)$(PARROT_BIN_DIR)/$(PERL6_EXE) $(DESTDIR)$(PARROT_BIN_DIR) modules/ufo/bin/ufo modules/panda/bin/panda
install: rakudo-install modules-install
View
28 skel/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 <perl6_binary> <destination_path> <source_files>"
+ 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";
+}
Please sign in to comment.
Something went wrong with that request. Please try again.