Imported Upstream version 17.16.0
[platform/upstream/libzypp.git] / zypp / ZConfig.h
index cbda6fb..73a1a68 100644 (file)
@@ -25,7 +25,7 @@
 #include "zypp/Pathname.h"
 #include "zypp/IdString.h"
 #include "zypp/TriBool.h"
-
+#include "zypp/ResolverFocus.h"
 #include "zypp/DownloadMode.h"
 #include "zypp/target/rpm/RpmFlags.h"
 
@@ -39,7 +39,7 @@ namespace zypp
   //
   /** Interim helper class to collect global options and settings.
    * Use it to avoid hardcoded values and calls to getZYpp() just
-   * to retrieve some value like architecture, languages or tmppath.
+   * to retrieve some value like architecture, languages or temppath.
    *
    * It reads /etc/zypp/zypp.conf, the filename can be overridden by
    * setting the ZYPP_CONF environment variable to a different file.
@@ -73,6 +73,16 @@ namespace zypp
        */
       Pathname systemRoot() const;
 
+      /** The RepoManager root directory.
+       *  Returns the same as \ref systemRoot() if not explicitly set.
+       */
+      Pathname repoManagerRoot() const;
+
+      /** Sets the RepoManager root directory.
+       *  \sa repoManagerRoot()
+       */
+      void setRepoManagerRoot ( const Pathname &root );
+
     public:
 
       /** The autodetected system architecture. */
@@ -84,7 +94,7 @@ namespace zypp
       /** Override the zypp system architecture.
        * This is useful for test scenarious. <b>But be warned</b>, zypp does
        * not expect the system architecture to change at runtime. So
-       * set it at the verry beginning before you acess any other
+       * set it at the very beginning before you access any other
        * zypp component.
       */
       void setSystemArchitecture( const Arch & arch_r );
@@ -94,7 +104,7 @@ namespace zypp
       { setSystemArchitecture( defaultSystemArchitecture() ); }
 
     public:
-      /** The autodetected prefered locale for translated texts.
+      /** The autodetected preferred locale for translated texts.
        */
       static Locale defaultTextLocale();
 
@@ -102,7 +112,7 @@ namespace zypp
        */
       Locale textLocale() const;
 
-      /** Set the prefered locale for translated texts. */
+      /** Set the preferred locale for translated texts. */
       void setTextLocale( const Locale & locale_r );
 
       /** Reset the locale for translated texts to the default. */
@@ -134,12 +144,28 @@ namespace zypp
        */
       Pathname repoCachePath() const;
 
+      /**
+       * Set a new \a path as the default repo cache path
+       */
+      void setRepoCachePath ( const Pathname &path_r );
+
+      /**
+       * Path where the pubkey caches
+       */
+      Pathname pubkeyCachePath() const;
+
      /**
        * Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
         * \ingroup g_ZC_REPOCACHE
       */
       Pathname repoMetadataPath() const;
 
+
+      /**
+       * Set a new \a path as the default repo cache path
+       */
+      void setRepoMetadataPath ( const Pathname &path_r );
+
      /**
        * Path where the repo solv files are created and kept (repoCachePath()/solv).
         * \ingroup g_ZC_REPOCACHE
@@ -147,12 +173,22 @@ namespace zypp
       Pathname repoSolvfilesPath() const;
 
       /**
+       * Set a new \a path as the default repo cache path
+       */
+      void setRepoSolvfilesPath ( const Pathname &path_r );
+
+      /**
        * Path where the repo packages are downloaded and kept (repoCachePath()/packages).
         * \ingroup g_ZC_REPOCACHE
       */
       Pathname repoPackagesPath() const;
 
       /**
+       * Set a new \a path as the default repo cache path
+       */
+      void setRepoPackagesPath ( const Pathname &path_r );
+
+      /**
        * Path where the configfiles are kept (/etc/zypp).
        * \ingroup g_ZC_CONFIGFILES
        */
@@ -171,6 +207,25 @@ namespace zypp
       Pathname knownServicesPath() const;
 
       /**
+       * Path of the default needreboot config file (configPath()/needreboot).
+       * \ingroup g_ZC_CONFIGFILES
+       */
+      Pathname needrebootFile() const;
+
+      /**
+       * Path where the custom needreboot config files are kept (configPath()/needreboot.d).
+       * \ingroup g_ZC_CONFIGFILES
+       */
+      Pathname needrebootPath() const;
+
+      /**
+       * Path containing custom repo variable definitions (configPath()/vars.d).
+       * \see \ref zypp::repo::RepoVarExpand Repo variable expander
+       * \ingroup g_ZC_CONFIGFILES
+       */
+      Pathname varsPath() const;
+
+      /**
        * Whether repository urls should be probed.
        / config option
        * repo.add.probe
@@ -286,10 +341,18 @@ namespace zypp
        * repositories \a .repo file will overwrite the defaults here.
        */
       //@{
-      bool gpgCheck() const;           ///< Turn signature checking on/off (on)
-      TriBool repoGpgCheck() const;    ///< Check repo matadata signatures (indeterminate - according to gpgcheck)
-      TriBool pkgGpgCheck() const;     ///< Check rpm package signatures (indeterminate - according to gpgcheck)
-      //@}
+      bool gpgCheck() const;                   ///< Turn signature checking on/off (on)
+      TriBool repoGpgCheck() const;            ///< Check repo matadata signatures (indeterminate - according to gpgcheck)
+      TriBool pkgGpgCheck() const;             ///< Check rpm package signatures (indeterminate - according to gpgcheck)
+
+      void setGpgCheck( bool val_r );          ///< Change the value
+      void setRepoGpgCheck( TriBool val_r );   ///< Change the value
+      void setPkgGpgCheck( TriBool val_r );    ///< Change the value
+
+      void resetGpgCheck();                    ///< Reset to the zconfig default
+      void resetRepoGpgCheck();                        ///< Reset to the zconfig default
+      void resetPkgGpgCheck();                 ///< Reset to the zconfig default
+     //@}
       //
       /**
        * Directory for equivalent vendor definitions  (configPath()/vendors.d)
@@ -298,6 +361,11 @@ namespace zypp
       Pathname vendorPath() const;
 
       /**
+       * The resolvers general attitude when resolving jobs.
+       */
+      ResolverFocus solver_focus() const;
+
+      /**
        * Solver regards required packages,patterns,... only
        */
       bool solver_onlyRequires() const;
@@ -452,10 +520,10 @@ namespace zypp
       /** Package telling the "product version" on systems not using /etc/product.d/baseproduct.
        *
        * On RHEL, Fedora and others the "product version" is determined by the first package
-       * providing 'redhat-release'. This value is not hardcoded in YUM and can be configured
+       * providing 'system-release'. This value is not hardcoded in YUM and can be configured
        * with the $distroverpkg variable.
        *
-       * Defaults to 'redhat-release'.
+       * Defaults to 'system-release'.
        */
       std::string distroverpkg() const;
 
@@ -471,7 +539,7 @@ namespace zypp
       class Impl;
       /** Dtor */
       ~ZConfig();
-    private:
+  private:
       friend class Impl;
       /** Default ctor. */
       ZConfig();