commit 5394c0867006668ed148246dcd6dc92f653e2928
parent bd12986867bbf55fd837db0f66dd540bcb5a7b9d
Author: root <root@dorje.v103.te2000>
Date: Sun, 17 Jul 2022 15:07:56 +0000
Fix ALL_DIR, cd to it at the start of script.
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/install b/install
@@ -23,6 +23,7 @@ die111() { # 111: system call failed
}
install_to_all() {
+ cd $ALL_DIR || exit $?
mkdir s6-rc-source || exit $?
./command/fsapply ./s6-rc-source ./conf/s6-rc.fileset || exit $?
[[ -f ./s6-rc-source/ok-all/type ]] || die111 \
@@ -32,7 +33,7 @@ install_to_all() {
}
typeset -f -t install_to_all
-typeset -g ALL_DIR=$0:h
+typeset -g ALL_DIR=$0:h:h
if [[ $ALL_DIR == /versions/all.* ]]; then
path=( $ALL_DIR/command "$path[@]" )
#fpath=( $ALL_DIR/zsh-functions "$fpath[@]" )
diff --git a/postinstall b/postinstall
@@ -35,6 +35,7 @@ link_changed() {
}
postinstall() {
+ cd $ALL_DIR || exit $?
ensure_symlink /command current/command || return $?
if [[ -d /run/s6-rc/ ]]; then
@@ -64,7 +65,7 @@ postinstall() {
}
typeset -ft postinstall
-typeset -g ALL_DIR=$0:h
+typeset -g ALL_DIR=$0:h:h
if [[ $ALL_DIR == /versions/all.* ]]; then
path=( $ALL_DIR/command "$path[@]" )
#fpath=( $ALL_DIR/zsh-functions "$fpath[@]" )