From 1eb8fbd4f581db351fa247360744e76682b05dd7 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Sat, 23 Apr 2016 00:54:24 +0200 Subject: Test::Sbotools: move original repo out of the way when using set_repo --- t/Test/Sbotools.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 't/Test/Sbotools.pm') diff --git a/t/Test/Sbotools.pm b/t/Test/Sbotools.pm index 88c4cf5..b0fad45 100644 --- 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; -- cgit v1.2.3