Skip to content

Commit

Permalink
Commit on 20180903 branch master 879420905633
Browse files Browse the repository at this point in the history
  • Loading branch information
SDRausty committed Sep 3, 2018
1 parent 7e8a4e6 commit a250672
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 37 deletions.
70 changes: 42 additions & 28 deletions gen/setupTermuxArch.sh
Expand Up @@ -8,7 +8,7 @@ IFS=$'\n\t'
set -Eeuo pipefail
shopt -s nullglob globstar
unset LD_PRELOAD
versionid="gen.v1.6 id374990413571"
versionid="gen.v1.6 id879420905633"
## INIT FUNCTIONS ##############################################################

aria2cif() {
Expand Down Expand Up @@ -141,6 +141,7 @@ dependbp() {

depends() { # Checks for missing commands.
printf "\\e[1;34mChecking prerequisites…\\n\\e[1;32m"
libandroidshmemif
# # Checks if download manager is set.
aria2cifdm
axelifdm
Expand Down Expand Up @@ -286,6 +287,15 @@ lftpifdm() {
fi
}

libandroidshmemif() {
dm=lftp
if [[ ! -f /data/data/com.termux/files/usr/lib/libandroid-shmem.so ]] ; then
aptin+="libandroid-shmem "
maptin+=(libandroid-shmem)
apton+=(libandroid-shmem)
fi
}

loadconf() {
if [[ -f "${wdir}setupTermuxArchConfigs.sh" ]] ; then
. "${wdir}setupTermuxArchConfigs.sh"
Expand Down Expand Up @@ -558,36 +568,39 @@ _STANDARDIF_() {
}

_TRPERROR_() { # Run on script error.
local rv="$?"
printf "\\e[?25h\\n\\e[1;48;5;138m %s\\e[0m\\n\\n" "TermuxArch WARNING: Generated script signal ${rv:-unknown} near or at line number ${1:-unknown} by \`${2:-command}\`!"
local RV="$?"
printf "\\e[?25h\\n\\e[1;48;5;138m %s\\e[0m\\n\\n" "TermuxArch WARNING: Generated script signal ${RV:-unknown} near or at line number ${1:-unknown} by \`${2:-command}\`!"
exit 201
}

_TRPEXIT_() { # Run on exit.
local rv="$?"
printf "\\a\\a\\a\\a"
local RV="$?"
rm -rf "$TAMPDIR"
sleep 0.04
CDIRS=( bin boot dev etc home lib mnt opt proc root run sbin srv sys tmp usr var )
CDIRSR="0"
for i in "${CDIRS[@]}" ; do
if [ "$(ls -A $INSTALLDIR/$i 2>/dev/null)" ] ; then
CDIRSR="1"
CDIRSV="0"
for i in "${CDIRS[@]}"
do
if $(ls -A $INSTALLDIR/$i 2>/dev/null)
then
CDIRSV="1"
fi
done
if [[ "$CDIRSR" = 0 ]] ; then
if "$CDIRSV" = 0
then
rmdir $TAMPDIR
rmdir $INSTALLDIR
fi
sleep 0.4
if [[ "$rv" = 0 ]] ; then
printf "\\a\\e[0;32m%s %s \\a\\e[0m$versionid\\e[1;34m: \\a\\e[1;32m%s\\e[0m\\n\\n\\a\\e[0m" "${0##*/}" "$args" "DONE 🏁"
printf "\\e]2; %s: %s \007" "${0##*/} $args" "DONE 🏁"
if "$RV" = 0
then
printf "\\a\\e[0;32m%s %s \\a\\e[0m$versionid\\e[1;34m: \\a\\e[1;32m%s\\e[0m\\n\\n\\a\\e[0m" "${0##*/}" "$args" "DONE 🏁 "
printf "\\e]2; %s: %s \\007" "${0##*/} $args" "DONE 🏁 "
else
printf "\\a\\e[0;32m%s %s \\a\\e[0m$versionid\\e[1;34m: \\a\\e[1;32m%s %s\\e[0m\\n\\n\\a\\e[0m" "${0##*/}" "$args" "(Exit Signal $rv)" "DONE 🏁"
printf "\033]2; %s: %s %s \007" "${0##*/} $args" "(Exit Signal $rv)" "DONE 🏁"
printf "\\a\\e[0;32m%s %s \\a\\e[0m$versionid\\e[1;34m: \\a\\e[1;32m%s %s\\e[0m\\n\\n\\a\\e[0m" "${0##*/}" "$args" "(Exit Signal $RV)" "DONE 🏁 "
printf "\033]2; %s: %s %s \\007" "${0##*/} $args" "(Exit Signal $RV)" "DONE 🏁 "
fi
printf "\\e[?25h\\e[0m"
rm -rf "$TAMPDIR"
set +Eeuo pipefail
unset set -Eeuo pipefail
exit
}

Expand Down Expand Up @@ -625,6 +638,7 @@ declare -a ADM=("aria2" "axel" "curl" "lftp" "wget")
# exit
declare -a ATM=("wget" "$PREFIX/applets/tar" "tar")
declare -a args="$@"

declare aptin="" ## apt string
declare apton="" ## exception string
declare commandif=""
Expand All @@ -644,7 +658,7 @@ declare lcp=""
declare opt=""
declare rootdir=""
declare wdir="$PWD/"
declare sti="" ## Generates pseudo random number.
declare STI="" ## Generates pseudo random number.
declare STIME="" ## Generates pseudo random number.
declare tm="" ## tar manager
trap "_TRPERROR_ $LINENO $BASH_COMMAND $?" ERR
Expand All @@ -662,17 +676,17 @@ if [[ "$commandif" = "" ]] ; then
fi
## Generates pseudo random number to create uniq strings.
if [[ -f /proc/sys/kernel/random/uuid ]] ; then
sti="$(cat /proc/sys/kernel/random/uuid)"
stim="${sti//-}"
STIME="${stim:0:3}"
STI="$(cat /proc/sys/kernel/random/uuid)"
STIM="${STI//-}"
STIME="${STIM:0:3}"
else
sti="$(date +%s)"
STIME="$(echo "${sti:7:4}"|rev)"
STI="$(date +%s)"
STIME="$(echo "${STI:7:4}"|rev)"
fi
oned="$(date +%s)"
oneda="${oned: -1}"
STIME="$oneda$STIME"
## Gets information with `getprop` about device.
ONES="$(date +%s)"
ONESA="${ONES: -1}"
STIME="$ONESA$STIME"
## Information from `getprop` about device:
CPUABI="$(getprop ro.product.cpu.abi)"
## OPTIONS STATUS: UNDERGOING TESTING; Image file and compound options are still under development. USE WITH CAUTION! IMPORTANT NOTE: CURRENTLY ONLY curl AND wget ARE THOROUGHLY TESTED. All the download managers are NOT yet fully implemented.
## GRAMMAR: `setupTermuxArch.sh [HOW] [WHAT] [WHERE]`; all options are optional for network install. AVAILABLE OPTIONS: `setupTermuxArch.sh [HOW] [WHAT] [WHERE]` and `setupTermuxArch.sh [~/|./|/absolute/path/]systemimage.tar.gz [WHERE]`.
Expand Down
2 changes: 1 addition & 1 deletion gen/setupTermuxArch.sha512
@@ -1 +1 @@
50f1f591c2884fa908648d7d9a15b2845950c80cf48284c9eb62e051dcec76ad794db158270f28e81dbfb061a124f962aeff2bd6c5781482e42ee0834d4f74a8 setupTermuxArch.tar.gz
79f25f5301c4a20547ef92f801b9a02bc4e2372e5162fb009d046baf4e126e00d85c038ae3a6b401b0c059c8ed27564e6fbbafb58502d472ec022e6dfa979bcd setupTermuxArch.tar.gz
Binary file modified gen/setupTermuxArch.tar.gz
Binary file not shown.
8 changes: 4 additions & 4 deletions scripts/files/working/archlinuxconfig.sh
Expand Up @@ -131,7 +131,7 @@ addch() {
_CFLHDR_ root/bin/ch "# Creates .hushlogin and .hushlogout file"
cat >> root/bin/ch <<- EOM
declare -a args
versionid="v1.6 id2361"
versionid="gen.v1.6 id879420905633"
_TRPEXIT_() { # on exit
printf "\\e[?25h\\e[0m"
Expand Down Expand Up @@ -353,7 +353,7 @@ addkeys() {
_CFLHDR_ root/bin/keys
cat >> root/bin/keys <<- EOM
declare -a keyrings
versionid="v1.6 id2361"
versionid="gen.v1.6 id879420905633"
_TRPEXIT_() { # on exit
printf "\\e[?25h\\e[0m"
Expand Down Expand Up @@ -446,7 +446,7 @@ addpc() {
_CFLHDR_ root/bin/pc "# Pacman install packages wrapper without system update."
cat >> root/bin/pc <<- EOM
declare -g args="\$@"
versionid="v1.6 id2361"
versionid="gen.v1.6 id879420905633"
_TRPEXIT_() { # on exit
printf "\\e[?25h\\e[0m"
Expand Down Expand Up @@ -500,7 +500,7 @@ addpci() {
_CFLHDR_ root/bin/pci "# Pacman install packages wrapper with system update."
cat >> root/bin/pci <<- EOM
declare args="\$@"
versionid="v1.6 id2361"
versionid="gen.v1.6 id879420905633"
_TRPEXIT_() { # on exit
printf "\\e[?25h\\e[0m"
Expand Down
6 changes: 3 additions & 3 deletions scripts/files/working/necessaryfunctions.sh
Expand Up @@ -104,7 +104,7 @@ makefinishsetup() {
binfnstp=finishsetup.sh
_CFLHDR_ root/bin/"$binfnstp"
cat >> root/bin/"$binfnstp" <<- EOM
versionid="v1.6 id2361"
versionid="gen.v1.6 id879420905633"
printf "\\n\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\n\\n\\e[1;32m%s\\e[0;32m" "To generate locales in a preferred language, you can use " "Settings > Language & Keyboard > Language " "in Android. Then run " "${0##*/} r " "for a quick system refresh." "==> "
locale-gen ||:
printf "\\n\\e[1;34m:: \\e[1;37mRemoving redundant packages for Termux PRoot installation…\\n"
Expand Down Expand Up @@ -149,7 +149,7 @@ versionid="v1.6 id2361"
makesetupbin() {
_CFLHDR_ root/bin/setupbin.sh
cat >> root/bin/setupbin.sh <<- EOM
versionid="v1.6 id2361"
versionid="gen.v1.6 id879420905633"
unset LD_PRELOAD
EOM
echo "$prootstmnt /root/bin/finishsetup.sh ||:" >> root/bin/setupbin.sh
Expand All @@ -160,7 +160,7 @@ makestartbin() {
_CFLHDR_ "$startbin"
printf "%s\\n" "${FLHDRP[@]}" >> "$startbin"
cat >> "$startbin" <<- EOM
versionid="v1.6 id2361"
versionid="gen.v1.6 id879420905633"
# unset LD_PRELOAD
declare -g ar2ar="\${@:2}"
declare -g ar3ar="\${@:3}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/files/working/setupTermuxArch.sh
Expand Up @@ -8,7 +8,7 @@ IFS=$'\n\t'
set -Eeuo pipefail
shopt -s nullglob globstar
unset LD_PRELOAD
versionid="v1.6 id2361"
versionid="gen.v1.6 id879420905633"
## INIT FUNCTIONS ##############################################################

aria2cif() {
Expand Down

0 comments on commit a250672

Please sign in to comment.