diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2015-12-08 21:05:45 +0100 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2015-12-08 21:05:45 +0100 |
commit | 37c65d13f845d2864f26984c4ed50f2d80e07033 (patch) | |
tree | dd5217a323f13f57f74133dc41badcd74e752125 | |
parent | ff45c2217584f8e72d5ae41288bfbb5f563509a4 (diff) | |
download | sbotools2-37c65d13f845d2864f26984c4ed50f2d80e07033.tar.xz |
Update manpages and scripts for #6
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 3 | ||||
-rw-r--r-- | man1/sboconfig.1 | 5 | ||||
-rw-r--r-- | man5/sbotools.conf.5 | 7 | ||||
-rwxr-xr-x | sboconfig | 6 | ||||
-rwxr-xr-x | sbofind | 6 |
5 files changed, 22 insertions, 5 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 2b06d48..26f75ed 100644 --- 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 index 94cae5d..45ca8a6 100644 --- 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 index 475eef0..95a3c42 100644 --- 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) @@ -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}) { @@ -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}; } } } |