aboutsummaryrefslogtreecommitdiff
path: root/SBO-Lib/lib/SBO/Lib.pm
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2015-12-04 01:00:47 +0100
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2015-12-04 01:00:47 +0100
commitea914a834932b7f94379e5247d2788b4b1e47ceb (patch)
treec684e17decde5b11a24aa3295dff67bcbd05bc00 /SBO-Lib/lib/SBO/Lib.pm
parent26c0796d4341c665fc8d67aecf350349201e8bbe (diff)
downloadsbotools2-ea914a834932b7f94379e5247d2788b4b1e47ceb.tar.xz
Add ability to set a directory of local overrides.
This fixes #8
Diffstat (limited to 'SBO-Lib/lib/SBO/Lib.pm')
-rw-r--r--SBO-Lib/lib/SBO/Lib.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm
index f260006..40e976c 100644
--- a/SBO-Lib/lib/SBO/Lib.pm
+++ b/SBO-Lib/lib/SBO/Lib.pm
@@ -143,6 +143,7 @@ our %config = (
JOBS => 'FALSE',
PKG_DIR => 'FALSE',
SBO_HOME => 'FALSE',
+ LOCAL_OVERRIDES => 'FALSE',
);
# subroutine to suck in config in order to facilitate unit testing
@@ -342,6 +343,19 @@ sub get_sbo_locations {
seek $fh, 0, 0;
}
close $fh;
+
+ # after we've checked the regular sbo locations, we'll see if it needs to
+ # be overridden by a local change
+ my $local = $config{LOCAL_OVERRIDES};
+ unless ( $local eq 'FALSE' ) {
+ for my $sbo (@sbos) {
+ my $loc = "$local/$sbo";
+ next unless -d $loc;
+ $$store{$sbo} = $loc;
+ $locations{$sbo} = $loc;
+ }
+ }
+
return %locations;
}
}