diff --git a/objects.tar.gz b/objects.tar.gz index ebc2feed6..237d1bea5 100644 Binary files a/objects.tar.gz and b/objects.tar.gz differ diff --git a/sherpa-manager.tar.gz b/sherpa-manager.tar.gz index 240d34a98..1bf468e8f 100644 Binary files a/sherpa-manager.tar.gz and b/sherpa-manager.tar.gz differ diff --git a/support/sherpa-manager.source b/support/sherpa-manager.source index 110f238f1..a74103010 100755 --- a/support/sherpa-manager.source +++ b/support/sherpa-manager.source @@ -89,9 +89,6 @@ ShowResults() elif [[ $useropt_show_backups = true ]]; then ReleaseLockfile ShowReportBackups - elif [[ $useropt_show_versions = true ]]; then - ReleaseLockfile - ShowReportVersions elif [[ $useropt_show_dependencies = true ]]; then ShowReportDependencies elif [[ $useropt_show_features = true ]]; then @@ -106,7 +103,12 @@ ShowResults() fi if [[ $generate_list_report = true ]]; then - ShowQPKGLists + if [[ $useropt_list_versions = true ]]; then + ReleaseLockfile + ShowVersionsList + else + ShowQPKGLists + fi fi if [[ $useropt_paste_log_last = true ]]; then @@ -342,6 +344,7 @@ LoadVars() useropt_help_show=false useropt_help_tips=false useropt_help_upgrades=false + useropt_list_versions=false useropt_paste_log_last=false useropt_paste_log_tail=false useropt_report_footer=$(LoadSetting ReportFooter true) @@ -354,7 +357,6 @@ LoadVars() useropt_show_repos=false useropt_show_all_results=false useropt_show_status=false - useropt_show_versions=false useropt_terse=$(LoadSetting Terse true) useropt_verbose=false @@ -2462,7 +2464,7 @@ ParseListArgs() # Include action assignment when action hasn't been previously specified. case $group in - abs) + versions) [[ -z $action ]] && action=list esac @@ -2472,14 +2474,6 @@ ParseListArgs() case $action in list) case $group in - abs) - action='' - awaiting_group=false - generate_help_report=true - get_qpkg_states=true - run_package_actions=false - useropt_help_abbreviations=true - ;; all|?(in)dependent) LoadObjects QPKGs.AClist.GR${group}:Set @@ -2513,11 +2507,12 @@ ParseListArgs() show_title=false ;; versions) + LoadPackages action='' awaiting_group=false generate_list_report=true show_title=false - useropt_show_versions=true + useropt_list_versions=true ;; *) args_remaining+=("$action") @@ -2641,14 +2636,14 @@ ParseActionArgs() generate_action_results_report=true get_qpkg_states=true run_package_actions=true - ;; - *) - LoadObjects - QPKGs-AC${action}-to:Add "$group" - awaiting_group=false - generate_action_results_report=true - get_qpkg_states=true - run_package_actions=true +# ;; +# *) +# LoadObjects +# QPKGs-AC${action}-to:Add "$group" +# awaiting_group=false +# generate_action_results_report=true +# get_qpkg_states=true +# run_package_actions=true esac else args_remaining+=("$arg") @@ -8115,22 +8110,6 @@ ShowReportStatuses() } -ShowReportVersions() - { - - DisableDebugToArchiveAndFile - EraseThisLine - - Display "QPKG: ${r_this_package_ver:-undefined}" - Display "manager: ${r_this_script_ver:-undefined}" - Display "loader: ${LOADER_SCRIPT_VERSION:-undefined}" - Display "objects: ${r_objects_version:-undefined}" - Display "packages: ${r_packages_epoch}$([[ $r_packages_epoch != undefined ]] && printf '%s' " ($(ConvertSecondsToFullDate "$r_packages_epoch"))")" - - return 0 - - } - ShowReportAllActionResults() { @@ -8446,6 +8425,22 @@ GenerateReportHeadingsFooter() } +ShowVersionsList() + { + + DisableDebugToArchiveAndFile + EraseThisLine + + Display "QPKG: ${r_this_package_ver:-undefined}$([[ $r_this_package_ver != undefined ]] && printf '%s' " ($(ConvertDateCodeToExtendedDate "$r_this_package_ver"))")" + Display "manager: ${r_this_script_ver:-undefined}$([[ $r_this_script_ver != undefined ]] && printf '%s' " ($(ConvertDateCodeToExtendedDate "$r_this_script_ver"))")" + Display "loader: ${LOADER_SCRIPT_VERSION:=undefined}$([[ $LOADER_SCRIPT_VERSION != undefined ]] && printf '%s' " ($(ConvertDateCodeToExtendedDate "$LOADER_SCRIPT_VERSION"))")" + Display "objects: ${r_objects_version:-undefined}$([[ $r_objects_version != undefined ]] && printf '%s' " ($(ConvertDateCodeToExtendedDate "$r_objects_version"))")" + Display "packages: ${r_packages_epoch:-undefined}$([[ $r_packages_epoch != undefined ]] && printf '%s' " ($(ConvertSecondsToFullDate "$r_packages_epoch"))")" + + return 0 + + } + ShowQPKGLists() { @@ -13337,6 +13332,28 @@ ConvertNanosecondsToMilliseconds() } 2> /dev/null +ConvertDateCodeToExtendedDate() + { + + # Inputs: (local) + # $1 = datecode in the format 'YYMMDD'. Example: '240928' + + # Outputs: (local) + # stdout = extended date format without time. Example: 'Sun 28 Sep 2024' + + [[ -n ${1:-} ]] || return + + local a=$($SED_CMD 's/[^0-9]*//g' <<< "${1:-}") # Strip everything not a numeral. + + if [[ ${#a} -ne 6 ]]; then + printf 'unable to interpret datecode' + return 1 + fi + + /bin/date -d ${a::2}-${a:2:2}-${a:4:2} '+%a %d %b %Y' + + } 2> /dev/null + ConvertNowToFullDate() { @@ -13383,11 +13400,11 @@ FormatAsLongMinutesSecs() # Inputs: (local) # $1 = a time in long minutes and seconds to convert to 'MMMm:SSs'. - # separate minutes from seconds + # Separate minutes from seconds local m=${1%%:*} local s=${1#*:} - # remove leading whitespace + # Remove leading whitespace m=${m##* } s=${s##* } diff --git a/workshop/ideas.txt b/workshop/ideas.txt index 4d97b0970..3fd7b0f9d 100644 --- a/workshop/ideas.txt +++ b/workshop/ideas.txt @@ -1,4 +1,4 @@ -* update sherpa service control script terminal output so it matches QPKG library functions. +* Update sherpa service control script terminal output so it matches QPKG library functions. * Check OOM killed pids against inactive daemons and report as-such on status report. @@ -45,6 +45,8 @@ * Include QPKG version numbers in live progress messages? * Allow QPKGs to follow source git branch, release or tag. + # [[ $(git branch) =~ '(no branch)' ]] && echo none || echo one + # git describe --tags * Add new arg to reshow the previously generated report. - 'sherpa show report'. diff --git a/workshop/issues.txt b/workshop/issues.txt index 6c03c3116..a2d081c32 100644 --- a/workshop/issues.txt +++ b/workshop/issues.txt @@ -13,37 +13,6 @@ Observed issues: * Near the end of installing IPKs, monitored download path can remain at non-zero size while packages complete installation. - Include a separate progress message when dir size shrinks? Maybe force increase to "100%" and stop monitoring? - * When attempting to view file versions with-and-without correct syntax fails in several ways: - ------------------------------------------------------------------------------------------------------------------------- - [~] # sherpa list versions - proc: env ... - proc: args ... - ------------------------------------------------------------------------------------------------------------------------- - [~] # sherpa versions - proc: env ... - proc: args ... - proc: objects ... - proc: QPKGs ... - sherpa v240529-unstable - - derp: unknown argument "versions". Please check the arguments again. - - ------------------------------------------------------------------------------------------------------------------------- - [~] # sherpa show versions - proc: env ... - proc: args ... - proc: objects ... - proc: QPKGs ... - /share/CACHEDEV1_DATA/.qpkg/sherpa/cache/sherpa-manager.sh: line 1882: QPKGs-ACshow-to:Add: command not found - sherpa v240529-unstable - - • Please provide a valid source after 'show' like: - # sherpa show abs - # sherpa show log - # sherpa show packages - # sherpa show results - ------------------------------------------------------------------------------------------------------------------------- - * 'sherpa' and 'opkg' were not available after installing Entware. - Entware installation may be corrupt. - But this shouldn't affect the sherpa command `/usr/sbin/sherpa`. diff --git a/workshop/kapowarr.source b/workshop/kapowarr.source deleted file mode 100644 index 06147d64b..000000000 --- a/workshop/kapowarr.source +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -#* -# -#* -# -#* -# -#* -# -#* -# -#* - -readonly USER_ARGS_RAW=$* -readonly QPKG_NAME=Kapowarr -readonly SERVICE_SCRIPT_VERSION='' -readonly SERVICE_SCRIPT_TYPE=1 - -InitService() - { - -# app_version_pathfile=$qpkg_repo_path/lazylibrarian/version.py - daemon_pathfile=$qpkg_repo_path/Kapowarr.py - daemon_launch_cmd="$venv_python_pathfile $daemon_pathfile --daemon --nolaunch --datadir $(/usr/bin/dirname "$qpkg_ini_pathfile") --config $qpkg_ini_pathfile --pidfile $daemon_pid_pathfile" - - # '0.0.0.0' is the default value for LazyLibrarian, so it won't be found in config file. LL only stores non-default values. - get_ui_listening_address_cmd="/sbin/getcfg misc host -d 0.0.0.0 -f $qpkg_ini_pathfile" - - # '5299' is the default value for LazyLibrarian, so it won't be found in config file. LL only stores non-default values. - get_ui_port_cmd="/sbin/getcfg General http_port -d 5656 -f $qpkg_ini_pathfile" - get_ui_port_secure_cmd="/sbin/getcfg General http_port -d 5656 -f $qpkg_ini_pathfile" - get_ui_port_secure_enabled_test_cmd='[[ $(/sbin/getcfg General https_enabled -d 0 -f '$qpkg_ini_pathfile') = 1 ]]' - run_daemon_in_screen_session=true - source_git_branch=development - source_git_release=latest - source_git_tag='' - -# [[ $(git branch) =~ '(no branch)' ]] && echo none || echo one -# git describe --tags - - source_git_url=https://github.com/Casvt/Kapowarr.git - - IsSupportGetAppVersion && app_version_cmd="/bin/grep '__version__ =' $app_version_pathfile | /bin/sed 's|^.*\"\(.*\)\"|\1|'" - - } - -library_path=$(/usr/bin/readlink "$0" 2>/dev/null) -[[ -z $library_path ]] && library_path=$0 -readonly SERVICE_LIBRARY_PATHFILE=$(/usr/bin/dirname "$library_path")/service.lib - -if [[ -e $SERVICE_LIBRARY_PATHFILE ]]; then - . $SERVICE_LIBRARY_PATHFILE -else - printf '\033[1;31m%s\033[0m: %s\n' 'derp' "QPKG service function library not found, can't continue." - exit 1 -fi - -ProcessArgs diff --git a/workshop/report.ansi b/workshop/report.ansi deleted file mode 100644 index 4b88995ae..000000000 --- a/workshop/report.ansi +++ /dev/null @@ -1,38 +0,0 @@ -QPKG name:|QPKG statuses:|QPKG action (result):|QPKG version:|Application version: - Bazarr|- enabled, active| start (OK)| 240809| dynamic - ClamAV|- enabled, active| start (OK)| 240809| 0.104.4 - duf| enabled, active| start (OK)| 240731| 0.8.1 - Entware| enabled, active| unsupported| 1.03a| 1.03a - Glances| enabled, active| start (OK)| 240809| dynamic - Headphones| enabled, active| start (failed)| 240809| dynamic - HideThatBanner| enabled, active| start (OK)| 240807| 240807 - IncreaseTimeouts| enabled, active| start (OK)| 240808| 240808 - inxi| enabled, active| unsupported| 240417| 3.3.34 - Kapowarr| enabled, active| start (OK)| 240809| dynamic - LazyLibrarian| enabled, active| start (OK)| 240809| dynamic - OLidarr| enabled, active| start (OK)| 240809| dynamic - OMedusa| enabled, active| start (OK)| 240809| dynamic - Mylar3| enabled, active| start (OK)| 240809| dynamic - nzbget| enabled, active| unsupported| 24.2| 24.2 - NZBHydra2| enabled, active| start (OK)| 240809| dynamic - nzbToMedia| enabled, active| unsupported| 240205| dynamic - OliveTin| enabled, active| start (OK)| 240809| dynamic - Par2turbo| enabled, active| unsupported| 1.1.0| 1.1.0 - pyLoad| enabled, active| start (OK)| 240809| dynamic - OqBittorrent| enabled, active| start (OK)| 240809| 4.6.3 - QDK| enabled, active| unsupported| 2.3.13| 2.3.13 - OReadarr| enabled, active| start (OK)| 240809| dynamic - RunLast| enabled, active| start (OK)| 240731| 240731 - SABnzbd| enabled, active| start (OK)| 240809| dynamic - sha3sum| enabled, active| start (OK)| 240808| 1.23.1 - sherpa| enabled, active| start (OK)| 240809| 240809 - OSickGear| enabled, active| start (OK)| 240809| dynamic - OSonarr| enabled, active| start (OK)| 240809| dynamic - SortMyQPKGs| enabled, active| start (OK)| 240801| 240801 - OTautulli| enabled, active| start (OK)| 240809| dynamic - OTransmission| enabled, active| start (OK)| 240809| 4.0.4 - Unmanic| enabled, active| start (OK)| 240809| dynamic - Unrar| enabled, active| unsupported| 7.0.8| 7.01 beta 1 - OWatcher3| enabled, active| start (OK)| 240809| final - WebSSH| enabled, active| start (OK)| 240809| dynamic - OWhisparr| enabled, active| start (OK)| 240809| dynamic diff --git a/workshop/sherpa QPKGs without function library support.txt b/workshop/sherpa QPKGs without function library support.txt deleted file mode 100644 index d1d6f8eaa..000000000 --- a/workshop/sherpa QPKGs without function library support.txt +++ /dev/null @@ -1 +0,0 @@ -nzbtomedia diff --git a/workshop/type1.template.source b/workshop/type1.template.source deleted file mode 100644 index a1a61d6c7..000000000 --- a/workshop/type1.template.source +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash -#* -# -#* -# -#* -# -#* -# -#* -# -#* - -readonly USER_ARGS_RAW=$* -readonly QPKG_NAME=Headphones -readonly SERVICE_SCRIPT_VERSION='' -readonly SERVICE_SCRIPT_TYPE=1 - -InitService() - { - - # default values - allow_access_to_sys_packages=true - app_version_cmd=undefined - app_version_pathfile=undefined - daemon_pid_pathfile=/var/run/$QPKG_NAME.pid - daemon_port=0 - get_daemon_port_cmd=undefined - install_pip_deps=true - interpreter=/opt/bin/python3 - launcher_pathfile=undefined # On-demand executables only. - local_temp_path=undefined - nice_daemon_to=0 # If non-zero, daemon proc is niced to this value on-launch. - orig_daemon_service_script=undefined # Specific to Entware binaries only. - pidfile_is_managed_by_app=true - pip_cache_path=$QPKG_PATH/pip-cache - qpkg_backup_pathfile=$BACKUP_PATH/$QPKG_NAME.config.tar.gz - qpkg_ini_file=config.ini - qpkg_ini_pathfile=$QPKG_CONFIG_PATH/$qpkg_ini_file - qpkg_ini_default_pathfile=$qpkg_ini_pathfile.def - qpkg_repo_path=$QPKG_PATH/repo-cache - recheck_daemon_pid_after_launch=true # If true, application PID is reconfirmed shortly after initial launch. Some applications launch with one PID, then switch to another. - recheck_daemon_pid_after_kill=false # If true, application PID is reconfirmed shortly after kill confirmed. Some applications kill their main PID, then switch to another during shutdown. - remote_arch=undefined - remote_url=undefined - resolve_remote_url=false # If 'true', URL must be retrieved from remote first, then parsed to get final URL. - run_daemon_in_screen_session=false - service_operation=unspecified - service_result=undefined - silence_pypi_errors=true # If true, PyPI package processing errors won't be shown in system log. - source_arch=undefined - source_archive_pathfile=undefined - source_git_branch=master - source_git_branch_depth=shallow # 'shallow' (depth 1) or 'single-branch' ... 'shallow' implies 'single-branch'. - source_git_url=https://github.com/rembo10/headphones.git - ui_listening_address=undefined - ui_port=0 - ui_port_secure=0 - userlink_pathfile=undefined # On-demand executables only. - venv_path=$QPKG_PATH/venv - venv_pip_pathfile=$venv_path/bin/pip - venv_python_pathfile=$venv_path/bin/python3 - - daemon_launch_cmd="$venv_python_pathfile $daemon_pathfile --daemon --nolaunch --datadir $(/usr/bin/dirname "$qpkg_ini_pathfile") --config $qpkg_ini_pathfile --pidfile $daemon_pid_pathfile" daemon_pathfile=$qpkg_repo_path/Headphones.py - - get_ui_listening_address_cmd="/sbin/getcfg General web_host -d undefined -f $qpkg_ini_pathfile" - get_ui_port_cmd="/sbin/getcfg General web_port -d 0 -f $qpkg_ini_pathfile" - get_ui_port_secure_cmd="/sbin/getcfg General web_port -d 0 -f $qpkg_ini_pathfile" - get_ui_port_secure_enabled_test_cmd='[[ $(/sbin/getcfg General enable_https -d 0 -f '$qpkg_ini_pathfile') = 1 ]]' - - if [[ -e $qpkg_ini_default_pathfile ]]; then - /sbin/setcfg General log_dir "$QPKG_CONFIG_PATH"/logs -f "$qpkg_ini_default_pathfile" - /sbin/setcfg General cache_dir "$QPKG_CONFIG_PATH"/cache -f "$qpkg_ini_default_pathfile" - fi - - if [[ -e $qpkg_ini_pathfile ]]; then - /sbin/setcfg General log_dir "$QPKG_CONFIG_PATH"/logs -f "$qpkg_ini_pathfile" - /sbin/setcfg General cache_dir "$QPKG_CONFIG_PATH"/cache -f "$qpkg_ini_pathfile" - fi - - } - -library_path=$(/usr/bin/readlink "$0" 2>/dev/null) -[[ -z $library_path ]] && library_path=$0 -readonly SERVICE_LIBRARY_PATHFILE=$(/usr/bin/dirname "$library_path")/service.lib - -if [[ -e $SERVICE_LIBRARY_PATHFILE ]]; then - . $SERVICE_LIBRARY_PATHFILE -else - printf '\033[1;31m%s\033[0m: %s\n' 'derp' "QPKG service function library not found, can't continue." - exit 1 -fi - -ProcessArgs