aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-04-10 04:57:32 +0300
committerkaotisk <kaotisk@arching-kaos.org>2025-04-10 04:57:32 +0300
commit610e82629543ff0b44f46a221227c2998087ef30 (patch)
treed79fb21fb155a15b98aaf12e9003d3d86fe2705a /lib
parentf773608d73b975a878336f3fbc4e932516aec1e4 (diff)
downloadarching-kaos-tools-610e82629543ff0b44f46a221227c2998087ef30.tar.gz
arching-kaos-tools-610e82629543ff0b44f46a221227c2998087ef30.tar.bz2
arching-kaos-tools-610e82629543ff0b44f46a221227c2998087ef30.zip
Applying optimization
Diffstat (limited to 'lib')
-rwxr-xr-xlib/_ak_checks3
-rwxr-xr-xlib/_ak_cjdns5
-rwxr-xr-xlib/_ak_config3
-rwxr-xr-xlib/_ak_datetime2
-rwxr-xr-xlib/_ak_fm4
-rwxr-xr-xlib/_ak_fs5
-rwxr-xr-xlib/_ak_gpg9
-rwxr-xr-xlib/_ak_hash_exchange6
-rwxr-xr-xlib/_ak_html3
-rwxr-xr-xlib/_ak_ipfs4
-rwxr-xr-xlib/_ak_irc6
-rwxr-xr-xlib/_ak_log5
-rwxr-xr-xlib/_ak_maintainance3
-rwxr-xr-xlib/_ak_network13
-rwxr-xr-xlib/_ak_network_cjdns3
-rwxr-xr-xlib/_ak_network_incoming9
-rwxr-xr-xlib/_ak_network_ipfs5
-rwxr-xr-xlib/_ak_network_stellar7
-rwxr-xr-xlib/_ak_network_utils5
-rwxr-xr-xlib/_ak_network_yggdrasil5
-rwxr-xr-xlib/_ak_node4
-rwxr-xr-xlib/_ak_pkg12
-rwxr-xr-xlib/_ak_sblock4
-rwxr-xr-xlib/_ak_script5
-rwxr-xr-xlib/_ak_settings3
-rwxr-xr-xlib/_ak_sh4
-rwxr-xr-xlib/_ak_smfiles3
-rwxr-xr-xlib/_ak_yggdrasil6
-rwxr-xr-xlib/_ak_zblock15
-rwxr-xr-xlib/_ak_zchain11
30 files changed, 99 insertions, 73 deletions
diff --git a/lib/_ak_checks b/lib/_ak_checks
index 90b01ad..97b3d8a 100755
--- a/lib/_ak_checks
+++ b/lib/_ak_checks
@@ -17,7 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
function _ak_checks_example_check_for_base64_strings(){
diff --git a/lib/_ak_cjdns b/lib/_ak_cjdns
index 76b39db..51832d3 100755
--- a/lib/_ak_cjdns
+++ b/lib/_ak_cjdns
@@ -17,9 +17,10 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_network
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_network
rust_sh_install_url="https://sh.rustup.rs"
cjdns_src_git_repo_url="https://github.com/cjdelisle/cjdns"
cjdnstoolspath="$HOME/cjdns/tools"
diff --git a/lib/_ak_config b/lib/_ak_config
index 25a9563..6c71e9c 100755
--- a/lib/_ak_config
+++ b/lib/_ak_config
@@ -17,7 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_node
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_node
function _ak_config_show(){
# We will be using our public key also to put it in the block later
diff --git a/lib/_ak_datetime b/lib/_ak_datetime
index 8eaca23..9da8cfd 100755
--- a/lib/_ak_datetime
+++ b/lib/_ak_datetime
@@ -18,8 +18,6 @@
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-
function _ak_datetime_unix(){
date -u +%s | tr -d '\n'
}
diff --git a/lib/_ak_fm b/lib/_ak_fm
index d77cac7..5971a88 100755
--- a/lib/_ak_fm
+++ b/lib/_ak_fm
@@ -18,7 +18,9 @@
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_script
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_script
function _ak_fm_remove_line_from_file(){
tempfile="$(_ak_make_temp_file)"
diff --git a/lib/_ak_fs b/lib/_ak_fs
index 9bf7022..a0f5619 100755
--- a/lib/_ak_fs
+++ b/lib/_ak_fs
@@ -18,8 +18,9 @@
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_hash_exchange
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_hash_exchange
function _ak_fs_dir_init_setup(){
_ak_check_and_create_dir $AK_MAPSDIR
diff --git a/lib/_ak_gpg b/lib/_ak_gpg
index edfc1d7..079a7da 100755
--- a/lib/_ak_gpg
+++ b/lib/_ak_gpg
@@ -17,10 +17,11 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_ipfs
-source $AK_LIBDIR/_ak_config
-source $AK_LIBDIR/_ak_settings
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_ipfs
+_ak_lib_load _ak_config
+_ak_lib_load _ak_settings
export AK_FINGERPRINT="$(_ak_settings_get gpg.fingerprint)"
diff --git a/lib/_ak_hash_exchange b/lib/_ak_hash_exchange
index e2ce310..3751a8e 100755
--- a/lib/_ak_hash_exchange
+++ b/lib/_ak_hash_exchange
@@ -17,8 +17,10 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_fm
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_fm
+
AK_TREEFS="$AK_WORKDIR/tree"
AK_SESSIONSDIR="$AK_WORKDIR/sessions"
diff --git a/lib/_ak_html b/lib/_ak_html
index c9a898d..281790e 100755
--- a/lib/_ak_html
+++ b/lib/_ak_html
@@ -17,7 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
function _ak_generate_html_header(){
printf '<!DOCTYPE html>\n<html>\n<head>\n'
diff --git a/lib/_ak_ipfs b/lib/_ak_ipfs
index e30c1e1..07595ae 100755
--- a/lib/_ak_ipfs
+++ b/lib/_ak_ipfs
@@ -17,7 +17,9 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+
AK_IPFS_REPO="$AK_WORKDIR/ipfsrepo"
AK_IPFS_ARTIFACTS="$AK_WORKDIR/ipfs_artifacts"
if [ ! -d $AK_IPFS_ARTIFACTS ]
diff --git a/lib/_ak_irc b/lib/_ak_irc
index 25d3f10..13fe6b3 100755
--- a/lib/_ak_irc
+++ b/lib/_ak_irc
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
-
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_script
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_script
function _ak_irc_connect(){
_ak_not_implemented "LOL"
diff --git a/lib/_ak_log b/lib/_ak_log
index f713d3f..69fab74 100755
--- a/lib/_ak_log
+++ b/lib/_ak_log
@@ -18,7 +18,8 @@
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_datetime 2>/dev/null || source ./lib/_ak_datetime 2>/dev/null
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_datetime
export AK_LOGSDIR="$AK_WORKDIR/logs"
export AK_LOGSFILE="$AK_LOGSDIR/log"
@@ -190,5 +191,5 @@ function _ak_log_info(){
_ak_log_message "$PROGRAM" "INFO" "$*"
}
-_ak_log_debug "_ak_log loaded $(caller)"
+# _ak_log_debug "_ak_log loaded $(caller)"
# vim: set syntax=bash
diff --git a/lib/_ak_maintainance b/lib/_ak_maintainance
index bd7441b..ab8d9da 100755
--- a/lib/_ak_maintainance
+++ b/lib/_ak_maintainance
@@ -17,7 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
function _ak_maintainance_backup(){
if [ -n "${AK_WORKDIR}" ] && [ -d "${AK_WORKDIR}" ]
diff --git a/lib/_ak_network b/lib/_ak_network
index 442bf90..c6d048e 100755
--- a/lib/_ak_network
+++ b/lib/_ak_network
@@ -17,12 +17,13 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_network_ipfs
-source $AK_LIBDIR/_ak_network_cjdns
-source $AK_LIBDIR/_ak_network_yggdrasil
-source $AK_LIBDIR/_ak_network_stellar
-source $AK_LIBDIR/_ak_network_incoming
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_network_ipfs
+_ak_lib_load _ak_network_cjdns
+_ak_lib_load _ak_network_yggdrasil
+_ak_lib_load _ak_network_stellar
+_ak_lib_load _ak_network_incoming
function _ak_network_scan(){
if [ ! -z $1 ] && [ -n "$1" ]
diff --git a/lib/_ak_network_cjdns b/lib/_ak_network_cjdns
index 9f385f9..9a75690 100755
--- a/lib/_ak_network_cjdns
+++ b/lib/_ak_network_cjdns
@@ -17,7 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
cjdnstoolspath="$HOME/cjdns/tools"
diff --git a/lib/_ak_network_incoming b/lib/_ak_network_incoming
index 39eb67f..12384a3 100755
--- a/lib/_ak_network_incoming
+++ b/lib/_ak_network_incoming
@@ -17,10 +17,11 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_utils
-source $AK_LIBDIR/_ak_network_utils
-source $AK_LIBDIR/_ak_fm
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_datetime
+_ak_lib_load _ak_network_utils
+_ak_lib_load _ak_fm
export AK_ZPEERSINCOMING=$AK_ZPEERSDIR/incomingRequests
diff --git a/lib/_ak_network_ipfs b/lib/_ak_network_ipfs
index f666586..013ac1a 100755
--- a/lib/_ak_network_ipfs
+++ b/lib/_ak_network_ipfs
@@ -17,8 +17,9 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_ipfs
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_ipfs
function _ak_network_ipfs_scan(){
_ak_not_implemented _ak_network_ipfs_scan
diff --git a/lib/_ak_network_stellar b/lib/_ak_network_stellar
index cca8ff0..d4fffcf 100755
--- a/lib/_ak_network_stellar
+++ b/lib/_ak_network_stellar
@@ -17,9 +17,10 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_ipfs
-source $AK_LIBDIR/_ak_script
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_script
+_ak_lib_load _ak_ipfs
stellarPeersDir="$AK_ZPEERSDIR/stellar"
_ak_check_and_create_dir $stellarPeersDir
diff --git a/lib/_ak_network_utils b/lib/_ak_network_utils
index 9f4b8ef..d3689fe 100755
--- a/lib/_ak_network_utils
+++ b/lib/_ak_network_utils
@@ -17,8 +17,9 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_utils
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_datetime
##
# Copied from http://y.yggdrasil-network.ca/yia/crawler/crawler-yia.sh made by
diff --git a/lib/_ak_network_yggdrasil b/lib/_ak_network_yggdrasil
index 6e3b796..afabe70 100755
--- a/lib/_ak_network_yggdrasil
+++ b/lib/_ak_network_yggdrasil
@@ -17,8 +17,9 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_utils
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_datetime
function _ak_network_yggdrasil_scan_full(){
# This scan is using HIA resources to scan the whole cjdns network for peers
diff --git a/lib/_ak_node b/lib/_ak_node
index 71dec12..5ca8521 100755
--- a/lib/_ak_node
+++ b/lib/_ak_node
@@ -17,7 +17,9 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_ipfs
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_ipfs
# Resolves the IPNS key "ak-config" to its current IPFS value
# Return IPFS CIDv0 without /ipfs/ prefix
diff --git a/lib/_ak_pkg b/lib/_ak_pkg
index b3f99e0..e430a50 100755
--- a/lib/_ak_pkg
+++ b/lib/_ak_pkg
@@ -17,12 +17,12 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_script
-source $AK_LIBDIR/_ak_fs
-source $AK_LIBDIR/_ak_gpg
-source $AK_LIBDIR/_ak_zblock
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_script
+_ak_lib_load _ak_fs
+_ak_lib_load _ak_gpg
+_ak_lib_load _ak_zblock
function _ak_pkg_all_modules_make_release_from_local_installation(){
outdir="$(pwd)"
diff --git a/lib/_ak_sblock b/lib/_ak_sblock
index 374ac11..ff39288 100755
--- a/lib/_ak_sblock
+++ b/lib/_ak_sblock
@@ -17,8 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-
-source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
function _ak_sblock_show(){
if [ ! -z $1 ]
diff --git a/lib/_ak_script b/lib/_ak_script
index 1be8710..0a9c504 100755
--- a/lib/_ak_script
+++ b/lib/_ak_script
@@ -17,7 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source ./lib/_ak_log > /dev/null 2>&1 || source $AK_LIBDIR/_ak_log > /dev/null 2>&1
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
# Wanna talk about it?
function _ak_new_line(){
@@ -219,4 +220,4 @@ function _ak_countdown_seconds(){
printf "\n"
}
-_ak_log_debug "_ak_script loaded $(caller)"
+# _ak_log_debug "_ak_script loaded $(caller)"
diff --git a/lib/_ak_settings b/lib/_ak_settings
index ce36d10..181b37f 100755
--- a/lib/_ak_settings
+++ b/lib/_ak_settings
@@ -18,7 +18,8 @@
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_script
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_script
if [ ! -d "${AK_WORKDIR}" ]
then
diff --git a/lib/_ak_sh b/lib/_ak_sh
index 723f238..d7ab393 100755
--- a/lib/_ak_sh
+++ b/lib/_ak_sh
@@ -17,8 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-
-source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
function _ak_shell_help(){
_ak_log_info "# AK shell commands:"
diff --git a/lib/_ak_smfiles b/lib/_ak_smfiles
index c90a90a..91e075e 100755
--- a/lib/_ak_smfiles
+++ b/lib/_ak_smfiles
@@ -17,7 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_log
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
# The directory where the chunked data will be living at
CHKDIR="$AK_WORKDIR/ftr"
diff --git a/lib/_ak_yggdrasil b/lib/_ak_yggdrasil
index a4a2c6f..855dff8 100755
--- a/lib/_ak_yggdrasil
+++ b/lib/_ak_yggdrasil
@@ -17,9 +17,9 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_network
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_network
golang_src_git_repo_url="https://github.com/golang/go"
yggdrasil_src_git_repo_url="https://github.com/yggdrasil-network/yggdrasil-go"
diff --git a/lib/_ak_zblock b/lib/_ak_zblock
index 8d22316..c5e58d9 100755
--- a/lib/_ak_zblock
+++ b/lib/_ak_zblock
@@ -18,13 +18,14 @@
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
#set -x
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_script
-source $AK_LIBDIR/_ak_utils
-source $AK_LIBDIR/_ak_gpg
-source $AK_LIBDIR/_ak_html
-source $AK_LIBDIR/_ak_ipfs
-source $AK_LIBDIR/_ak_fs
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_log
+_ak_lib_load _ak_script
+_ak_lib_load _ak_datetime
+_ak_lib_load _ak_gpg
+_ak_lib_load _ak_html
+_ak_lib_load _ak_ipfs
+_ak_lib_load _ak_fs
if [ ! -d $AK_WORKDIR/ipfs ]
then
diff --git a/lib/_ak_zchain b/lib/_ak_zchain
index bec43bb..0d1ba57 100755
--- a/lib/_ak_zchain
+++ b/lib/_ak_zchain
@@ -17,11 +17,12 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source $AK_LIBDIR/_ak_utils
-source $AK_LIBDIR/_ak_log
-source $AK_LIBDIR/_ak_ipfs
-source $AK_LIBDIR/_ak_zblock
-source $AK_LIBDIR/_ak_script
+source $AK_LIBDIR/_ak_lib_load
+_ak_lib_load _ak_script
+_ak_lib_load _ak_datetime
+_ak_lib_load _ak_log
+_ak_lib_load _ak_ipfs
+_ak_lib_load _ak_zblock
function _ak_zchain_reset(){
_ak_log_info "Reseting AK_ZLATEST to AK_ZGENESIS"