diff options
-rw-r--r-- | t/Test/Sbotools.pm | 14 |
1 files changed, 13 insertions, 1 deletions
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; |