libzypp  16.22.5
librpmDb.cv3.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 
14 #include "zypp/base/Logger.h"
15 
18 #include "zypp/ZYppCallbacks.h"
19 
20 using namespace std;
21 
22 #undef Y2LOG
23 #define Y2LOG "librpmDb"
24 
25 namespace zypp
26 {
27 namespace target
28 {
29 namespace rpm
30 {
31 /******************************************************************
32 *
33 *
34 * FUNCTION NAME : convertV3toV4
35 *
36 * \throws RpmException
37 *
38 */
39 void convertV3toV4( const Pathname & v3db_r, const librpmDb::constPtr & v4db_r )
40 {
41  // report
43  report->start(v3db_r);
44  try
45  {
46  // Does no longer work with rpm 4.9.
47  // internal_convertV3toV4( v3db_r, v4db_r, report );
48  INT << "Unsupported: Convert rpm3 database to rpm4" << endl;
49  ZYPP_THROW(RpmDbOpenException(Pathname("/"), v3db_r));
50  }
51  catch (RpmException & excpt_r)
52  {
53  report->finish(v3db_r, ConvertDBReport::FAILED,excpt_r.asUserString());
54  ZYPP_RETHROW(excpt_r);
55  }
56  report->finish(v3db_r, ConvertDBReport::NO_ERROR, "");
57 }
58 
59 } // namespace rpm
60 } // namespace target
61 } // namespace zypp
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Definition: Exception.h:350
#define INT
Definition: Logger.h:68
#define ZYPP_RETHROW(EXCPT)
Drops a logline and rethrows, updating the CodeLocation.
Definition: Exception.h:358
Just inherits Exception to separate media exceptions.
Definition: RpmException.h:37
void convertV3toV4(const Pathname &v3db_r, const librpmDb::constPtr &v4db_r)
Definition: librpmDb.cv3.cc:39
callback::SendReport< DownloadProgressReport > * report
Definition: MediaCurl.cc:211
intrusive_ptr< const librpmDb > constPtr
Definition: librpmDb.h:42
std::string asUserString() const
Translated error message as string suitable for the user.
Definition: Exception.cc:82