Imported Upstream version 17.11.1 upstream/17.11.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 2 Sep 2019 07:19:07 +0000 (16:19 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 2 Sep 2019 07:19:07 +0000 (16:19 +0900)
16 files changed:
VERSION.cmake
package/libzypp.changes
po/hu.po
po/ko.po
po/pl.po
po/ro.po
po/ru.po
tests/zypp/Url_test.cc
zypp/Url.cc
zypp/media/MediaCurl.cc
zypp/media/MediaCurl.h
zypp/misc/CheckAccessDeleted.cc
zypp/repo/RepoVariables.cc
zypp/sat/detail/PoolImpl.cc
zypp/target/rpm/RpmDb.cc
zypp/target/rpm/librpmDb.cc

index 0c908e7..6e28215 100644 (file)
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "17")
 SET(LIBZYPP_COMPATMINOR "9")
 SET(LIBZYPP_MINOR "11")
-SET(LIBZYPP_PATCH "0")
+SET(LIBZYPP_PATCH "1")
 #
-# LAST RELEASED: 17.11.0 (9)
+# LAST RELEASED: 17.11.1 (9)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index d71969c..8292163 100644 (file)
@@ -1,4 +1,17 @@
 -------------------------------------------------------------------
+Thu Jan 31 17:41:21 CET 2019 - ma@suse.de
+
+- CheckAccessDeleted: Suppress reporting `/memfd:` pseudo files
+  (bsc#1123843)
+- MediaCurl: improve reporting https->http redirection errors
+- Prevent SEGV if the application sets an empty TextLocale
+- Url: don't force printing an empty authority if the schema does not
+  allow authority at all
+- Try to the missing rpmDB compat symlink in case the rpm package got
+  deleted (bsc#1122471)
+- version 17.11.1 (9)
+
+-------------------------------------------------------------------
 Fri Jan 11 10:24:33 CET 2019 - ma@suse.de
 
 - PoolItemBest: Optionally prefer not locked packages (for bsc#1113296)
index c5105e7..8dc6473 100644 (file)
--- a/po/hu.po
+++ b/po/hu.po
@@ -19,7 +19,7 @@ msgstr ""
 "Project-Id-Version: zypp.hu\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-08-03 11:09+0200\n"
-"PO-Revision-Date: 2018-04-12 12:07+0000\n"
+"PO-Revision-Date: 2019-01-25 20:07+0000\n"
 "Last-Translator: Robert Taisz <robert.taisz@emerald.hu>\n"
 "Language-Team: Hungarian <https://l10n.opensuse.org/projects/libzypp/master/"
 "hu/>\n"
@@ -28,7 +28,7 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
 
 #: zypp/target/hal/HalException.h:46 zypp/target/hal/HalException.h:55
 #: zypp/target/hal/HalException.h:64
@@ -4054,20 +4054,20 @@ msgstr[1] "(%d napon belül lejár)"
 #: zypp/RepoInfo.cc:513
 #, boost-format
 msgid "Looking for gpg key ID %1% in cache %2%."
-msgstr ""
+msgstr "%1% azonosítójú gpg-kulcs keresése a gyorsítótárban (%2%)."
 
 #. translator: %1% is a gpg key ID like 3DBDC284
 #. %2% is a repositories name
 #: zypp/RepoInfo.cc:541
 #, boost-format
 msgid "Looking for gpg key ID %1% in repository %2%."
-msgstr ""
+msgstr "%1% azonosítójú gpg-kulcs keresése a telepítési forrásban (%2%)."
 
 #. translator: %1% is a repositories name
 #: zypp/RepoInfo.cc:565
 #, boost-format
 msgid "Repository %1% does not define additional 'gpgkey=' URLs."
-msgstr ""
+msgstr "A(z) %1% telepítési forrás nem definiál további 'gpgkey=' URL-címeket."
 
 #: zypp/RepoManager.cc:314
 #, boost-format
@@ -4485,6 +4485,8 @@ msgstr "Időtúllépés a '%s' elérése közben."
 #, c-format, boost-format
 msgid "Downloaded data exceeded the expected filesize '%s' of '%s'."
 msgstr ""
+"A letöltött adatok mérete meghaladta a várt fájlméretet: '%s' (összesen: "
+"'%s')."
 
 #: zypp/media/MediaException.cc:203
 #, c-format, boost-format
index e8137e2..f1fe046 100644 (file)
--- a/po/ko.po
+++ b/po/ko.po
@@ -9,16 +9,16 @@ msgstr ""
 "Project-Id-Version: zypp.ko\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-08-03 11:09+0200\n"
-"PO-Revision-Date: 2018-04-17 05:21+0000\n"
+"PO-Revision-Date: 2019-01-24 19:41+0000\n"
 "Last-Translator: Hwajin Kim <hwajin.kim@e4net.net>\n"
-"Language-Team: Korean <https://l10n.opensuse.org/projects/libzypp/master/ko/"
-">\n"
+"Language-Team: Korean <https://l10n.opensuse.org/projects/libzypp/master/ko/>"
+"\n"
 "Language: ko\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
 "X-Poedit-SourceCharset: UTF-8\n"
 
 #: zypp/target/hal/HalException.h:46 zypp/target/hal/HalException.h:55
@@ -3960,22 +3960,22 @@ msgstr[0] "%d(24시간 내 만료)"
 #. translator: %1% is a gpg key ID like 3DBDC284
 #. %2% is a cache directories path
 #: zypp/RepoInfo.cc:513
-#, boost-format
+#, boost-format, fuzzy
 msgid "Looking for gpg key ID %1% in cache %2%."
-msgstr ""
+msgstr "%2% 캐시에서 gpg 키 ID %1%을(를) 검색합니다."
 
 #. translator: %1% is a gpg key ID like 3DBDC284
 #. %2% is a repositories name
 #: zypp/RepoInfo.cc:541
-#, boost-format
+#, boost-format, fuzzy
 msgid "Looking for gpg key ID %1% in repository %2%."
-msgstr ""
+msgstr "%2% 리포지토리에서 gpg 키 ID %1%을(를) 검색합니다."
 
 #. translator: %1% is a repositories name
 #: zypp/RepoInfo.cc:565
-#, boost-format
+#, boost-format, fuzzy
 msgid "Repository %1% does not define additional 'gpgkey=' URLs."
-msgstr ""
+msgstr "%1% 리포지토리에서 추가 'gpgkey=' URL을 정의하지 않습니다."
 
 #: zypp/RepoManager.cc:314
 #, boost-format
@@ -4385,9 +4385,9 @@ msgid "Timeout exceeded when accessing '%s'."
 msgstr "'%s'에 액세스할 때 제한 시간이 초과되었습니다."
 
 #: zypp/media/MediaException.cc:195
-#, c-format, boost-format
+#, boost-format, c-format, fuzzy
 msgid "Downloaded data exceeded the expected filesize '%s' of '%s'."
-msgstr ""
+msgstr "다운로드한 데이터가 예상 파일 크기 '%s'/'%s'을(를) 초과했습니다."
 
 #: zypp/media/MediaException.cc:203
 #, c-format, boost-format
index 3ad28b8..9b02d91 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,17 +8,17 @@ msgstr ""
 "Project-Id-Version: zypp\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-08-03 11:09+0200\n"
-"PO-Revision-Date: 2018-04-19 14:22+0000\n"
+"PO-Revision-Date: 2019-01-25 20:07+0000\n"
 "Last-Translator: Ewelina Michalowska <ewelina.michalowska@stgambit.com>\n"
-"Language-Team: Polish <https://l10n.opensuse.org/projects/libzypp/master/pl/"
-">\n"
+"Language-Team: Polish <https://l10n.opensuse.org/projects/libzypp/master/pl/>"
+"\n"
 "Language: pl\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
 "|| n%100>=20) ? 1 : 2;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.3\n"
 
 #: zypp/target/hal/HalException.h:46 zypp/target/hal/HalException.h:55
 #: zypp/target/hal/HalException.h:64
@@ -3774,20 +3774,20 @@ msgstr[2] "(wygasa w ciągu %d dni)"
 #: zypp/RepoInfo.cc:513
 #, boost-format
 msgid "Looking for gpg key ID %1% in cache %2%."
-msgstr ""
+msgstr "Wyszukiwanie identyfikatora %1% klucza gpg w buforze %2%."
 
 #. translator: %1% is a gpg key ID like 3DBDC284
 #. %2% is a repositories name
 #: zypp/RepoInfo.cc:541
 #, boost-format
 msgid "Looking for gpg key ID %1% in repository %2%."
-msgstr ""
+msgstr "Wyszukiwanie identyfikatora %1% klucza gpg w repozytorium %2%."
 
 #. translator: %1% is a repositories name
 #: zypp/RepoInfo.cc:565
 #, boost-format
 msgid "Repository %1% does not define additional 'gpgkey=' URLs."
-msgstr ""
+msgstr "Repozytorium %1% nie definiuje dodatkowych adresów URL 'gpgkey='."
 
 #: zypp/RepoManager.cc:314
 #, boost-format
@@ -4201,7 +4201,7 @@ msgstr "Przekroczono limit czasu podczas dostępu do '%s'."
 #: zypp/media/MediaException.cc:195
 #, c-format, boost-format
 msgid "Downloaded data exceeded the expected filesize '%s' of '%s'."
-msgstr ""
+msgstr "Pobrane dane przekroczyły oczekiwany rozmiar pliku '%s' z '%s'."
 
 #: zypp/media/MediaException.cc:203
 #, c-format, boost-format
index 5deb1b9..91c7126 100644 (file)
--- a/po/ro.po
+++ b/po/ro.po
@@ -19,7 +19,7 @@
 # Alexandru Szasz <alexxed@gmail.com>
 # strainu <narro@strainu.ro>
 #
-# Comunitatea romana openSUSE - www.suseromania.ro\r
+# Comunitatea romana openSUSE - www.suseromania.ro
 msgid ""
 msgstr ""
 "Project-Id-Version: OpenSUSE\n"
index ddb6d3d..e9e5ece 100644 (file)
--- a/po/ru.po
+++ b/po/ru.po
@@ -14,17 +14,17 @@ msgstr ""
 "Project-Id-Version: zypp.ru\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-08-03 11:09+0200\n"
-"PO-Revision-Date: 2018-04-18 13:07+0000\n"
-"Last-Translator: Nikita Maynagashev <maynagashev@palex.ru>\n"
+"PO-Revision-Date: 2019-01-24 22:36+0000\n"
+"Last-Translator: Alex Minton <alex239@gmail.com>\n"
 "Language-Team: Russian <https://l10n.opensuse.org/projects/libzypp/master/ru/"
 ">\n"
 "Language: ru\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
-"X-Generator: Weblate 2.18\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<="
+"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 3.3\n"
 
 #: zypp/target/hal/HalException.h:46 zypp/target/hal/HalException.h:55
 #: zypp/target/hal/HalException.h:64
@@ -3778,20 +3778,20 @@ msgstr[2] "(истекает через %d дней)"
 #: zypp/RepoInfo.cc:513
 #, boost-format
 msgid "Looking for gpg key ID %1% in cache %2%."
-msgstr ""
+msgstr "Поиск ID gpg-ключа %1% в кэше %2%."
 
 #. translator: %1% is a gpg key ID like 3DBDC284
 #. %2% is a repositories name
 #: zypp/RepoInfo.cc:541
 #, boost-format
 msgid "Looking for gpg key ID %1% in repository %2%."
-msgstr ""
+msgstr "Поиск ID gpg-ключа %1% в репозитории %2%."
 
 #. translator: %1% is a repositories name
 #: zypp/RepoInfo.cc:565
 #, boost-format
 msgid "Repository %1% does not define additional 'gpgkey=' URLs."
-msgstr ""
+msgstr "Репозиторий %1% не определяет дополнительных URL вида «gpgkey=»."
 
 #: zypp/RepoManager.cc:314
 #, boost-format
@@ -4206,7 +4206,7 @@ msgstr "Превышено время ожидания при попытке д
 #: zypp/media/MediaException.cc:195
 #, c-format, boost-format
 msgid "Downloaded data exceeded the expected filesize '%s' of '%s'."
-msgstr ""
+msgstr "Размер загруженных данных превысил ожидаемый '%s' из '%s'."
 
 #: zypp/media/MediaException.cc:203
 #, c-format, boost-format
index ad82d48..36f142c 100644 (file)
@@ -8,6 +8,8 @@
 #include "zypp/base/Exception.h"
 #include "zypp/base/String.h"
 
+#include "zypp/RepoInfo.h"
+
 #include "zypp/Url.h"
 #include <stdexcept>
 #include <iostream>
@@ -63,17 +65,18 @@ BOOST_AUTO_TEST_CASE(test_url1)
     BOOST_CHECK_EQUAL( str, url.asString() );
     BOOST_CHECK_EQUAL( str, url.asCompleteString() );
 
-    // asString & asCompleteString should add empty authority
-    // "dvd://...", except we request to avoid it.
-    str = "dvd:/srv/ftp";
-    one = "dvd:///srv/ftp";
-    two = "dvd:///srv/ftp";
-    url = str;
+    // In general, schema without authority allows specifying an empty authority
+    // though it should not be printed (unless explicitly requested).
+    BOOST_CHECK_EQUAL( Url("dvd:/srv/ftp").asCompleteString(),   "dvd:/srv/ftp" );
+    BOOST_CHECK_EQUAL( Url("dvd:/srv/ftp").asString(),           "dvd:/srv/ftp" );
 
-    BOOST_CHECK_EQUAL( one, url.asString() );
-    BOOST_CHECK_EQUAL( two, url.asCompleteString() );
-    BOOST_CHECK_EQUAL( str, url.asString(zypp::url::ViewOptions() -
-                                 zypp::url::ViewOption::EMPTY_AUTHORITY));
+    BOOST_CHECK_EQUAL( Url("dvd:///srv/ftp").asCompleteString(), "dvd:/srv/ftp" );
+    BOOST_CHECK_EQUAL( Url("dvd:///srv/ftp").asString(),         "dvd:/srv/ftp" );
+
+    BOOST_CHECK_EQUAL( Url("dvd:///srv/ftp").asString(url::ViewOption::DEFAULTS+url::ViewOption::EMPTY_AUTHORITY),        "dvd:///srv/ftp" );
+    BOOST_CHECK_EQUAL( Url("dvd:///srv/ftp").asString(url::ViewOption::DEFAULTS-url::ViewOption::EMPTY_AUTHORITY),        "dvd:/srv/ftp" );
+
+    BOOST_CHECK_THROW( Url("dvd://authority/srv/ftp"), url::UrlNotAllowedException );
 
     // asString shouldn't print the password, asCompleteString should
     // further, the "//" at the begin of the path should become "/%2F"
@@ -157,7 +160,6 @@ BOOST_AUTO_TEST_CASE(test_url1)
 
     // OK, valid (no host, path is there)
     str = "cd:///some/path";
-    BOOST_CHECK_EQUAL( str, zypp::Url(str).asString());
     BOOST_CHECK( zypp::Url(str).isValid());
 }
 
@@ -280,6 +282,24 @@ BOOST_AUTO_TEST_CASE( test_url5)
   BOOST_CHECK_EQUAL( Url(zypp::url::encode( str, URL_SAFE_CHARS )).asString(), str );
 }
 
+BOOST_AUTO_TEST_CASE(plugin_scriptpath)
+{
+  // plugin script path must not be rewritten
+  for ( const std::string & t : { "script", "script/", "/script", "/script/", "./script", "./script/" } )
+  {
+    BOOST_CHECK_EQUAL( Url("plugin:"+t).getPathName(), t );
+  }
+
+  { // more cosmetic issue, but the RepoVarReplacer should
+    // not change the string representation (-> "plugin:/script")
+    Url u( "plugin:script?opt=val" );
+    RepoInfo i;
+    i.setBaseUrl( u );
+    BOOST_CHECK_EQUAL( u.asString(), i.url().asString() );
+  }
+
+}
+
 BOOST_AUTO_TEST_CASE(plugin_querystring_args)
 {
   // url querysting options without value must be possible
index 9755bcb..35f64da 100644 (file)
@@ -181,6 +181,10 @@ namespace zypp
 
         // =====================================
         ref.reset( new UrlBase());
+        // don't show empty authority
+        ref->setViewOptions( zypp::url::ViewOption::DEFAULTS -
+                             zypp::url::ViewOption::EMPTY_AUTHORITY);
+
         ref->config("with_authority",   "n");   // disallow host,...
         ref->config("require_pathname", "m");   // path is mandatory
         addUrlByScheme("hd",     ref);
@@ -189,9 +193,6 @@ namespace zypp
         addUrlByScheme("dir",    ref);
         addUrlByScheme("iso",    ref);
 
-        // don't show empty authority
-        ref->setViewOptions( zypp::url::ViewOption::DEFAULTS -
-                             zypp::url::ViewOption::EMPTY_AUTHORITY);
         addUrlByScheme("mailto", ref);
         addUrlByScheme("urn",    ref);
         addUrlByScheme("plugin", ref); // zypp plugable media handler:
index 1d16827..8663f35 100644 (file)
@@ -114,13 +114,11 @@ namespace
     return 0;
   }
 
-  static size_t
-  log_redirects_curl(
-      void *ptr, size_t size, size_t nmemb, void *stream)
+  static size_t log_redirects_curl( char *ptr, size_t size, size_t nmemb, void *userdata)
   {
-    // INT << "got header: " << string((char *)ptr, ((char*)ptr) + size*nmemb) << endl;
+    // INT << "got header: " << string(ptr, ptr + size*nmemb) << endl;
 
-    char * lstart = (char *)ptr, * lend = (char *)ptr;
+    char * lstart = ptr, * lend = ptr;
     size_t pos = 0;
     size_t max = size * nmemb;
     while (pos + 1 < max)
@@ -129,10 +127,21 @@ namespace
       for (lstart = lend; *lend != '\n' && pos < max; ++lend, ++pos);
 
       // look for "Location"
-      string line(lstart, lend);
-      if (line.find("Location") != string::npos)
+      if ( lstart[0] == 'L'
+       && lstart[1] == 'o'
+       && lstart[2] == 'c'
+       && lstart[3] == 'a'
+       && lstart[4] == 't'
+       && lstart[5] == 'i'
+       && lstart[6] == 'o'
+       && lstart[7] == 'n'
+       && lstart[8] == ':' )
       {
+       std::string line { lstart, *(lend-1)=='\r' ? lend-1 : lend };
         DBG << "redirecting to " << line << endl;
+       if ( userdata ) {
+         *reinterpret_cast<std::string *>( userdata ) = line;
+       }
         return max;
       }
 
@@ -667,6 +676,7 @@ void MediaCurl::setupEasy()
   }
 
   curl_easy_setopt(_curl, CURLOPT_HEADERFUNCTION, log_redirects_curl);
+  curl_easy_setopt(_curl, CURLOPT_HEADERDATA, &_lastRedirect);
   CURLcode ret = curl_easy_setopt( _curl, CURLOPT_ERRORBUFFER, _curlError );
   if ( ret != 0 ) {
     ZYPP_THROW(MediaCurlSetOptException(_url, "Error setting error buffer"));
@@ -1078,6 +1088,14 @@ void MediaCurl::evaluateCurlCode(const Pathname &filename,
       switch ( code )
       {
       case CURLE_UNSUPPORTED_PROTOCOL:
+         err = " Unsupported protocol";
+         if ( !_lastRedirect.empty() )
+         {
+           err += " or redirect (";
+           err += _lastRedirect;
+           err += ")";
+         }
+         break;
       case CURLE_URL_MALFORMAT:
       case CURLE_URL_MALFORMAT_USER:
           err = " Bad URL";
@@ -1219,6 +1237,7 @@ bool MediaCurl::doGetDoesFileExist( const Pathname & filename ) const
     // encoded slash as %2f) "ftp://user@host/%2ffoo/bar/file"
     // contains an absolute path.
   //
+  _lastRedirect.clear();
   string urlBuffer( curlUrl.asString());
   CURLcode ret = curl_easy_setopt( _curl, CURLOPT_URL,
                                    urlBuffer.c_str() );
@@ -1523,6 +1542,7 @@ void MediaCurl::doGetFileCopyFile(const Pathname & filename , const Pathname & d
     // encoded slash as %2f) "ftp://user@host/%2ffoo/bar/file"
     // contains an absolute path.
     //
+    _lastRedirect.clear();
     string urlBuffer( curlUrl.asString());
     CURLcode ret = curl_easy_setopt( _curl, CURLOPT_URL,
                                      urlBuffer.c_str() );
index 209ff06..0d5adaa 100644 (file)
@@ -170,6 +170,8 @@ class MediaCurl : public MediaHandler
     std::string _currentCookieFile;
     static Pathname _cookieFile;
 
+    mutable std::string _lastRedirect; ///< to log/report redirections
+
   protected:
     CURL *_curl;
     char _curlError[ CURL_ERROR_SIZE ];
index bfd6b19..0fff3d1 100644 (file)
@@ -262,6 +262,7 @@ namespace zypp
         , "/dev/"
         , "/tmp/"
         , "/proc/"
+       , "/memfd:"
       };
       for_( it, arrayBegin( black ), arrayEnd( black ) )
       {
index 8370cbb..f09417c 100644 (file)
@@ -548,7 +548,7 @@ namespace zypp
 
     Url RepoVariablesUrlReplacer::operator()( const Url & value ) const
     {
-      static const Url::ViewOptions toReplace = url::ViewOption::DEFAULTS - url::ViewOption::WITH_USERNAME - url::ViewOption::WITH_PASSWORD;
+      Url::ViewOptions toReplace = value.getViewOptions() - url::ViewOption::WITH_USERNAME - url::ViewOption::WITH_PASSWORD;
       const std::string & replaced( RepoVarExpand()( value.asString( toReplace ), RepoVarsMap::lookup ) );
       Url newurl;
       if ( !replaced.empty() )
@@ -556,6 +556,7 @@ namespace zypp
        newurl = replaced;
        newurl.setUsername( value.getUsername( url::E_ENCODED ), url::E_ENCODED );
        newurl.setPassword( value.getPassword( url::E_ENCODED ), url::E_ENCODED );
+       newurl.setViewOptions( value.getViewOptions() );
       }
       return newurl;
     }
index 00224df..520b093 100644 (file)
@@ -426,6 +426,13 @@ namespace zypp
 
       void PoolImpl::setTextLocale( const Locale & locale_r )
       {
+       if ( ! locale_r )
+       {
+         // We need one, so "en" is the last resort
+         const char *needone[] { "en" };
+         ::pool_set_languages( _pool, needone, 1 );
+       }
+
        std::vector<std::string> fallbacklist;
        for ( Locale l( locale_r ); l; l = l.fallback() )
        {
index 298f272..c84f01f 100644 (file)
@@ -59,6 +59,9 @@ using namespace zypp::filesystem;
 
 #define WORKAROUNDRPMPWDBUG
 
+#undef ZYPP_BASE_LOGGER_LOGGROUP
+#define ZYPP_BASE_LOGGER_LOGGROUP "librpmDb"
+
 namespace zypp
 {
   namespace zypp_readonly_hack
@@ -331,6 +334,14 @@ void RpmDb::initDatabase( Pathname root_r, Pathname dbPath_r, bool doRebuild_r )
     ZYPP_THROW(RpmInvalidRootException(root_r, dbPath_r));
   }
 
+  if ( dbPath_r == "/var/lib/rpm"
+    && ! PathInfo( root_r/"/var/lib/rpm" ).isExist()
+    && PathInfo( root_r/"/usr/lib/sysimage/rpm" ).isDir() )
+  {
+    WAR << "Rpm package was deleted? Injecting missing rpmdb compat symlink." << endl;
+    filesystem::symlink( "../../usr/lib/sysimage/rpm", root_r/"/var/lib/rpm" );
+  }
+
   MIL << "Calling initDatabase: " << stringPath( root_r, dbPath_r )
       << ( doRebuild_r ? " (rebuilddb)" : "" )
       << ( quickinit ? " (quickinit)" : "" ) << endl;
index cc419dd..f7253e5 100644 (file)
@@ -19,6 +19,9 @@
 #include "zypp/target/rpm/RpmHeader.h"
 #include "zypp/target/rpm/RpmException.h"
 
+#undef ZYPP_BASE_LOGGER_LOGGROUP
+#define ZYPP_BASE_LOGGER_LOGGROUP "librpmDb"
+
 using namespace std;
 
 namespace zypp
@@ -114,8 +117,8 @@ public:
 //
 ///////////////////////////////////////////////////////////////////
 
-Pathname         librpmDb::_defaultRoot  ( "/" );
-Pathname         librpmDb::_defaultDbPath( "/var/lib/rpm" );
+Pathname         librpmDb::_defaultRoot;       // Remembered arg to last dbAccess call
+Pathname         librpmDb::_defaultDbPath;     // Remembered arg to last dbAccess call
 librpmDb::constPtr librpmDb::_defaultDb;
 bool             librpmDb::_dbBlocked    ( true );