- add support for yum-style distroverpkg package whose version can be
[apt.git] / apt-pkg / rpm / rpmhandler.cc
index 42b486b..0413a49 100644 (file)
@@ -371,7 +371,7 @@ RPMDBHandler::RPMDBHandler(bool WriteLock)
    Handler = rpmtsCreate();
    rpmtsSetVSFlags(Handler, (rpmVSFlags_e)-1);
    rpmtsSetRootDir(Handler, Dir.c_str());
-   if (rpmtsOpenDB(Handler, WriteLock?O_RDWR:O_RDONLY) != 0)
+   if (rpmtsOpenDB(Handler, O_RDONLY) != 0)
    {
       _error->Error(_("could not open RPM database"));
       return;
@@ -380,7 +380,7 @@ RPMDBHandler::RPMDBHandler(bool WriteLock)
    const char *RootDir = NULL;
    if (!Dir.empty())
       RootDir = Dir.c_str();
-   if (rpmdbOpen(RootDir, &Handler, WriteLock?O_RDWR:O_RDONLY, 0644) != 0)
+   if (rpmdbOpen(RootDir, &Handler, O_RDONLY, 0644) != 0)
    {
       _error->Error(_("could not open RPM database"));
       return;
@@ -405,8 +405,10 @@ RPMDBHandler::RPMDBHandler(bool WriteLock)
    rpmdbFreeIterator(countIt);
 #else
    iSize = St.st_size;
+
 #endif
 
+
    // Restore just after opening the database, and just after closing.
    if (WriteLock) {
       struct utimbuf Ut;