diff options
| author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-04-23 00:54:24 +0200 | 
|---|---|---|
| committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-04-23 00:54:24 +0200 | 
| commit | 1eb8fbd4f581db351fa247360744e76682b05dd7 (patch) | |
| tree | d1d67bcf3f77d33f4ff8967d7275dcef98e9fa74 /t | |
| parent | 92ea9dd42661252181b2d6f2751f8821b567f44e (diff) | |
| download | sbotools2-1eb8fbd4f581db351fa247360744e76682b05dd7.tar.xz | |
Test::Sbotools: move original repo out of the way when using set_repo
Diffstat (limited to 't')
| -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;  | 
