Skip to content

Commit e45a567

Browse files
committed
Disabled cross architecture compression for termux
Debug, debug, and more debug :)
1 parent 31c01ba commit e45a567

File tree

1 file changed

+32
-26
lines changed

1 file changed

+32
-26
lines changed

plugins/envsetup

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,23 @@
2626
export ROOT_DIR
2727
export BUILD_PALTFORM="linux"
2828

29-
#Check if environment is Termux
30-
if [ "$(uname -o)" = "Android" ]; then
31-
export FS_COOK_PLATFORM="termux"
32-
fi
29+
_c_magneta="\e[95m"
30+
_c_green="\e[32m"
31+
_c_red="\e[31m"
32+
_c_blue="\e[34m"
33+
RST="\e[0m"
3334

34-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
35-
lshout "Running on termux"
36-
BUILD_PALTFORM="termux"
37-
fi
35+
die() { echo -e "${_c_red}[E] ${*}${RST}";exit 1;:;}
36+
warn() { echo -e "${_c_red}[W] ${*}${RST}";:;}
37+
shout() { echo -e "${_c_blue}[-] ${*}${RST}";:;}
38+
lshout() { echo -e "${_c_blue}-> ${*}${RST}";:;}
39+
msg() { echo -e "${*} \e[0m" >&2;:;}
3840

39-
if [ -z $ENABLE_USER_SETUP ]; then
40-
export ENABLE_USER_SETUP=false
41+
# Check if environment is Termux
42+
if [ "$(uname -o)" = "Android" ]; then
43+
export FS_COOK_PLATFORM="termux"
4144
fi
4245

43-
ROOT_DIR="$(git rev-parse --show-toplevel)"
44-
4546
# sudo check
4647
if [ "$(id -u)" != "0" ]; then
4748
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
@@ -55,17 +56,11 @@ if [ "$(id -u)" != "0" ]; then
5556
fi
5657
fi
5758

58-
_c_magneta="\e[95m"
59-
_c_green="\e[32m"
60-
_c_red="\e[31m"
61-
_c_blue="\e[34m"
62-
RST="\e[0m"
59+
if [ -z $ENABLE_USER_SETUP ]; then
60+
export ENABLE_USER_SETUP=false
61+
fi
6362

64-
die() { echo -e "${_c_red}[E] ${*}${RST}";exit 1;:;}
65-
warn() { echo -e "${_c_red}[W] ${*}${RST}";:;}
66-
shout() { echo -e "${_c_blue}[-] ${*}${RST}";:;}
67-
lshout() { echo -e "${_c_blue}-> ${*}${RST}";:;}
68-
msg() { echo -e "${*} \e[0m" >&2;:;}
63+
ROOT_DIR="$(git rev-parse --show-toplevel)"
6964

7065
trim_quotes() {
7166
# Usage: trim_quotes "string"
@@ -292,7 +287,7 @@ do_build() {
292287
suite="jammy"
293288
fi
294289

295-
#Disable cross architecture building in Termux
290+
#Disable cross architecture building in Termux
296291
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
297292
case $worker_arch in
298293
aarch64) termux_arch="arm64" ;;
@@ -301,12 +296,14 @@ do_build() {
301296
*) die "Unknown architecture" ;;
302297
esac
303298
if [ "$termux_arch" != "$arch" ]; then
304-
lshout "Skipping cross architecture building for Termux"
299+
lshout "Skipping cross architecture building for termux"
300+
termux_build=false
305301
return 0
306302
else
307303
lshout "Building on Termux"
308-
fi
309-
fi
304+
termux_build=true
305+
fi
306+
fi
310307

311308
shout "debootstraping $suite to $target_dir"
312309

@@ -474,6 +471,11 @@ do_compress() {
474471
export TARGET_FILE
475472
export chroot_dir=$1
476473
TARGET_FILE="$(basename ${chroot_dir})"
474+
475+
if [ "$termux_build" == "false" ]; then
476+
lshout "skip compressing $chroot_dir "
477+
return 0
478+
fi
477479

478480
if [ -n "$OVERRIDER_COMPRESSION_TYPE" ]; then
479481
case $OVERRIDER_COMPRESSION_TYPE in
@@ -574,4 +576,8 @@ install_pkg()
574576

575577
banner
576578

579+
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
580+
lshout "Running on termux"
581+
BUILD_PALTFORM="termux"
582+
fi
577583

0 commit comments

Comments
 (0)