Sfoglia il codice sorgente

Ports/bash: Make a /bin/bash symlink to /usr/local/bin/bash

I've added a post_install step to the system that allows you to run
arbitrary commands after the regular install step.

This allows scripts that start with "#!/bin/bash" to work in Serenity.
Andreas Kling 5 anni fa
parent
commit
f5418f40cc
2 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 4 0
      Ports/.port_include.sh
  2. 5 0
      Ports/bash/package.sh

+ 4 - 0
Ports/.port_include.sh

@@ -153,6 +153,9 @@ func_defined build || build() {
 func_defined install || install() {
 func_defined install || install() {
     run make DESTDIR="$SERENITY_ROOT"/Root $installopts install
     run make DESTDIR="$SERENITY_ROOT"/Root $installopts install
 }
 }
+func_defined post_install || post_install() {
+    echo
+}
 func_defined clean || clean() {
 func_defined clean || clean() {
     rm -rf "$workdir" *.out
     rm -rf "$workdir" *.out
 }
 }
@@ -252,6 +255,7 @@ do_build() {
 do_install() {
 do_install() {
     echo "Installing $port!"
     echo "Installing $port!"
     install
     install
+    post_install
     addtodb "${1:-}"
     addtodb "${1:-}"
 }
 }
 do_clean() {
 do_clean() {

+ 5 - 0
Ports/bash/package.sh

@@ -14,3 +14,8 @@ build() {
     run_replace_in_file "s/define CAN_REDEFINE_GETENV 1/undef CAN_REDEFINE_GETENV/" config.h
     run_replace_in_file "s/define CAN_REDEFINE_GETENV 1/undef CAN_REDEFINE_GETENV/" config.h
     run make $makeopts
     run make $makeopts
 }
 }
+
+post_install() {
+    mkdir -p $SERENITY_ROOT/Root/bin
+    ln -s /usr/local/bin/bash $SERENITY_ROOT/Root/bin/bash
+}