From a0ba8b2cdcf9bd8dfe5afadb930aaa3dc3f47627 Mon Sep 17 00:00:00 2001 From: SDRausty <27742457+SDRausty@users.noreply.github.com> Date: Tue, 26 Nov 2019 17:53:06 -0500 Subject: [PATCH] commit 975310919 on 20191126 --- .conf/VERSIONID | 2 +- scripts/bash/build/build.browsers.bash | 1 + .../bash/build/build.buildAPKs.modules.bash | 5 +- scripts/bash/build/build.github.bash | 74 +++++++++++-------- scripts/bash/build/build.github.topics.bash | 49 ++++++++++-- scripts/bash/build/build.github.topics30.bash | 51 +++++++++++++ scripts/bash/build/build.in.dir.bash | 50 ++----------- scripts/bash/build/build.one.bash | 61 ++++++++------- sha512.sum | 13 ++-- 9 files changed, 185 insertions(+), 121 deletions(-) create mode 120000 scripts/bash/build/build.browsers.bash create mode 100755 scripts/bash/build/build.github.topics30.bash diff --git a/.conf/VERSIONID b/.conf/VERSIONID index 00fc4bb83..b58673949 100644 --- a/.conf/VERSIONID +++ b/.conf/VERSIONID @@ -1 +1 @@ -4.5.7 +4.5.8 diff --git a/scripts/bash/build/build.browsers.bash b/scripts/bash/build/build.browsers.bash new file mode 120000 index 000000000..865710fe5 --- /dev/null +++ b/scripts/bash/build/build.browsers.bash @@ -0,0 +1 @@ +buildBrowsers.bash \ No newline at end of file diff --git a/scripts/bash/build/build.buildAPKs.modules.bash b/scripts/bash/build/build.buildAPKs.modules.bash index 8d085f75f..3f969f51b 100755 --- a/scripts/bash/build/build.buildAPKs.modules.bash +++ b/scripts/bash/build/build.buildAPKs.modules.bash @@ -37,7 +37,7 @@ _CK4MS_() { # ChecKs 4 ModuleS } _GSA_() { # update submodules to latest version - ((printf "\\e[1;7;38;5;96m%s\\e[0m\\n" "Adding $SIAD/${GBMS[$LOC]} to ~/buildAPKs/$LOC..." && git submodule add "$SIAD/${GBMS[$LOC]}" "$LOC") && (printf "\\e[1;7;38;5;96m%s\\e[0m\\n" "Updating ~/${RDR##*/}/$LOC..." && git submodule update --init --recursive --remote "$LOC" && _IAR_ "$JDR")) || (printf "\\e[1;7;38;5;66m%s\\e[0m\\n" "Cannot add and update ~/${RDR##*/}/$LOC: Continuing...") + ((printf "\\e[1;7;38;5;96m%s\\e[0m\\n" "Adding $SIAD/${GBMS[$LOC]} to ~/buildAPKs/$LOC..." && git submodule add "$SIAD/${GBMS[$LOC]}" "$LOC") && (printf "\\e[1;7;38;5;96m%s\\e[0m\\n" "Updating ~/${RDR##*/}/$LOC..." && git submodule update --init --recursive --remote "$LOC" && _IAR_ )) || (printf "\\e[1;7;38;5;66m%s\\e[0m\\n" "Cannot add and update ~/${RDR##*/}/$LOC: Continuing...") } _GSMU_() { @@ -53,6 +53,7 @@ _GSMU_() { for LOC in "${!GBMS[@]}" do export JDR="$RDR/$LOC" + export WDIR="$RDR/$LOC" cd "$RDR/" _GSU_ done @@ -60,7 +61,7 @@ _GSMU_() { } _GSU_() { # update submodules to latest version - ((printf "\\e[1;7;38;5;96m%s\\e[0m\\n" "Updating ~/buildAPKs/$LOC..." && git submodule update --init --recursive --remote "$LOC" && _IAR_ "$JDR") || ( _GSA_ )) || (printf "\\e[1;7;38;5;66m%s\\e[0m\\n" "Cannot update ~/buildAPKs/$LOC: Continuing...") # https://www.tecmint.com/chaining-operators-in-linux-with-practical-examples/ + ((printf "\\e[1;7;38;5;96m%s\\e[0m\\n" "Updating ~/buildAPKs/$LOC..." && git submodule update --init --recursive --remote "$LOC" && _IAR_ ) || ( _GSA_ )) || (printf "\\e[1;7;38;5;66m%s\\e[0m\\n" "Cannot update ~/buildAPKs/$LOC: Continuing...") # https://www.tecmint.com/chaining-operators-in-linux-with-practical-examples/ if [[ -f "$JDR"/ma.bash ]] then . "$JDR"/ma.bash diff --git a/scripts/bash/build/build.github.bash b/scripts/bash/build/build.github.bash index 0677aaffd..cd09f2dd6 100755 --- a/scripts/bash/build/build.github.bash +++ b/scripts/bash/build/build.github.bash @@ -8,7 +8,7 @@ export RDR="$HOME/buildAPKs" . "$RDR"/scripts/bash/init/ushlibs.bash . "$RDR"/scripts/bash/shlibs/trap.bash 67 68 69 "${0##*/}" -_AND_ () { # writes configuration file for git repository tarball if AndroidManifest.xml file is found in git repositoryr +_AND_ () { # writes configuration file for git repository tarball if AndroidManifest.xml file is found in git repository export CK=0 printf "%s\\n" "$COMMIT" > "$JDR/var/conf/$USER.${NAME##*/}.${COMMIT::7}.ck" printf "%s\\n" "0" >> "$JDR/var/conf/$USER.${NAME##*/}.${COMMIT::7}.ck" @@ -29,18 +29,28 @@ _ATT_ () { printf "%s\\n" "Querying $USENAME $REPO ${COMMIT::7} for AndroidManifest.xml file:" if [[ "$COMMIT" != "" ]] then - if [[ "$OAUT" != "" ]] # see $RDR/.conf/GAUTH file + if [[ -z "${CULR:-}" ]] then - ISAND="$(curl -u "$OAUT" -i "https://api.github.com/repos/$USENAME/$REPO/git/trees/$COMMIT?recursive=1" -s 2>&1 | head -1024)" ||: - else - ISAND="$(curl -i "https://api.github.com/repos/$USENAME/$REPO/git/trees/$COMMIT?recursive=1" -s 2>&1 | head -1024)" ||: - fi - if grep AndroidManifest.xml <<< "$ISAND" - then - _AND_ 0 - _BUILDAPKS_ - else - _NAND_ + if [[ "$OAUT" != "" ]] + then + ISAND="$(curl -s -u "$OAUT" -i "https://api.github.com/repos/$USENAME/$REPO/git/trees/$COMMIT?recursive=1")" ||: + else + ISAND="$(curl -s -i "https://api.github.com/repos/$USENAME/$REPO/git/trees/$COMMIT?recursive=1")" ||: + fi + else + if [[ "$OAUT" != "" ]] + then + ISAND="$(curl --limit-rate "$CULR" -s -u "$OAUT" -i "https://api.github.com/repos/$USENAME/$REPO/git/trees/$COMMIT?recursive=1")" ||: + else + ISAND="$(curl --limit-rate "$CULR" -s -i "https://api.github.com/repos/$USENAME/$REPO/git/trees/$COMMIT?recursive=1")" ||: + fi + fi + if grep AndroidManifest.xml <<< "$ISAND" + then + _AND_ 0 + _BUILDAPKS_ + else + _NAND_ fi fi elif [[ -f "${NAME##*/}.${COMMIT::7}.tar.gz" ]] && [[ ! "${F1AR[@]}" =~ "${NAME##*/}" ]] # tarfile exists and directory does not exist @@ -59,16 +69,16 @@ _BUILDAPKS_ () { # https://developer.github.com/v3/repos/commits/ printf "\\n%s\\n" "Getting $NAME/tarball/$COMMIT -o ${NAME##*/}.${COMMIT::7}.tar.gz:" if [[ -z "${CULR:-}" ]] then - if [[ "$OAUT" != "" ]] # see $RDR/.conf/GAUTH file + if [[ "$OAUT" != "" ]] # see .conf/GAUTH file then curl -u "$OAUT" -L "$NAME/tarball/$COMMIT" -o "${NAME##*/}.${COMMIT::7}.tar.gz" || _SIGNAL_ "40" "_BUILDAPKS_" else curl -L "$NAME/tarball/$COMMIT" -o "${NAME##*/}.${COMMIT::7}.tar.gz" || _SIGNAL_ "42" "_BUILDAPKS_" fi else - if [[ "$OAUT" != "" ]] # see $RDR/.conf/GAUTH file + if [[ "$OAUT" != "" ]] # see .conf/GAUTH file then - curl --limit-rate "$CULR" -u "$OAUT" -L "$NAME/tarball/$COMMIT" -o "${NAME##*/}.${COMMIT::7}.tar.gz" || _SIGNAL_ "40" "_BUILDAPKS_" + curl --limit-rate "$CULR" -u "$OAUT" -L "$NAME/tarball/$COMMIT" -o "${NAME##*/}.${COMMIT::7}.tar.gz" || _SIGNAL_ "40" "_BUILDAPKS_" else curl --limit-rate "$CULR" -L "$NAME/tarball/$COMMIT" -o "${NAME##*/}.${COMMIT::7}.tar.gz" || _SIGNAL_ "42" "_BUILDAPKS_" fi @@ -100,21 +110,21 @@ done } _CUTE_ () { # checks if USENAME is found in GNAMES and if it is an organization or a user - if [[ $(grep -iw "$USENAME" "$RDR/var/db/GNAMES" | awk '{print $2}') == User ]] && [[ -f "$RDR/sources/github/users/$USER/profile" ]] && [[ -f "$RDR/sources/github/users/$USER/repos" ]] + if [[ $(grep -iw "$USENAME" "$RDR/var/db/log/GNAMES" | awk '{print $2}') == User ]] && [[ -f "$RDR/sources/github/users/$USER/profile" ]] && [[ -f "$RDR/sources/github/users/$USER/repos" ]] then export ISUSER=users export ISOTUR=users export USENAME="$(grep -iw "$USENAME" "$RDR/var/db/GNAMES" | awk '{print $1}')" export JDR="$RDR/sources/github/$ISOTUR/$USER" export JID="git.$ISOTUR.$USER" - elif [[ $(grep -iw "$USENAME" "$RDR/var/db/GNAMES" | awk '{print $2}') == Organization ]] && [[ -f "$RDR/sources/github/orgs/$USER/profile" ]] && [[ -f "$RDR/sources/github/orgs/$USER/repos" ]] + elif [[ $(grep -iw "$USENAME" "$RDR/var/db/log/GNAMES" | awk '{print $2}') == Organization ]] && [[ -f "$RDR/sources/github/orgs/$USER/profile" ]] && [[ -f "$RDR/sources/github/orgs/$USER/repos" ]] then export ISUSER=users export ISOTUR=orgs export USENAME="$(grep -iw "$USENAME" "$RDR/var/db/GNAMES" | awk '{print $1}')" export JDR="$RDR/sources/github/$ISOTUR/$USER" export JID="git.$ISOTUR.$USER" - else # get USENAME and type of USENAME from GitHub + else # get login and type of login from GitHub mapfile -t TYPE < <(curl "https://api.github.com/users/$USENAME") if [[ "${TYPE[1]}" == *\"message\":\ \"Not\ Found\"* ]] then @@ -126,8 +136,8 @@ _CUTE_ () { # checks if USENAME is found in GNAMES and if it is an organization _SIGNAL_ "71" "${TYPE[17]} undefined!" "71" exit 34 fi) || (_SIGNAL_ "72" "TYPE[17]: unbound variable" "72") - USENAME="$(printf "%s" "${TYPE[1]}" | sed 's/"//g' | sed 's/,//g' | awk '{print $2}')" || _SIGNAL_ "73" "_CUTE_ \$USENAME" - NAPKS="$(printf "%s" "${TYPE[17]}" | sed 's/"//g' | sed 's/,//g' | awk '{print $2}')" || (_SIGNAL_ "74" "_CUTE_ \$NAPKS: create \$NAPKS failed; Exiting..." 24) + export USENAME="$(printf "%s" "${TYPE[1]}" | sed 's/"//g' | sed 's/,//g' | awk '{print $2}')" || _SIGNAL_ "73" "_CUTE_ \$USENAME" + export NAPKS="$(printf "%s" "${TYPE[17]}" | sed 's/"//g' | sed 's/,//g' | awk '{print $2}')" || (_SIGNAL_ "74" "_CUTE_ \$NAPKS: create \$NAPKS failed; Exiting..." 24) if [[ "${TYPE[17]}" == *User* ]] then export ISUSER=users @@ -144,7 +154,7 @@ _CUTE_ () { # checks if USENAME is found in GNAMES and if it is an organization fi printf "%s\\n" "${TYPE[@]}" > "$JDR"/profile _MKJDC_ - _NAMESMAINBLOCK_ CNAMES + _NAMESMAINBLOCK_ CNAMES GNAMES log/GNAMES fi printf "%s\\n" "Processing $USENAME:" KEYT=("\"login\"" "\"id\"" "\"type\"" "\"name\"" "\"company\"" "\"blog\"" "\"location\"" "\"hireable\"" "\"bio\"" "\"public_repos\"" "\"public_gists\"" "\"followers\"" "\"following\"" "\"created_at\"" ) @@ -154,20 +164,20 @@ _CUTE_ () { # checks if USENAME is found in GNAMES and if it is an organization done _WAKELOCK_ . "$RDR"/scripts/bash/shlibs/buildAPKs/bnchn.bash bch.st - RCT="$(grep public_repos "$JDR/profile" | sed 's/\,//g' | sed 's/\"//g' | awk '{print $2}')" - RPCT="$(($RCT/100))" + RCT="$(grep public_repos "$JDR/profile" | sed 's/\,//g' | sed 's/\"//g' | awk '{print $2}')" # repository count + RPCT="$(($RCT/100))" # repository page count if [[ $(($RCT%100)) -gt 0 ]] # there is a remainder - then # add one more page + then # add one more page to total reqest RPCT="$(($RPCT+1))" fi - if [[ ! -f "$JDR/repos" ]] - then - until [[ $RPCT -eq 0 ]] - do + if [[ ! -f "$JDR/repos" ]] # file repos does not exist + then # get repository information + until [[ $RPCT -eq 0 ]] # there are zero pages remaining + do # get a page of repository information printf "%s\\n" "Downloading GitHub $USENAME page $RPCT repositories information: " - if [[ -z "${CULR:-}" ]] + if [[ -z "${CULR:-}" ]] # curl --limit-rate is not set then - if [[ "$OAUT" != "" ]] # see $RDR/.conf/GAUTH file for information + if [[ "$OAUT" != "" ]] # see .conf/GAUTH file for information then curl -u "$OAUT" "https://api.github.com/$ISUSER/$USER/repos?per_page=100&page=$RPCT" > "$JDR/var/conf/repos.tmp" cat "$JDR/var/conf/repos.tmp" >> "$JDR/repos" @@ -176,7 +186,7 @@ _CUTE_ () { # checks if USENAME is found in GNAMES and if it is an organization cat "$JDR/var/conf/repos.tmp" >> "$JDR/repos" fi else - if [[ "$OAUT" != "" ]] # see $RDR/.conf/GAUTH file for information + if [[ "$OAUT" != "" ]] then curl --limit-rate "$CULR" -u "$OAUT" "https://api.github.com/$ISUSER/$USER/repos?per_page=100&page=$RPCT" > "$JDR/var/conf/repos.tmp" cat "$JDR/var/conf/repos.tmp" >> "$JDR/repos" @@ -205,7 +215,7 @@ _FJDX_ () { } _GC_ () { - if [[ "$OAUT" != "" ]] # see $RDR/.conf/GAUTH file for information + if [[ "$OAUT" != "" ]] # see .conf/GAUTH file for information then # https://unix.stackexchange.com/questions/117992/download-only-first-few-bytes-of-a-source-page curl -u "$OAUT" https://api.github.com/repos/"$USER/$REPO"/commits -s 2>&1 | head -n 3 | tail -n 1 | awk '{ print $2 }' | sed 's/"//g' | sed 's/,//g' else diff --git a/scripts/bash/build/build.github.topics.bash b/scripts/bash/build/build.github.topics.bash index 45d719c8e..352310a7c 100755 --- a/scripts/bash/build/build.github.topics.bash +++ b/scripts/bash/build/build.github.topics.bash @@ -24,27 +24,62 @@ export TOPNAME="${TOPIC,,}" export JDR="$RDR/sources/github/topics/$TOPIC" export JID="git.$TOPIC" export OAUT="$(cat "$RDR/.conf/GAUTH" | awk 'NR==1')" +echo $OAUT export RDR="$HOME/buildAPKs" export STRING="ERROR FOUND; build.github.topics.bash $1: CONTINUING... " -printf "\\n\\e[1;38;5;116m%s\\n\\e[0m" "${0##*/}: Beginning BuildAPKs with build.github.topics.bash $1:" +_RPCT_() { + RCT="$(sed 's/\,//g' <<< "${THD[1]##*:}")" + RPCT="$(($RCT/100))" # repository page count + if [[ $(($RCT%100)) -gt 0 ]] # there is a remainder + then # add one more page to total requested + export RPCT="$(($RPCT+1))" + fi + printf "%s\\n" "Found $RPCT pages of results." + if [[ $RPCT -gt 10 ]] # greater than 1000 search results + then # enforce https://developer.github.com/v3/search/ limit + printf "%s\\n" "Limiting to 10 pages of results." + export RPCT=10 + fi +} +printf "\\n\\e[1;38;5;116m%s\\n\\e[0m" "${0##*/}: Beginning BuildAPKs with build.github.topics.bash $@:" if [[ ! -d "$JDR" ]] then mkdir -p "$JDR" fi if [[ ! -f "$JDR"/topic ]] then - printf "%s\\n" "Downloading GitHub $TOPNAME topic repositories information:" - if [[ "$OAUT" != "" ]] # see $RDR/var/conf/GAUTH file for information - then - curl -u "$OAUT" -H "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/search/repositories?q=topic:$TOPIC+language:Java" -o "$JDR"/topic + if [[ ! -z "$OAUT" ]] # see .conf/GAUTH file for information + then # use https://github.com/settings/tokens to create tokens + mapfile -t THD < <(curl -u "$OAUT" -sH "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/search/repositories?q=topic:$TOPIC+language:Java" | head -n 2 ) # total count + RCT="$(sed 's/\,//g' <<< "${THD[1]##*:}")" + _RPCT_ + until [[ $RPCT -eq 0 ]] # there are zero pages remaining + do # get a page of repository information + printf "%s\\n" "Downloading GitHub $TOPNAME page $RPCT topic repositories information: " + curl -u "$OAUT" -H "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/search/repositories?per_page=100&page=$RPCT&q=topic:$TOPIC+language:Java&sort=forks&order=desc" > "$JDR/topic.tmp" + cat "$JDR/topic.tmp" >> "$JDR/topic" + RPCT="$(($RPCT-1))" + sleep "0.${RANDOM::3}" + done else - curl -H "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/search/repositories?q=topic:$TOPIC+language:Java" -o "$JDR"/topic + mapfile -t THD < <(curl -sH "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/search/repositories?q=topic:$TOPIC+language:Java" | head -n 2 ) # total count + RCT="$(sed 's/\,//g' <<< "${THD[1]##*:}")" + _RPCT_ + until [[ $RPCT -eq 0 ]] # there are zero pages remaining + do # get a page of repository information + printf "%s\\n" "Downloading GitHub $TOPNAME page $RPCT topic repositories information: " + curl -H "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/search/repositories?per_page=100&page=$RPCT&q=topic:$TOPIC+language:Java&sort=stars&order=desc" > "$JDR/topic.tmp" + cat "$JDR/topic.tmp" >> "$JDR/topic" + RPCT="$(($RPCT-1))" + sleep "0.${RANDOM::3}" + done fi + rm -f "$JDR/topic.tmp" fi TARR=($(grep -v JavaScript "$JDR"/topic | grep -B 5 Java | grep svn_url | awk -v x=2 '{print $x}' | sed 's/\,//g' | sed 's/\"//g' | sed 's/https\:\/\/github.com\///g' | cut -d\/ -f1)) # creates array of Java language repositories for topic for NAME in "${TARR[@]}" do - "$RDR"/scripts/bash/build/build.github.bash "$NAME" + "$RDR"/scripts/bash/build/build.github.bash "$NAME" done . "$RDR"/scripts/bash/shlibs/lock.bash wake.stop . "$RDR"/scripts/bash/shlibs/buildAPKs/bnchn.bash bch.gt diff --git a/scripts/bash/build/build.github.topics30.bash b/scripts/bash/build/build.github.topics30.bash new file mode 100755 index 000000000..45d719c8e --- /dev/null +++ b/scripts/bash/build/build.github.topics30.bash @@ -0,0 +1,51 @@ +#!/bin/env bash +# Copyright 2019 (c) all rights reserved +# by BuildAPKs https://buildapks.github.io/buildAPKs/ +##################################################################### +set -Eeuo pipefail +shopt -s nullglob globstar +export RDR="$HOME/buildAPKs" +. "$RDR"/scripts/bash/init/ushlibs.bash +. "$RDR"/scripts/bash/shlibs/trap.bash 77 78 79 "${0##*/}" +if [[ -z "${1:-}" ]] +then + printf "\\e[1;7;38;5;203m%s\\e[1;7;38;5;201m%s\\e[1;7;38;5;203m%s\\e[1;7;38;5;201m%s\\e[1;7;38;5;203m%s\\e[1;7;38;5;201m%s\\e[1;7;38;5;203m%s\\n\\e[0m\\n" "GitHub topic name must be provided; See " "~/${RDR##*/}/var/conf/TNAMES" " for topic names that build APKs on device with BuildAPKs! To build all the topic names contained in this file run " "for NAME in \$(cat ~/${RDR##*/}/var/conf/TNAMES) ; do ~/${RDR##*/}/scripts/bash/build/${0##*/} \$NAME ; done" ". File " "~/${RDR##*/}/var/conf/GAUTH" " has important information should you choose to run this command regarding bandwidth supplied by GitHub. " + exit 4 +fi +if [[ -z "${NUM:-}" ]] +then + export NUM="$(date +%s)" +fi +. "$RDR"/scripts/bash/shlibs/lock.bash wake.lock +. "$RDR"/scripts/bash/shlibs/buildAPKs/bnchn.bash bch.st +export TOPI="${1%/}" +export TOPIC="${TOPI##*/}" +export TOPNAME="${TOPIC,,}" +export JDR="$RDR/sources/github/topics/$TOPIC" +export JID="git.$TOPIC" +export OAUT="$(cat "$RDR/.conf/GAUTH" | awk 'NR==1')" +export RDR="$HOME/buildAPKs" +export STRING="ERROR FOUND; build.github.topics.bash $1: CONTINUING... " +printf "\\n\\e[1;38;5;116m%s\\n\\e[0m" "${0##*/}: Beginning BuildAPKs with build.github.topics.bash $1:" +if [[ ! -d "$JDR" ]] +then + mkdir -p "$JDR" +fi +if [[ ! -f "$JDR"/topic ]] +then + printf "%s\\n" "Downloading GitHub $TOPNAME topic repositories information:" + if [[ "$OAUT" != "" ]] # see $RDR/var/conf/GAUTH file for information + then + curl -u "$OAUT" -H "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/search/repositories?q=topic:$TOPIC+language:Java" -o "$JDR"/topic + else + curl -H "Accept: application/vnd.github.mercy-preview+json" "https://api.github.com/search/repositories?q=topic:$TOPIC+language:Java" -o "$JDR"/topic + fi +fi +TARR=($(grep -v JavaScript "$JDR"/topic | grep -B 5 Java | grep svn_url | awk -v x=2 '{print $x}' | sed 's/\,//g' | sed 's/\"//g' | sed 's/https\:\/\/github.com\///g' | cut -d\/ -f1)) # creates array of Java language repositories for topic +for NAME in "${TARR[@]}" +do + "$RDR"/scripts/bash/build/build.github.bash "$NAME" +done +. "$RDR"/scripts/bash/shlibs/lock.bash wake.stop +. "$RDR"/scripts/bash/shlibs/buildAPKs/bnchn.bash bch.gt +# build.github.topics.bash EOF diff --git a/scripts/bash/build/build.in.dir.bash b/scripts/bash/build/build.in.dir.bash index 9963c13b0..6372171d7 100755 --- a/scripts/bash/build/build.in.dir.bash +++ b/scripts/bash/build/build.in.dir.bash @@ -4,54 +4,20 @@ ##################################################################### set -Eeuo pipefail shopt -s nullglob globstar - -_SBDBTRPERROR_() { # Run on script error. - local RV="$?" - printf "\\e[?25h\\e[1;7;38;5;0mbuildAPKs %s ERROR: Signal %s received!\\e[0m\\n" "${0##*/}" "$RV" - set +Eeuo pipefail - exit 201 -} - -_SBDBTRPEXIT_() { # Run on exit. - printf "\\e[?25h\\e[0m" - set +Eeuo pipefail - exit -} - -_SBDBTRPSIGNAL_() { # Run on signal. - local RV="$?" - printf "\\e[?25h\\e[1;7;38;5;0mbuildAPKs %s WARNING: Signal %s received!\\e[0m\\n" "${0##*/}" "$RV" - printf "\\e[?25h\\e[0m" - set +Eeuo pipefail - exit 211 -} - -_SBDBTRPQUIT_() { # Run on quit. - local RV="$?" - printf "\\e[?25h\\e[1;7;38;5;0mbuildAPKs %s WARNING: Quit signal %s received!\\e[0m\\n" "${0##*/}" "$RV" - exit 221 -} - -trap '_SBDBTRPERROR_ $LINENO $BASH_COMMAND $?' ERR -trap _SBDBTRPEXIT_ EXIT -trap _SBDBTRPSIGNAL_ HUP INT TERM -trap _SBDBTRPQUIT_ QUIT - -export DAY="$(date +%Y%m%d)" -export JAD="" -export JID="in.dir.${PWD##*/}" -export NUM="$(date +%s)" +export JDR="$PWD" export RDR="$HOME/buildAPKs" -if [[ "$HOME" = "$PWD" ]] +if [[ "$HOME" = "$JDR" ]] then printf "\\n\\e[1;7;38;5;0mbuildAPKs %s WARNING: Cannot run in %s! Signal 224 generated by %s in %s.\\e[0m\\n\\n" "${0##*/}" "$HOME" "${0##*/}" "$PWD" exit 224 fi -JDR="$PWD" -. "$RDR"/scripts/bash/init/ushlibs.bash -. "$RDR"/scripts/bash/shlibs/lock.bash +export DAY="$(date +%Y%m%d)" +export JID="in.dir.${JDR##*/}" +export NUM="$(date +%s)" +. "$RDR"/scripts/bash/init/ushlibs.bash +. "$RDR"/scripts/bash/shlibs/trap.bash 201 211 221 "${0##*/}" wake.start . "$RDR"/scripts/bash/shlibs/buildAPKs/bnchn.bash bch.st . "$RDR"/scripts/bash/shlibs/buildAPKs/fandm.bash -_ANDB_ "$JDR" +_ANDB_ . "$RDR"/scripts/bash/shlibs/buildAPKs/bnchn.bash bch.gt # build.in.dir.bash EOF diff --git a/scripts/bash/build/build.one.bash b/scripts/bash/build/build.one.bash index 0f1973764..9aa2dc55f 100755 --- a/scripts/bash/build/build.one.bash +++ b/scripts/bash/build/build.one.bash @@ -21,10 +21,9 @@ _SBOTRPEXIT_() { # run on exit local RV="$?" if [[ "$RV" != 0 ]] then - printf "\\e[?25h\\e[1;7;38;5;0mbuildAPKs signal %s received by %s in %s by build.one.bash. More information in \`%s/var/log/stnderr.%s.log\` file.\\e[0m\\n\\n" "$RV" "${0##*/}" "$PWD" "$RDR" "$JID" - echo "Running: tail -n 16 $RDR/var/log/stnderr.$JID.log" - echo - tail -n 16 "$RDR/var/log/stnderr.$JID.log" + printf "\\e[?25h\\e[1;7;38;5;0mbuildAPKs signal %s received by %s in %s by build.one.bash. More information in \`%s/var/log/stnderr.%s.log\` file.\\n\\n" "$RV" "${0##*/}" "$PWD" "$RDR" "$JID" + printf "%s\\n" "Running: grep -iC 4 ERROR $RDR/var/log/stnderr.$JID.log | tail " + grep -iC 4 ERROR "$RDR/var/log/stnderr.$JID.log" | tail printf "\\e[0m\\n\\n" fi if [[ "$RV" = 220 ]] @@ -73,24 +72,13 @@ _CLEANUP_ () { printf "\\e[1;38;5;151mCompleted tasks in %s\\n\\n\\e[0m" "$PWD" } -MSDKVERSIO="$(getprop ro.build.version.min_supported_target_sdk)" -MSDKVERSION="${MSDKVERSIO:-14}" -TSDKVERSIO="$(getprop ro.build.version.sdk)" -TSDKVERSION="${TSDKVERSIO:-23}" -sed -i "s/minSdkVersion\=\"[0-9]\"/minSdkVersion\=\"$MSDKVERSION\"/g" AndroidManifest.xml -sed -i "s/minSdkVersion\=\"[0-9][0-9]\"/minSdkVersion\=\"$MSDKVERSION\"/g" AndroidManifest.xml -sed -i "s/targetSdkVersion\=\"[0-9]\"/targetSdkVersion\=\"$TSDKVERSION\"/g" AndroidManifest.xml -sed -i "s/targetSdkVersion\=\"[0-9][0-9]\"/targetSdkVersion\=\"$TSDKVERSION\"/g" AndroidManifest.xml -NOW=$(date +%s) -PKGNAM="$(grep -o "package=.*" AndroidManifest.xml | cut -d\" -f2)" -PKGNAME="$PKGNAM.$NOW" if [[ -z "${DAY:-}" ]] then - DAY="$(date +%Y%m%d)" + DAY="$(date +%Y.%m.%d)" fi if [[ -z "${RDR:-}" ]] then - RDR="${PWD##*/}" # https://stackoverflow.com/questions/1371261/get-current-directory-name-without-full-path-in-a-bash-script + RDR="$HOME/buildAPKs" fi if [[ -z "${2:-}" ]] then @@ -130,7 +118,18 @@ if [[ ! -d "./res" ]] then mkdir -p ./res fi -sleep 0.1 +sleep 0.01 +MSDKVERSIO="$(getprop ro.build.version.min_supported_target_sdk)" +MSDKVERSION="${MSDKVERSIO:-14}" +TSDKVERSIO="$(getprop ro.build.version.sdk)" +TSDKVERSION="${TSDKVERSIO:-23}" +sed -i "s/minSdkVersion\=\"[0-9]\"/minSdkVersion\=\"$MSDKVERSION\"/g" AndroidManifest.xml +sed -i "s/minSdkVersion\=\"[0-9][0-9]\"/minSdkVersion\=\"$MSDKVERSION\"/g" AndroidManifest.xml +sed -i "s/targetSdkVersion\=\"[0-9]\"/targetSdkVersion\=\"$TSDKVERSION\"/g" AndroidManifest.xml +sed -i "s/targetSdkVersion\=\"[0-9][0-9]\"/targetSdkVersion\=\"$TSDKVERSION\"/g" AndroidManifest.xml +NOW=$(date +%s) +PKGNAM="$(grep -o "package=.*" AndroidManifest.xml | cut -d\" -f2)" +PKGNAME="$PKGNAM.$NOW" printf "\\e[1;38;5;115m%s\\n\\e[0m" "aapt: started..." aapt package -f \ -M AndroidManifest.xml \ @@ -158,30 +157,30 @@ if [[ -w "/storage/emulated/0/" ]] || [[ -w "/storage/emulated/legacy/" ]] then if [[ -w "/storage/emulated/0/" ]] then - if [[ ! -d "/storage/emulated/0/Download/builtAPKs/$JID$DAY" ]] + if [[ ! -d "/storage/emulated/0/Download/builtAPKs/$JID.$DAY" ]] then - mkdir -p "/storage/emulated/0/Download/builtAPKs/$JID$DAY" + mkdir -p "/storage/emulated/0/Download/builtAPKs/$JID.$DAY" fi - cp "$PKGNAM.apk" "/storage/emulated/0/Download/builtAPKs/$JID$DAY/$PKGNAME.apk" + cp "$PKGNAM.apk" "/storage/emulated/0/Download/builtAPKs/$JID.$DAY/$PKGNAME.apk" fi if [[ -w "/storage/emulated/legacy/" ]] then - if [[ ! -d "/storage/emulated/legacy/Download/builtAPKs/$JID$DAY" ]] + if [[ ! -d "/storage/emulated/legacy/Download/builtAPKs/$JID.$DAY" ]] then - mkdir -p "/storage/emulated/legacy/Download/builtAPKs/$JID$DAY" + mkdir -p "/storage/emulated/legacy/Download/builtAPKs/$JID.$DAY" fi - cp "$PKGNAM.apk" "/storage/emulated/legacy/Download/builtAPKs/$JID$DAY/$PKGNAME.apk" + cp "$PKGNAM.apk" "/storage/emulated/legacy/Download/builtAPKs/$JID.$DAY/$PKGNAME.apk" fi - printf "\\e[1;38;5;115mCopied %s to Download/builtAPKs/%s/%s.apk\\n" "$PKGNAM.apk" "$JID$DAY" "$PKGNAME" - printf "\\e[1;38;5;149mThe APK %s file can be installed from Download/builtAPKs/%s/%s.apk\\n" "$PKGNAM.apk" "$JID$DAY" "$PKGNAME" + printf "\\e[1;38;5;115mCopied %s to Download/builtAPKs/%s/%s.apk\\n" "$PKGNAM.apk" "$JID.$DAY" "$PKGNAME" + printf "\\e[1;38;5;149mThe APK %s file can be installed from Download/builtAPKs/%s/%s.apk\\n" "$PKGNAM.apk" "$JID.$DAY" "$PKGNAME" else - if [[ ! -d "$RDR/var/cache/builtAPKs/$JID$DAY" ]] + if [[ ! -d "$RDR/var/cache/builtAPKs/$JID.$DAY" ]] then - mkdir -p "$RDR/var/cache/builtAPKs/$JID$DAY" + mkdir -p "$RDR/var/cache/builtAPKs/$JID.$DAY" fi - cp "$PKGNAM.apk" "$RDR/var/cache/builtAPKs/$JID$DAY/$PKGNAME.apk" - printf "\\e[1;38;5;120mCopied %s to $RDR/var/cache/builtAPKs/%s/%s.apk\\n" "$PKGNAM.apk" "$JID$DAY" "$PKGNAME" - printf "\\e[1;38;5;154mThe APK %s file can be installed from ~/${RDR:33}/var/cache/builtAPKs/%s/%s.apk\\n" "$PKGNAM.apk" "$JID$DAY" "$PKGNAME" + cp "$PKGNAM.apk" "$RDR/var/cache/builtAPKs/$JID.$DAY/$PKGNAME.apk" + printf "\\e[1;38;5;120mCopied %s to $RDR/var/cache/builtAPKs/%s/%s.apk\\n" "$PKGNAM.apk" "$JID.$DAY" "$PKGNAME" + printf "\\e[1;38;5;154mThe APK %s file can be installed from ~/${RDR:33}/var/cache/builtAPKs/%s/%s.apk\\n" "$PKGNAM.apk" "$JID.$DAY" "$PKGNAME" fi printf "\\e[?25h\\e[1;7;38;5;34mShare %s everwhere%s!\\e[0m\\n" "https://wiki.termux.com/wiki/Development" "🌎🌍🌏🌐" # build.one.bash EOF diff --git a/sha512.sum b/sha512.sum index 76586e6a0..831374c60 100644 --- a/sha512.sum +++ b/sha512.sum @@ -1,22 +1,23 @@ 7f4656bffcd3b83aa9b7dff485725d4eccee7f4fc5499157acdb968ae68f0b2d7b41f030fef38207b522d6a404cdd03925da86c0dd28b796301d0e3a31f45d72 ./.conf/GAUTH -4799a0fb6524f2eaab8af0c206a86b117d354b866018653b5c0e9e639cfe2f0b05af7517c75712bcc5fca90d5a6e990b167102cd9bf22c1cce7a9f1a5aac05bb ./.conf/VERSIONID +4df6994810381647c07ada7887114b372ab90e7fa91d9bfab58a5b19af4efbce4aaed2b9a1400ad410c0d5d08b02560b17f9d2a6ef70f3be3f057a02f43cb109 ./.conf/VERSIONID 6f7d3b0b849fbe3d5251c75c11e2fb39eae5059984895dfb64467a50c67bd7f75cf897cdf85a2d7a3471e14bc1d627295cb6b49300a9161c90b93e4d197157ae ./CHANGE.log ae7e3bf1dbc9739b31c7d47d0664361d9df21fe3bd0d06bff52f2ecad228dc45ba25536f9a866df743fbd7074d116fbdfac199c1342ab2a1270a735d7877ef05 ./LICENSE 2397dd0bd74a24851dbfa2110a2d141ef61ebebd9df8ee13efe90ec26dfb5b3959d49c767e3228d1eeef5e348246ace5a47946e4335fa97db7b63ec32f366516 ./README.md 45ec48d103591cb2ffb38f80fc60e584b68526005f73d667d010aa222b4a65e4a4960d3631d0603dbcdd932f2b198242169608cae4d753d2ecfe781aa84d78cf ./scripts/bash/build/build.apps.bash e68097ffae2bbd350230ae4fd43efc5599e4d22a3b93a801df79ef982bb5e6b203c25d79e9e734df2fd9cc125d3e5c6353966ec5dfffcd98acb4e861b306a6b6 ./scripts/bash/build/build.buildAPKs.bash -6a2fd360edd5c4865a2a0a2960be61e25ebcfb6b888eb42777d530ef0721185d9e4f7845e8bfb4bfdc367a50c0475f8920604ae03b5ad2f35371c6345678414f ./scripts/bash/build/build.buildAPKs.modules.bash +680e72176c3dee8d3ef0672b7884a03d29545170feb415ca2b3fb89d72aac240be2ae8362f31e978b2569f6350283d23507fbd7fa3746a2811a93dbb0562a87c ./scripts/bash/build/build.buildAPKs.modules.bash 7edd6a2d5c8fbde941e672440a092a49b71bc8127548047b2012a10d2b1414d4a9035708a283081e9494d9dde4ad50d16be2ab4a4f34c523c4ab6930c47f133f ./scripts/bash/build/build.clocks.bash 41852477198548380652c9f23e12daf0c7ea50f374298056a753c33531315a3e463b9c3bea151dd5df82b19f025d3ca86543fd0ba45a578e7903837722fd7836 ./scripts/bash/build/build.compasses.bash 89198d9b297658314f17f398b6682b29e1c98a7ce28ddc029812d69fb51646b1f10421c46e0103c12e7971f9e785affbc82512a3685aa75f129e0eb1b87e03a0 ./scripts/bash/build/build.developers.tools.bash 4f43336cd06661153223f38424761cd65910f4cc39977efebea2a852d1a4d17557e976491f650956d09b55357438990613d89df781d91c0c0489b0be27c76646 ./scripts/bash/build/build.entertainment.bash e6b03f34396238f632e0240f366388901ed345eb05fa9d26f306d5e8d534c2dabb4f90cf3685a4a69b3a034e120fea4e9f66ce33ae27e4c0ea41bdc2773d1ac7 ./scripts/bash/build/build.flashlights.bash c0de05c39a085edbf8ccb5a9280e695928dd27c93b0c56d8c6345d70ac4a80e747bf9cf640c378c96b5c0e8ec420e1a3890bff864f5b975c2ab5966341ef0d57 ./scripts/bash/build/build.games.bash -6d3cd3ff7e5bc952e8ef53b245edf363a709383885d90f21f673f94e929db0e5ba8c6d6fc61df05aa3427cb99530467e2b86dd31d36fc4a909f2a397445fc650 ./scripts/bash/build/build.github.bash -174a4df881d6135e2d9dc2f9947e27be0ae1ffa0eb2827bd08907376b01decea2f697c43348021a5978aa97107897b52d3213746d381972c2e7f2aa6cb91fb99 ./scripts/bash/build/build.github.topics.bash -cb4e9ab1c928fac4dad7d2b70fb18ddd3ec9bbc465189ad044c4b2b26fd19c0727b70bfb55a0a1da5eaa3fd991cbde2d8677510f084ac941684d34b6e2ee54a5 ./scripts/bash/build/build.in.dir.bash +d3ced1afda17ba9e7939a3a85e45fbc1156023d4902667c4663601250e98ae5edae8338157761c6399cd6daede3a134a055a6a67592929afb3151f2d21e7f1c9 ./scripts/bash/build/build.github.bash +38d62740cd56a005368b57bd1a78704c9a72e87d9bc0abfa63893759c0797882a6f22ba522a2747364a2ba478aaa8217fff0136f772539a18134808f66c85541 ./scripts/bash/build/build.github.topics.bash +174a4df881d6135e2d9dc2f9947e27be0ae1ffa0eb2827bd08907376b01decea2f697c43348021a5978aa97107897b52d3213746d381972c2e7f2aa6cb91fb99 ./scripts/bash/build/build.github.topics30.bash +2968bc3ed2fc6b4624481e32b15c4ef8420f2924bc27fe435e3d29064303e5e3bdb3e60824a9bbc7de7d6c103d04f9767bb21bcff99e1a763f1d17eb976ea23d ./scripts/bash/build/build.in.dir.bash cf5a2db9cd03d82fbb98747dec2ae3fd552ff572160af6d2dcf073531cc2f2af1c2656610ac0a9528772cf31f8b57670d373ea2f51c4e514b373a51b61dffcae ./scripts/bash/build/build.live.wallpapers.bash -05b28d38bea08a9e826f92b5d4a93ddb626bf0015f3aefe7f28751f6030f9b768f984f40d01f38fc3a7ce33aafb2685a3769cb25bb324222e577d2070706c0be ./scripts/bash/build/build.one.bash +50c2140f109bdd9b76d4583ce921338509744f523af64b9385fc5501017a825f7d4bfb23fba0e41b840a5fffd3a5ec6a0bfb1a1fe979356bc2b5a3832aa9b42b ./scripts/bash/build/build.one.bash be91cdb6f35fcb7873b983e81cf9aae17dbe3d79e82dfb63d38d759764cb609820d811a71ab28a0d3a3e9d3c70fe6ec2f110456ecd563abb24868d024f84bf11 ./scripts/bash/build/build.samples.bash 14bbe419616cb5c0badefe826386135a8444a5ffc771249ef134a42971eb3cfe749730a26ffc9cabaa03281ba006f9729a747f5470924b0155a7c6c2867f2e93 ./scripts/bash/build/buildAll.bash 76beaf846f73af6563f594ad548dee629674ac85cec758cef624f5ba66683bee73b88a14f6bc9badc6886c5653164fe6ffe4478ef01308f00e7d9a8c9e4f8868 ./scripts/bash/build/buildApplications.bash