commit 1eb8fbd4f581db351fa247360744e76682b05dd7
parent 92ea9dd42661252181b2d6f2751f8821b567f44e
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Sat, 23 Apr 2016 00:54:24 +0200
Test::Sbotools: move original repo out of the way when using set_repo
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/t/Test/Sbotools.pm b/t/Test/Sbotools.pm
@@ -52,7 +52,15 @@ sub set_pkg_dir { _set_config('PKG_DIR', @_); }
sub set_sbo_home { _set_config('SBO_HOME', @_); }
sub set_lo { _set_config('LOCAL_OVERRIDES', @_); }
sub set_version { _set_config('SLACKWARE_VERSION', @_); }
-sub set_repo { _set_config('REPO', @_); }
+
+my $repo = 0;
+sub set_repo {
+ _set_config('REPO', @_);
+ if (-e "/usr/sbo/repo" and not $repo) {
+ $repo = 1;
+ system(qw! mv /usr/sbo/repo !, "$RealBin/repo.backup");
+ }
+}
my %config;
my %settings = (
@@ -131,6 +139,10 @@ END {
if ($tags == 2) {
system('mv', "$tags_txt.bak", $tags_txt);
}
+ if ($repo) {
+ system(qw! rm -rf /usr/sbo/repo !);
+ system('mv', "$RealBin/repo.backup", "/usr/sbo/repo");
+ }
}
1;