SBO::Lib::Tree(3)

NAME
SBO::Lib::Tree - Routines for interacting with a SlackBuilds.org tree.

SYNOPSIS
  use SBO::Lib::tree qw/ is_local /;

  my $bool = is_local($sbo);

SUBROUTINES

  get_all_available
  my @available = get_all_available();

get_all_available() returns an array of available scripts based on "SLACKBUILDS.TXT" and the contents of the "LOCAL_OVERRIDES" directory. This subroutine may be called in lieu of get_sbo_locations() near the start of the script.

  get_orig_location
  my $loc = get_orig_location($sbo);

get_orig_location() returns the location in the SlackBuilds.org tree for the given $sbo. Ensure that either get_sbo_locations() or get_all_available() is run before attempting get_orig_location().

  get_sbo_description
  my $description = get_sbo_description($sbo);

get_sbo_description() returns the short description for $sbo. Ensure that either get_sbo_locations() or get_all_available() is run before attempting get_sbo_description().

  get_sbo_location
  my $loc = get_sbo_location($sbo);

get_sbo_location() returns the location in "LOCAL_OVERRIDES" or the SlackBuilds.org tree for $sbo. Ensure that either get_sbo_locations() or get_all_available() is run before attempting get_sbo_location().

  get_sbo_locations
  my %locations = get_sbo_locations();

"get_sbo_locations" finds all SlackBuilds in @sbos and returns a hash matching each package name to its location. After get_sbo_locations() has been run for the first time, it simply returns the hash again in subsequent calls.

The descriptions hash is populated as well on the first run.

  is_local
  my $bool = is_local($sbo);

is_local() checks whether the given $sbo (or, for "compat32", the base script) is in the "LOCAL_OVERRIDES" directory. The return value is true if it is, and false if it is not.

  renew_sbo_locations
  my %locations = renew_sbo_locations();

renew_sbo_locations() clears all location- and description-related hashes and the available script array. It then runs get_sbo_locations() and returns the new locations hash.

EXIT CODES
Tree.pm subroutines can return the following exit codes:

  _ERR_SCRIPT        2   script or module bug
  _ERR_OPENFH        6   failure to open file handles

SEE ALSO
SBO::Lib(3), SBO::Lib::Build(3), SBO::Lib::Download(3), SBO::Lib::Info(3), SBO::Lib::Pkgs(3), SBO::Lib::Readme(3), SBO::Lib::Repo(3), SBO::Lib::Util(3)

AUTHORS
SBO::Lib was originally written by Jacob Pipkin <jacob.pipkin@icloud.com> with contributions from Luke Williams <xocel@iquidus.org> and Andreas Guldstrand <andreas.guldstrand@gmail.com>.

MAINTAINER
SBO::Lib is maintained by K. Eugene Carlson <kvngncrlsn@gmail.com>.

LICENSE
The sbotools are licensed under the MIT License.

Copyright (C) 2012-2017, Jacob Pipkin, Luke Williams, Andreas Guldstrand.

Copyright (C) 2024-2026, K. Eugene Carlson.

Copyright (C) 2026, K. Eugene Carlson, Jacob Pipkin.