ref: refs/heads/ma-misc
commit 53cb2dbd15a522e0e29e91ac04bc56bd42248fa2
Author: Michael Andres
Date: Fri Sep 18 16:31:09 2009 +0200
Make sure rpmReadConfigFiles was called before using librpm (bnc #539603).
---
zypp/target/rpm/RpmDb.cc | 2 +-
zypp/target/rpm/RpmHeader.cc | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/zypp/target/rpm/RpmDb.cc b/zypp/target/rpm/RpmDb.cc
index c1f4721..e44feb5 100644
--- a/zypp/target/rpm/RpmDb.cc
+++ b/zypp/target/rpm/RpmDb.cc
@@ -297,7 +297,7 @@ RpmDb::RpmDb()
{
process = 0;
exit_code = -1;
-
+ librpmDb::globalInit();
// Some rpm versions are patched not to abort installation if
// symlink creation failed.
setenv( "RPM_IgnoreFailedSymlinks", "1", 1 );
diff --git a/zypp/target/rpm/RpmHeader.cc b/zypp/target/rpm/RpmHeader.cc
index 78b44b5..1224ecd 100644
--- a/zypp/target/rpm/RpmHeader.cc
+++ b/zypp/target/rpm/RpmHeader.cc
@@ -153,6 +153,7 @@ int gnameToGid(const char * thisGname, gid_t * gid)
#include "zypp/base/Logger.h"
#include "zypp/base/Exception.h"
+#include "zypp/target/rpm/librpmDb.h"
#include "zypp/target/rpm/RpmHeader.h"
#include "zypp/Package.h"
#include "zypp/PathInfo.h"
@@ -226,6 +227,7 @@ RpmHeader::constPtr RpmHeader::readPackage( const Pathname & path_r,
return (RpmHeader*)0;
}
+ librpmDb::globalInit();
rpmts ts = ::rpmtsCreate();
unsigned vsflag = RPMVSF_DEFAULT;
if ( verification_r & NODIGEST )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org