sbotools2

Maintenance fork of the original sbotools version 2
Log | Files | Refs | README

commit 37c65d13f845d2864f26984c4ed50f2d80e07033
parent ff45c2217584f8e72d5ae41288bfbb5f563509a4
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date:   Tue,  8 Dec 2015 21:05:45 +0100

Update manpages and scripts for #6

Diffstat:
MSBO-Lib/lib/SBO/Lib.pm | 3+++
Mman1/sboconfig.1 | 5+++++
Mman5/sbotools.conf.5 | 7++++++-
Msboconfig | 6+++++-
Msbofind | 6+++---
5 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm @@ -59,6 +59,8 @@ our @EXPORT_OK = qw( $conf_dir $conf_file %config + $slackbuilds_txt + $repo_path ); our %EXPORT_TAGS = ( @@ -321,6 +323,7 @@ sub generate_slackbuilds_txt { while (my $package = readdir($cat_dh)) { next if $package =~ /^\.\.?$/; next unless -f "$repo_path/$cat/$package/$package.info"; + print { $fh } "SLACKBUILD NAME: $package\n"; print { $fh } "SLACKBUILD LOCATION: ./$cat/$package\n"; } close $cat_dh; diff --git a/man1/sboconfig.1 b/man1/sboconfig.1 @@ -59,6 +59,11 @@ LOCAL_OVERRIDES: If set to a path, any directory name under that path that match .RS SLACKWARE_VERSION: If set to a version specification, use the SBo repository for that version instead of the one you can find in /etc/slackware-version. .RE +.P +-r|--repo (FALSE|url) +.RS +REPO: If set to a url, use that repository instead of the SlackBuilds.org repository for your SLACKWARE_VERSION. Setting this will make the SLACKWARE_VERSION setting redundant. URLs need to either lead to a git repository or an rsync repository. The repository needs to be laid out like the SlackBuilds.org one with a couple of broad categories at the root and under those are subdirectories for each package. +.RE .SH EXIT CODES .P sboconfig can exit with the following codes: diff --git a/man5/sbotools.conf.5 b/man5/sbotools.conf.5 @@ -35,13 +35,18 @@ If set to a path, this is where the slackbuilds.org tree will live; by default, .P LOCAL_OVERRIDES=(FALSE|/path) .RS -If set to a path, any directory name under that path that matches a slackbuild name will be used instead of anything found on SBo. This will even work if it isn't on SBo at all. It still requires all the usual files present in an SBo directory such as README, name.info, and name.SlackBuild. +If set to a path, any directory name under that path that matches a slackbuild name will be used instead of anything found in the main repo. (By default SBo, but this can be changed using the REPO setting. See below.) This will even work if it isn't on SBo at all. It still requires all the usual files present in an SBo directory such as README, name.info, and name.SlackBuild. .RE .P SLACKWARE_VERSION=(FALSE|#.#) .RS If set to a version specification, use the SBo repository for that version instead of the one you can find in /etc/slackware-version. .RE +.P +REPO=(FALSE|url) +.RS +If set to a url, use that repository instead of the SlackBuilds.org repository for your SLACKWARE_VERSION. Setting this will make the SLACKWARE_VERSION setting redundant. URLs need to either lead to a git repository or an rsync repository. The repository needs to be laid out like the SlackBuilds.org one with a couple of broad categories at the root and under those are subdirectories for each package. +.RE .SH SEE ALSO .P sbocheck(1), sboclean(1), sboconfig(1), sbofind(1), sboinstall(1), sboremove(1), sbosnap(1), sboupgrade(1) diff --git a/sboconfig b/sboconfig @@ -45,6 +45,8 @@ Config options (defaults shown): LOCAL_OVERRIDES: a directory containing local overrides. -V|--slackware-version FALSE: SLACKWARE_VERSION: use the SBo repository for this version. + -r|--repo FALSE: + REPO: use a repository other than SBo. EOF } @@ -53,7 +55,7 @@ my %options; GetOptions(\%options, 'help|h', 'version|v', 'list|l', 'noclean|c=s', 'distclean|d=s', 'jobs|j=s', 'pkg-dir|p=s', 'sbo-home|s=s', - 'local-overrides|o=s', 'slackware-version|V=s'); + 'local-overrides|o=s', 'slackware-version|V=s', 'repo|r=s'); show_usage() and exit 0 if exists $options{help}; show_version() and exit 0 if exists $options{version}; @@ -66,6 +68,7 @@ my %valid_confs = ( 'sbo-home' => 'SBO_HOME', 'local-overrides' => 'LOCAL_OVERRIDES', 'slackware-version' => 'SLACKWARE_VERSION', + 'repo' => 'REPO', ); my %params = ( @@ -76,6 +79,7 @@ my %params = ( SBO_HOME => 's|--sbo-home', LOCAL_OVERRIDES => 'o|--local-overrides', SLACKWARE_VERSION => 'V|--slackware-version', + REPO => 'r|--repo', ); if (exists $options{list}) { diff --git a/sbofind b/sbofind @@ -13,7 +13,7 @@ use 5.16.0; use strict; use warnings FATAL => 'all'; -use SBO::Lib qw/ slackbuilds_or_fetch script_error open_read get_build_queue %config /; +use SBO::Lib qw/ slackbuilds_or_fetch script_error open_read get_build_queue %config $slackbuilds_txt $repo_path /; use File::Basename; use Getopt::Long qw(:config bundling); @@ -67,7 +67,7 @@ sub perform_search { my (@findings, $name, $found); my $name_regex = qr/NAME:\s+(.*\Q$search\E.*)$/i; my $loc_regex = qr/LOCATION:\s+(.*)$/; - my ($fh, $exit) = open_read "$config{SBO_HOME}/SLACKBUILDS.TXT"; + my ($fh, $exit) = open_read $slackbuilds_txt; if ($exit) { warn $fh; exit $exit; @@ -79,7 +79,7 @@ sub perform_search { if (my ($location) = ($line =~ $loc_regex)[0]) { $found = 0; $location =~ s#^\.##; - push @findings, {$name => $config{SBO_HOME} . $location}; + push @findings, {$name => $repo_path . $location}; } } }