check_depends is now called on every run of qq2clone

This commit is contained in:
Jesse Gardner 2021-07-15 17:08:15 -07:00
parent d73f28ee4b
commit b6ad8a6351
3 changed files with 827 additions and 827 deletions

212
qq2clone
View File

@ -258,8 +258,7 @@ return 0
} }
#=========================================================================# #=========================================================================#
check_depends () check_depends ()
# DESCRIPTION: Check that required software is present during initial auto- # DESCRIPTION: Check that required software is present
# configuration
# INPUT: None # INPUT: None
# OUTPUT: Return 0 on success or exits with descriptive message on failure # OUTPUT: Return 0 on success or exits with descriptive message on failure
# PARAMETERS: None # PARAMETERS: None
@ -271,12 +270,13 @@ local elem missing=0
local -a depends=( virsh virt-clone virt-xml virt-xml-validate qemu-img \ local -a depends=( virsh virt-clone virt-xml virt-xml-validate qemu-img \
xmllint sqlite3) xmllint sqlite3)
# These are from gnu-coreutils, util-linux, or are simply extremely common # These are virtually certain to be present. But if one is actually missing
# and almost certainly present. However, checking for any external # or something weird is going on that prevents the script from seeing it,
#command invoked is harmless and may even help 1/10000 times # we'll catch it here and avoid executing code that won't work
depends=( "${depends[@]}" basename chmod date dirname file grep less ls \
md5sum mkfifo mkdir mktemp mv rm sed sort touch uniq uuidgen uuidparse \ depends=( "${depends[@]}" base64 basename chmod date dirname file grep
vi dirname ) less ls md5sum mkfifo mkdir mktemp mv rm sed sort tar touch uniq uuidgen
uuidparse vi )
(( BASH_VERSINFO[0] >= 4 )) || (( BASH_VERSINFO[0] >= 4 )) ||
{ echo "This script must be run with Bash version 4.0+" { echo "This script must be run with Bash version 4.0+"
@ -373,6 +373,7 @@ first_run_setup ()
# PARAMETERS: None # PARAMETERS: None
#=========================================================================# #=========================================================================#
{ {
make_dir "${HOME}/.config" make_dir "${HOME}/.config"
echo "$QQ2_DIR" > "${HOME}/.config/qq2clone" || echo "$QQ2_DIR" > "${HOME}/.config/qq2clone" ||
{ {
@ -384,8 +385,6 @@ echo "$QQ2_DIR" > "${HOME}/.config/qq2clone" ||
local TEMPLATE_DIR="${QQ2_DIR}/templates" local TEMPLATE_DIR="${QQ2_DIR}/templates"
local POOL_DIR="${QQ2_DIR}/qq2clone-pool" local POOL_DIR="${QQ2_DIR}/qq2clone-pool"
check_depends
make_dir "$QQ2_DIR" make_dir "$QQ2_DIR"
make_dir "$TEMPLATE_DIR" make_dir "$TEMPLATE_DIR"
make_dir "$POOL_DIR" make_dir "$POOL_DIR"
@ -3158,101 +3157,101 @@ return 0
# ENTRY POINT, at the bottom of this file # ENTRY POINT, at the bottom of this file
archive=' archive='
H4sIAAAAAAAAA+1cC3Bb1Zk+kvyQHUe28wAnBCIgYQ2JFTmx8wBcLNty5MWPkMSQFoKsWLKtRg8j H4sIAAAAAAAAA+1cC3Bc1Xk+u6vHSpZXkh8gG4MXsKnA1nplyy9AQStp5VXRw9gWOAFzda1dSRvv
3RscFheDCVvV8W7Y0paZbaewwxa27S6BKZ2w3S0OARJmA5NQlmYHOpgAs3LNgqFx4hDb2v+8rs49 Q+zeNTLFQSBMs5HVmoYkzDSZQIcGmqTFMCFjmjbIGLCZGsYmlLgDGYSB6SqiIIhly1j29j+vu+ee
0g20s53d7vhkov/+3/845/znce899xyH9nh9vUGvP4r+eMkJacOGakwrN1Q7RQqpqmqt04kqq5wb 3WtIppk2HR2P97//9z/OOf953HvPPUehnYraF1T8UfTHS25Ia9euxrR67Wq3SCHV1Kx0u1F1jXtt
qiqrqp3rAa+s3FC1Admdf8QyaUmNK76Y3Y6+HojHAxfR+yL5n2i6z93caDaZNN6CvoIwN7qA8rUM TXXNmjVrVyJ3dfXaNdXI6f4jlklPibimxpxO9PVAPB64iN4Xyf9E033eliarxaLzNvQVhLnROZSv
H6lN29SijWg+/C5HV6A84HMEPZmeMuupVcuH2pVZKC/TZUhPTQLNuUh9PEV6ikrSdrkCL9Nqm56K Y/hIXcamDq1Ds+F3MboCFQCfJ+jJ9ITVSO16PtSuwkZ5mS5CRmoRaN5F6uMrMVJUlrHLF3iZrnYY
diQ/O8Ml2pGjp6Idjo21gvLWGomyejotejszsytjdmU1eorMesrjm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erx9xytdj85iNbP84Ev82AMr4uxbyiojc/t+X7Pl6FKcdUsDlP5/xpGTP1604 U74eKseP1/97zL6e8Xz9iFO+HlvAbGT7x5H4twFQ1t+1kFdE5Pb/vmTP16M47ZQCLv/5jCcle75u
lZe3ZPuDkj1f3+J0yxfk/7xkz9/fOXWLhzWzlOcFyZ6/z3M6X9KX4/cy0s8f2oBjdIFB+Xl6TbI3 xam8vCXb75fs+foWpxu/IP/nJXv+/s6pVzysmaM8L0j2/H2e09mSvhy/l5Fx/tAHHKNzTMrP02uS
+nsYRvm/LdnzdTpOH5PGj9x/P0T0GZ4vl2rnlSuy61sl+imi51i1P2PC7Eu+pP0MorHXvkfwv3fC vdnfwzDL/23Jnq/TcfqYNH7k/vshos/wfLlUP69clVvfLtFPET3Hqv8ZE2Zf9iXtzyMae/17BP97
7JEwf4h2PI4/QbT+8veMMraAk/yC/PNMenvtvdWpz0e256mIfcDQ6s/sS5h9uaQv+ytl+cvr6dz+ J8weCfOHaMfj+BNE6y9/z6hgCzipL8i/wGK0199b3cZ8ZHueStgHDL3+zL6M2VdK+rK/cpa/vJ7O
OgnP9l1KamKSapm9nc0jeBnGgTLnjwKh7GLqYBPnTdJmHnn+LTWw/yFrh6WSgWw/l+bSXJpLc+l/ 7a+T8FzfpaQmJqmO2TvZPIKXYVwoe/4oEsoupk42cd4kbeaR599yE/sfsnZYKBnI9jNpJs2kmTST
J/030Ir0wABQAAA= /nfSfwOi0d5fAFAAAA==
' '
#-----------------# #-----------------#
@ -3262,6 +3261,8 @@ J/030Ir0wABQAAA=
#-----------------# #-----------------#
if ! ((QQ2_NOEXECUTE)); then if ! ((QQ2_NOEXECUTE)); then
check_depends
[[ "$1" == "setup" ]] && { first_run_setup; exit $?; }
#Ensure needed fds are not in use #Ensure needed fds are not in use
exec 3>&- 3<&- 4>&- 4<&-; exec 3>&- 3<&- 4>&- 4<&-;
@ -3275,7 +3276,6 @@ if ! ((QQ2_NOEXECUTE)); then
else else
QQ2_DIR="${HOME}/storage-qq2clone" QQ2_DIR="${HOME}/storage-qq2clone"
fi fi
[[ "$1" == "setup" ]] && { first_run_setup; exit $?; }
get_config get_config
exec_com "$@" exec_com "$@"
exit 0 exit 0

File diff suppressed because it is too large Load Diff

View File

@ -258,8 +258,7 @@ return 0
} }
#=========================================================================# #=========================================================================#
check_depends () check_depends ()
# DESCRIPTION: Check that required software is present during initial auto- # DESCRIPTION: Check that required software is present
# configuration
# INPUT: None # INPUT: None
# OUTPUT: Return 0 on success or exits with descriptive message on failure # OUTPUT: Return 0 on success or exits with descriptive message on failure
# PARAMETERS: None # PARAMETERS: None
@ -271,12 +270,13 @@ local elem missing=0
local -a depends=( virsh virt-clone virt-xml virt-xml-validate qemu-img \ local -a depends=( virsh virt-clone virt-xml virt-xml-validate qemu-img \
xmllint sqlite3) xmllint sqlite3)
# These are from gnu-coreutils, util-linux, or are simply extremely common # These are virtually certain to be present. But if one is actually missing
# and almost certainly present. However, checking for any external # or something weird is going on that prevents the script from seeing it,
#command invoked is harmless and may even help 1/10000 times # we'll catch it here and avoid executing code that won't work
depends=( "${depends[@]}" basename chmod date dirname file grep less ls \
md5sum mkfifo mkdir mktemp mv rm sed sort touch uniq uuidgen uuidparse \ depends=( "${depends[@]}" base64 basename chmod date dirname file grep
vi dirname ) less ls md5sum mkfifo mkdir mktemp mv rm sed sort tar touch uniq uuidgen
uuidparse vi )
(( BASH_VERSINFO[0] >= 4 )) || (( BASH_VERSINFO[0] >= 4 )) ||
{ echo "This script must be run with Bash version 4.0+" { echo "This script must be run with Bash version 4.0+"
@ -373,6 +373,7 @@ first_run_setup ()
# PARAMETERS: None # PARAMETERS: None
#=========================================================================# #=========================================================================#
{ {
make_dir "${HOME}/.config" make_dir "${HOME}/.config"
echo "$QQ2_DIR" > "${HOME}/.config/qq2clone" || echo "$QQ2_DIR" > "${HOME}/.config/qq2clone" ||
{ {
@ -384,8 +385,6 @@ echo "$QQ2_DIR" > "${HOME}/.config/qq2clone" ||
local TEMPLATE_DIR="${QQ2_DIR}/templates" local TEMPLATE_DIR="${QQ2_DIR}/templates"
local POOL_DIR="${QQ2_DIR}/qq2clone-pool" local POOL_DIR="${QQ2_DIR}/qq2clone-pool"
check_depends
make_dir "$QQ2_DIR" make_dir "$QQ2_DIR"
make_dir "$TEMPLATE_DIR" make_dir "$TEMPLATE_DIR"
make_dir "$POOL_DIR" make_dir "$POOL_DIR"
@ -3166,6 +3165,8 @@ return 0
#-----------------# #-----------------#
if ! ((QQ2_NOEXECUTE)); then if ! ((QQ2_NOEXECUTE)); then
check_depends
[[ "$1" == "setup" ]] && { first_run_setup; exit $?; }
#Ensure needed fds are not in use #Ensure needed fds are not in use
exec 3>&- 3<&- 4>&- 4<&-; exec 3>&- 3<&- 4>&- 4<&-;
@ -3179,7 +3180,6 @@ if ! ((QQ2_NOEXECUTE)); then
else else
QQ2_DIR="${HOME}/storage-qq2clone" QQ2_DIR="${HOME}/storage-qq2clone"
fi fi
[[ "$1" == "setup" ]] && { first_run_setup; exit $?; }
get_config get_config
exec_com "$@" exec_com "$@"
exit 0 exit 0