Imported Upstream version 17.20.0
[platform/upstream/libzypp.git] / zypp / target / rpm / RpmDb.h
index a5b8a8a..b5a1e3f 100644 (file)
@@ -59,36 +59,12 @@ public:
   //
   ///////////////////////////////////////////////////////////////////
 private:
-
+#if LEGACY(1712)
   enum DbStateInfoBits {
-    DbSI_NO_INIT       = 0x0000,
-    DbSI_HAVE_V4       = 0x0001,
-    DbSI_MADE_V4       = 0x0002,
-    DbSI_MODIFIED_V4   = 0x0004,
-    DbSI_HAVE_V3       = 0x0008,
-    DbSI_HAVE_V3TOV4   = 0x0010,
-    DbSI_MADE_V3TOV4   = 0x0020
+    DbSI_NO_INIT       = 0x0000
   };
-
-  friend std::ostream & operator<<( std::ostream & str, const DbStateInfoBits & obj );
-
-  void dbsi_set( DbStateInfoBits & val_r, const unsigned & bits_r ) const
-  {
-    val_r = (DbStateInfoBits)(val_r | bits_r);
-  }
-  void dbsi_clr( DbStateInfoBits & val_r, const unsigned & bits_r ) const
-  {
-    val_r = (DbStateInfoBits)(val_r & ~bits_r);
-  }
-  bool dbsi_has( const DbStateInfoBits & val_r, const unsigned & bits_r ) const
-  {
-    return( (val_r & bits_r) == bits_r );
-  }
-
-  /**
-   * Internal state info
-   **/
   DbStateInfoBits _dbStateInfo;
+#endif
 
   /**
    * Root directory for all operations.
@@ -100,33 +76,6 @@ private:
    **/
   Pathname _dbPath;
 
-  /**
-   * Internal helper for @ref initDatabase.
-   *
-   * \throws RpmException
-   *
-   **/
-  void internal_initDatabase( const Pathname & root_r, const Pathname & dbPath_r,
-                              DbStateInfoBits & info_r );
-
-  /**
-   * Remove the rpm4 database in dbdir_r and optionally any backup created
-   * on conversion.
-   **/
-  static void removeV4( const Pathname & dbdir_r, bool v3backup_r );
-
-  /**
-   * Remove the rpm3 database in dbdir_r. Create a backup copy named
-   * packages.rpm3 if it does not already exist.
-   **/
-  static void removeV3( const Pathname & dbdir_r, bool v3backup_r );
-
-  /**
-   * Called before the database is modified by installPackage/removePackage.
-   * Invalidates Packages list and moves away any old database.
-   **/
-  void modifyDatabase();
-
 public:
 
   /**
@@ -141,11 +90,6 @@ public:
   ~RpmDb();
 
   /**
-   * timestamp of the rpm database (last modification)
-   */
-  Date timestamp() const;
-
-  /**
    * @return Root directory for all operations (empty if not initialized).
    **/
   const Pathname & root() const
@@ -170,33 +114,20 @@ public:
   }
 
   /**
-   * Prepare access to the rpm database. Optional arguments may denote the
-   * root directory for all operations and the directory (below root) that
-   * contains the rpmdb (usg. you won't need to set this).
+   * Prepare access to the rpm database at \c/var/lib/rpm.
    *
-   * On empty Pathnames the default is used:
-   * <PRE>
-   *     root:   /
-   *     dbPath: /var/lib/rpm
-   * </PRE>
+   * An optional argument denotes the root directory for all operations. If
+   * an empty Pathname is given the default (\c/) is used.
    *
    * Calling initDatabase a second time with different arguments will return
    * an error but leave the database in it's original state.
    *
-   * Converting an old batabase is done if necessary. On update: The converted
-   * database will be removed by @ref closeDatabase, if it was not modified
-   * (no packages were installed or deleted). Otherwise the new database
-   * is kept, and the old one is removed.
-   *
-   * If the  database alredy exists and \c doRebuild_r is true, \ref rebuildDatabase
-   * is called.
+   * If the  database already exists and \c doRebuild_r is true,
+   * \ref rebuildDatabase is called.
    *
    * \throws RpmException
-   *
    **/
-  void initDatabase( Pathname root_r = Pathname(),
-                     Pathname dbPath_r = Pathname(),
-                     bool doRebuild_r = false );
+  void initDatabase( Pathname root_r = Pathname(), bool doRebuild_r = false );
 
   /**
    * Block further access to the rpm database and go back to uninitialized
@@ -399,9 +330,10 @@ private:
   /** create package backups? */
   bool _packagebackups;
 
+#if LEGACY(1712)
   /** whether <_root>/<WARNINGMAILPATH> was already created */
   bool _warndirexists;
-
+#endif
   /**
    * handle rpm messages like "/etc/testrc saved as /etc/testrc.rpmorig"
    *