lv_api_do now contained within qq2clone as a base64 encoded tgz archive

This commit is contained in:
Jesse Gardner 2021-07-15 16:53:06 -07:00
parent 28333b7e30
commit d73f28ee4b
4 changed files with 4034 additions and 701 deletions

View File

@ -2,8 +2,7 @@
# Generate all files that need to be generated # Generate all files that need to be generated
declare -a arc_files=( qq2clone lv_api_do qq2clone.1 declare -a inst_arc_files=( qq2clone qq2clone.1 qq2clone_completion.bash )
qq2clone_completion.bash )
declare -a req_files=( "${arc_files[@]}" inst_fragment.bash "lv_api_do.c" declare -a req_files=( "${arc_files[@]}" inst_fragment.bash "lv_api_do.c"
man.pandoc ) man.pandoc )
@ -24,6 +23,18 @@ done
echo "Compiling lv_api_do" echo "Compiling lv_api_do"
gcc lv_api_do.c -o lv_api_do -lvirt gcc lv_api_do.c -o lv_api_do -lvirt
# Generate qq2clone
echo "Generating qq2clone"
while IFS= read -r line; do
if [[ "$line" == "#REPLACE WITH ARCHIVE#" ]]; then
echo "archive='"
tar -cz lv_api_do | base64
echo "'"
else
echo "$line"
fi
done < qq2clone_noarchive > qq2clone
# Generate installer # Generate installer
echo "Generating installer script" echo "Generating installer script"
@ -33,7 +44,7 @@ echo "Generating installer script"
echo "# This script generated automatically by gen_installer.bash" echo "# This script generated automatically by gen_installer.bash"
echo echo
echo "archive='" echo "archive='"
tar -cz "${arc_files[@]}" | base64 tar -cz "${inst_arc_files[@]}" | base64
echo "'" echo "'"
echo echo
cat inst_fragment.bash cat inst_fragment.bash

129
qq2clone
View File

@ -137,6 +137,20 @@ return 0
# closing lv_api_do into something that must be managed manually by the # closing lv_api_do into something that must be managed manually by the
# coder # coder
#=========================================================================#
lv_api_do_check ()
# DESCRIPTION: See if lv_api_do is present in the expected location. If
# not, put it there
# INPUT: None
# OUTPUT: None
# PARAMETERS: None
#=========================================================================#
{
local loc="/run/user/${UID}"
[[ -e "${loc}/lv_api_do" ]] && return
cd "$loc"
echo "$archive" | base64 -d | tar -zx
}
#=========================================================================# #=========================================================================#
lv_api_do_close () lv_api_do_close ()
# DESCRIPTION: Tell lv_api_do to exit and close the extra pipe # DESCRIPTION: Tell lv_api_do to exit and close the extra pipe
@ -195,7 +209,7 @@ declare -g lv_api_temp;
lv_api_temp="$(mktemp -d )" || temp_error lv_api_temp="$(mktemp -d )" || temp_error
mkfifo "${lv_api_temp}/lv_api_do_fifo" || fifo_error mkfifo "${lv_api_temp}/lv_api_do_fifo" || fifo_error
exec 4<>"${lv_api_temp}/lv_api_do_fifo" exec 4<>"${lv_api_temp}/lv_api_do_fifo"
"${QQ2_DIR}/lv_api_do" <&4 >&3 2>/dev/null & "/run/user/${UID}/lv_api_do" <&4 >&3 2>/dev/null &
local check local check
read -r check <&3 read -r check <&3
@ -438,10 +452,6 @@ read -r check \
{ echo "Is the database corrupt? No CONFIG table!"; { echo "Is the database corrupt? No CONFIG table!";
exit "$E_unexpected"; } >&2 exit "$E_unexpected"; } >&2
chmod +x "${QQ2_DIR}/lv_api_do" &>/dev/null ||
{ echo "lv_api_do is missing from $QQ2_DIR, or has bad permissions";
exit "$E_permission"; } >&2
declare -gA OPT declare -gA OPT
declare -a opts declare -a opts
local elem local elem
@ -3137,6 +3147,114 @@ echo "$str"
return 0 return 0
} }
#-------------#
#@@@@@@@@@@@@@#
#---ARCHIVE---#
#@@@@@@@@@@@@@#
#-------------#
# This section contains a base64 encoded archive added in with
# gen_all.bash. The last remaining section containing Bash scripting is
# ENTRY POINT, at the bottom of this file
archive='
H4sIAAAAAAAAA+1cC3Bb1Zk+kvyQHUe28wAnBCIgYQ2JFTmx8wBcLNty5MWPkMSQFoKsWLKtRg8j
3RscFheDCVvV8W7Y0paZbaewwxa27S6BKZ2w3S0OARJmA5NQlmYHOpgAs3LNgqFx4hDb2v+8rs49
0g20s53d7vhkov/+3/845/znce899xyH9nh9vUGvP4r+eMkJacOGakwrN1Q7RQqpqmqt04kqq5wb
qiqrqp3rAa+s3FC1Admdf8QyaUmNK76Y3Y6+HojHAxfR+yL5n2i6z93caDaZNN6CvoIwN7qA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J3kXoP8Zfvb4P/ZVCrK7fl6Cqd8nYcvm8jl9yG61sjt+boLp4eYgJ8H5PZ8XTCI
9Gfe+foMp3w9kyc5/nchulbI1fg6DqfXS+WX/nwC+gaia49a+a16egCly29GmfUfRjSm3J6vC3HK
10Pl+PH6f4/Z1zGerx9xytdj85iNbP84Ev82AMr4uxbyiojc/t+X7Pl6FKcdUsDlP5/xpGTP1604
lZe3ZPuDkj1f3+J0yxfk/7xkz9/fOXWLhzWzlOcFyZ6/z3M6X9KX4/cy0s8f2oBjdIFB+Xl6TbI3
+nsYRvm/LdnzdTpOH5PGj9x/P0T0GZ4vl2rnlSuy61sl+imi51i1P2PC7Eu+pP0MorHXvkfwv3fC
7JEwf4h2PI4/QbT+8veMMraAk/yC/PNMenvtvdWpz0e256mIfcDQ6s/sS5h9uaQv+ytl+cvr6dz+
OgnP9l1KamKSapm9nc0jeBnGgTLnjwKh7GLqYBPnTdJmHnn+LTWw/yFrh6WSgWw/l+bSXJpLc+l/
J/030Ir0wABQAAA=
'
#-----------------# #-----------------#
#@@@@@@@@@@@@@@@@@# #@@@@@@@@@@@@@@@@@#
#---ENTRY POINT---# #---ENTRY POINT---#
@ -3148,6 +3266,7 @@ if ! ((QQ2_NOEXECUTE)); then
#Ensure needed fds are not in use #Ensure needed fds are not in use
exec 3>&- 3<&- 4>&- 4<&-; exec 3>&- 3<&- 4>&- 4<&-;
lv_api_do_check
open_pipe open_pipe
if [[ -n "$QQ2_DIR" ]]; then if [[ -n "$QQ2_DIR" ]]; then
: # If already set, use existing value : # If already set, use existing value

File diff suppressed because it is too large Load Diff

3186
qq2clone_noarchive Executable file

File diff suppressed because it is too large Load Diff