container: finance: add lib_root impl (macro/plugin support)

- dfi's `root` now supports shell loading (and running) of
  macros/plugins:

  * An interactive ROOT.cern instance is no longer *always* needed:

    - For macros (non-server); a 'one-off' instance will start, load the
      given macro, run the macro and then the instance will exit.

      * Server(s) will maintain an interactive instance.

    - For plugins; an interactive instance will start, load the given
      plugin, and then leave the user to make their calls manually.

  * All repo macros and repo/custom plugins are available.

- By default, an interactive instance will start when no dfi `root`
  arguments are given.

See `root help` for details.
This commit is contained in:
2025-09-03 14:09:26 -07:00
parent ae32cfa229
commit ed163448f9
2 changed files with 236 additions and 5 deletions

View File

@@ -90,6 +90,7 @@ function lib_finance::finance()
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_meta.bash" || exit 1
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_plugins.bash" || exit 1
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_reports.bash" || exit 1
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_root.bash" || exit 1
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_taxes.bash" || exit 1
source "${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/lib/internal/lib_times.bash" || exit 1
}
@@ -216,11 +217,7 @@ function lib_finance::reports()
function lib_finance::root()
{
# TODO: lib_root, add extendable arguments
lib_utils::deps_check "root"
# NOTE: will automatically load rootlogon.C
pushd "${DOCKER_FINANCE_CONTAINER_REPO}/src/root/macro" 1>/dev/null \
&& root -l
lib_root::root "$@"
lib_utils::catch $?
}