diff options
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 2 | ||||
-rw-r--r-- | man1/sboconfig.1 | 5 | ||||
-rw-r--r-- | man5/sbotools.conf.5 | 5 | ||||
-rwxr-xr-x | sboconfig | 33 |
4 files changed, 32 insertions, 13 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 40e976c..2a7a338 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -144,6 +144,7 @@ our %config = ( PKG_DIR => 'FALSE', SBO_HOME => 'FALSE', LOCAL_OVERRIDES => 'FALSE', + SLACKWARE_VERSION => 'FALSE', ); # subroutine to suck in config in order to facilitate unit testing @@ -184,6 +185,7 @@ sub show_version { # which is now not needed since this version drops support < 14.0 # but it's already future-proofed, so leave it. sub get_slack_version { + return $config{SLACKWARE_VERSION} unless $config{SLACKWARE_VERSION} eq 'FALSE'; my %supported = ( '14.0' => '14.0', '14.1' => '14.1', diff --git a/man1/sboconfig.1 b/man1/sboconfig.1 index 5ed8b47..a502a13 100644 --- a/man1/sboconfig.1 +++ b/man1/sboconfig.1 @@ -54,6 +54,11 @@ SBO_HOME: If set to a path, this is where the slackbuilds.org tree will live; by .RS LOCAL_OVERRIDES: 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. .RE +.P +-V|--slackware-version (FALSE|#.#) +.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 .SH EXIT CODES .P sboconfig can exit with the following codes: diff --git a/man5/sbotools.conf.5 b/man5/sbotools.conf.5 index f44865c..2e43866 100644 --- a/man5/sbotools.conf.5 +++ b/man5/sbotools.conf.5 @@ -37,6 +37,11 @@ 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. .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 .SH SEE ALSO .P sbocheck(1), sboclean(1), sboconfig(1), sbofind(1), sboinstall(1), sboremove(1), sbosnap(1), sboupgrade(1) @@ -43,6 +43,8 @@ Config options (defaults shown): SBO_HOME: set the SBo directory. -l|--local-overrides FALSE: LOCAL_OVERRIDES: a directory containing local overrides. + -V|--slackware-version FALSE: + SLACKWARE_VERSION: use the SBo repository for this version. EOF } @@ -51,27 +53,29 @@ 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|l=s'); + 'local-overrides|l=s', 'slackware-version|V=s'); show_usage() and exit 0 if exists $options{help}; show_version() and exit 0 if exists $options{version}; my %valid_confs = ( - noclean => 'NOCLEAN', - distclean => 'DISTCLEAN', - jobs => 'JOBS', - 'pkg-dir' => 'PKG_DIR', - 'sbo-home' => 'SBO_HOME', - 'local-overrides' => 'LOCAL_OVERRIDES', + noclean => 'NOCLEAN', + distclean => 'DISTCLEAN', + jobs => 'JOBS', + 'pkg-dir' => 'PKG_DIR', + 'sbo-home' => 'SBO_HOME', + 'local-overrides' => 'LOCAL_OVERRIDES', + 'slackware-version' => 'SLACKWARE_VERSION', ); my %params = ( - NOCLEAN => 'c|--noclean', - DISTCLEAN => 'd|--distclean', - JOBS => 'j|--jobs', - PKG_DIR => 'p|--pkg-dir', - SBO_HOME => 's|--sbo-home', - LOCAL_OVERRIDES => 'l|--local-overrides', + NOCLEAN => 'c|--noclean', + DISTCLEAN => 'd|--distclean', + JOBS => 'j|--jobs', + PKG_DIR => 'p|--pkg-dir', + SBO_HOME => 's|--sbo-home', + LOCAL_OVERRIDES => 'l|--local-overrides', + SLACKWARE_VERSION => 'V|--slackware-version', ); if (exists $options{list}) { @@ -109,6 +113,9 @@ if (exists $changes{SBO_HOME}) { if (exists $changes{LOCAL_OVERRIDES}) { usage_error("$warn -l") unless $changes{LOCAL_OVERRIDES} =~ qr#^(/|FALSE$)#; } +if (exists $changes{SLACKWARE_VERSION}) { + usage_error("$warn -V") unless $changes{SLACKWARE_VERSION} =~ m/^(\d+\.\d+|FALSE)$/; +} # safely modify our conf file; write its contents to a temp file, modify the # temp file, write the contents of the temp file back to the conf file |