aboutsummaryrefslogtreecommitdiff
path: root/t/13-local-check.t
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-02-19 01:09:00 +0100
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-02-19 01:09:00 +0100
commit229120ffb20bc9c3199a5abe38c4637bc631120d (patch)
treee0602363685d56d3cdc75885256c3da6b5e52f9b /t/13-local-check.t
parentf58cf0105f031268cb1193f25d5cf7620d6b3101 (diff)
downloadsbotools2-229120ffb20bc9c3199a5abe38c4637bc631120d.tar.xz
Add repo switching to the lo vs sbo test file
Diffstat (limited to 't/13-local-check.t')
-rwxr-xr-xt/13-local-check.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/13-local-check.t b/t/13-local-check.t
index 66e78b7..130ee2e 100755
--- a/t/13-local-check.t
+++ b/t/13-local-check.t
@@ -51,14 +51,35 @@ sub set_lo {
}
}
+sub set_repo {
+ state $set = 0;
+ state $orig;
+ if ($_[0]) {
+ if ($set) {
+ capture_merged { system(qw!rm -rf /usr/sbo/repo!); system('mv', "$RealBin/repo.backup", "/usr/sbo/repo"); } if -e "$RealBin/repo.backup";
+ script (qw/ sboconfig -r /, $orig, { test => 0 });
+ }
+ } else {
+ ($orig) = script (qw/ sboconfig -l /, { expected => qr/REPO=(.*)/, test => 0 });
+ $orig //= 'FALSE';
+ note "Saving original value of REPO: $orig";
+ $set = 1;
+ script (qw/ sboconfig -r /, "file://$RealBin/gitrepo/", { test => 0 });
+ capture_merged { system(qw! mv /usr/sbo/repo !, "$RealBin/repo.backup"); } if -e "/usr/sbo/repo";
+ }
+}
+
+
cleanup();
make_slackbuilds_txt();
set_lo();
+set_repo();
# 1: ...
# Cleanup
END {
+ set_repo('delete');
set_lo('delete');
make_slackbuilds_txt('delete');
cleanup();