libzypp  17.32.5
RepoManagerOptions.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
13 #include "RepoManagerOptions.h"
14 #include <zypp/ZConfig.h>
15 
16 namespace zypp
17 {
19  //
20  // class RepoManagerOptions
21  //
23 
25  {
27  repoRawCachePath = Pathname::assertprefix( root_r, ZConfig::instance().repoMetadataPath() );
28  repoSolvCachePath = Pathname::assertprefix( root_r, ZConfig::instance().repoSolvfilesPath() );
29  repoPackagesCachePath = Pathname::assertprefix( root_r, ZConfig::instance().repoPackagesPath() );
34 
35  rootDir = root_r;
36  }
37 
39  {
41  ret.repoCachePath = root_r;
42  ret.repoRawCachePath = root_r/"raw";
43  ret.repoSolvCachePath = root_r/"solv";
44  ret.repoPackagesCachePath = root_r/"packages";
45  ret.knownReposPath = root_r/"repos.d";
46  ret.knownServicesPath = root_r/"services.d";
47  ret.pluginsPath = root_r/"plugins";
48  ret.rootDir = root_r;
49  return ret;
50  }
51 
52  std::ostream & operator<<( std::ostream & str, const RepoManagerOptions & obj )
53  {
54 #define OUTS(X) str << " " #X "\t" << obj.X << std::endl
55  str << "RepoManagerOptions (" << obj.rootDir << ") {" << std::endl;
56  OUTS( repoRawCachePath );
57  OUTS( repoSolvCachePath );
58  OUTS( repoPackagesCachePath );
59  OUTS( knownReposPath );
60  OUTS( knownServicesPath );
61  OUTS( pluginsPath );
62  str << "}" << std::endl;
63 #undef OUTS
64  return str;
65  }
66 }
#define OUTS(X)
RepoManagerOptions(const Pathname &root_r=Pathname())
Default ctor following ZConfig global settings.
static ZConfig & instance()
Singleton ctor.
Definition: ZConfig.cc:925
bool repo_add_probe() const
Whether repository urls should be probed.
Definition: ZConfig.cc:1161
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition: SerialNumber.cc:52
Repo manager settings.
static RepoManagerOptions makeTestSetup(const Pathname &root_r)
Test setup adjusting all paths to be located below one root_r directory.
Pathname rootDir
remembers root_r value for later use
static Pathname assertprefix(const Pathname &root_r, const Pathname &path_r)
Return path_r prefixed with root_r, unless it is already prefixed.
Definition: Pathname.cc:272
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19