@@ -690,14 +690,7 @@ _map_paths_ld_preload_open() {
690690}
691691
692692_map_paths_binary_patch () {
693- if [ " $PATH_MAPPING_RELATIVE " = 1 ]; then
694- EXEC_WRAPPER=1
695- sed -i -e ' s|/usr|././|g' " $APPDIR " /shared/bin/*
696- echo ' ORIGINAL_WORKING_DIR=${PWD}' >> " $APPDIR " /.env
697- echo ' SHARUN_WORKING_DIR=${SHARUN_DIR}' >> " $APPDIR " /.env
698- _echo " * Patched away /usr from binaries..."
699- echo " "
700- elif [ " $PATH_MAPPING_HARDCODED " = 1 ]; then
693+ if [ " $PATH_MAPPING_HARDCODED " = 1 ]; then
701694 set -- " $APPDIR " /shared/bin/*
702695 for bin do
703696 _patch_away_usr_bin_dir " $bin "
@@ -879,13 +872,9 @@ _patch_away_usr_bin_dir() {
879872 return 1
880873 fi
881874
882- if [ " $PATH_MAPPING_RELATIVE " = 1 ]; then
883- sed -i -e ' s|/usr|././|g' " $1 "
884- else
885- sed -i -e " s|/usr/bin|/tmp/$_tmp_bin |g" " $1 "
886- if ! grep -q " _tmp_bin='$_tmp_bin '" " $APPDIR " /.env 2> /dev/null; then
887- echo " _tmp_bin='$_tmp_bin '" >> " $APPDIR " /.env
888- fi
875+ sed -i -e " s|/usr/bin|/tmp/$_tmp_bin |g" " $1 "
876+ if ! grep -q " _tmp_bin='$_tmp_bin '" " $APPDIR " /.env 2> /dev/null; then
877+ echo " _tmp_bin='$_tmp_bin '" >> " $APPDIR " /.env
889878 fi
890879
891880 _echo " * patched away /usr/bin from $1 "
@@ -902,14 +891,9 @@ _patch_away_usr_lib_dir() {
902891 return 1
903892 fi
904893
905- if [ " $PATH_MAPPING_RELATIVE " = 1 ]; then
906- sed -i -e ' s|/usr|././|g' " $1 "
907- else
908- sed -i -e " s|/usr/lib|/tmp/$_tmp_lib |g" " $1 "
909-
910- if ! grep -q " _tmp_lib='$_tmp_lib '" " $APPDIR " /.env 2> /dev/null; then
911- echo " _tmp_lib='$_tmp_lib '" >> " $APPDIR " /.env
912- fi
894+ sed -i -e " s|/usr/lib|/tmp/$_tmp_lib |g" " $1 "
895+ if ! grep -q " _tmp_lib='$_tmp_lib '" " $APPDIR " /.env 2> /dev/null; then
896+ echo " _tmp_lib='$_tmp_lib '" >> " $APPDIR " /.env
913897 fi
914898
915899 _echo " * patched away /usr/lib from $1 "
@@ -926,14 +910,9 @@ _patch_away_usr_share_dir() {
926910 return 1
927911 fi
928912
929- if [ " $PATH_MAPPING_RELATIVE " = 1 ]; then
930- sed -i -e ' s|/usr|././|g' " $1 "
931- else
932- sed -i -e " s|/usr/share|/tmp/$_tmp_share |g" " $1 "
933-
934- if ! grep -q " _tmp_share='$_tmp_share '" " $APPDIR " /.env 2> /dev/null; then
935- echo " _tmp_share='$_tmp_share '" >> " $APPDIR " /.env
936- fi
913+ sed -i -e " s|/usr/share|/tmp/$_tmp_share |g" " $1 "
914+ if ! grep -q " _tmp_share='$_tmp_share '" " $APPDIR " /.env 2> /dev/null; then
915+ echo " _tmp_share='$_tmp_share '" >> " $APPDIR " /.env
937916 fi
938917
939918 _echo " * patched away /usr/share from $1 "
@@ -1096,7 +1075,7 @@ if [ "$DEPLOY_GEGL" = 1 ]; then
10961075fi
10971076
10981077# some libraries may need to look for a relative ../share directory
1099- # normally this is for when they are located in /usr/share
1078+ # normally this is for when they are located in /usr/lib
11001079# however with sharun this structure is not present, instead
11011080# we have the libraries inside `shared/lib` and `share` is one level
11021081# further back, so we make a relative symlink to fix this issue
0 commit comments