Imported Upstream version 15.22.1 01/94701/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 02:09:35 +0000 (11:09 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 02:09:36 +0000 (11:09 +0900)
Change-Id: I2adaf21a697dd7d46a8f559ada081c366274dfc9
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
12 files changed:
VERSION.cmake
doc/autoinclude/FeatureTest.doc
libzypp.spec.cmake
package/libzypp.changes
po/sle-zypp-po.tar.bz2
tests/media/CredentialFileReader_test.cc
tests/media/CredentialManager_test.cc
tests/media/data/credentials.cat
zypp.conf
zypp/PoolItemBest.h
zypp/RepoManager.cc
zypp/solver/detail/SATResolver.cc

index e67c39b..48365b0 100644 (file)
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "15")
 SET(LIBZYPP_COMPATMINOR "19")
 SET(LIBZYPP_MINOR "22")
-SET(LIBZYPP_PATCH "0")
+SET(LIBZYPP_PATCH "1")
 #
-# LAST RELEASED: 15.22.0 (19)
+# LAST RELEASED: 15.22.1 (19)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index 8a2090b..3a34b32 100644 (file)
@@ -41,6 +41,8 @@ Packages requiring a feature may use the corresponding \c Requires: in their .sp
     <DT>\ref plugin-services </DT>
     <DT>version 0</DT>
     <DD>Provide a client a list of repositories.</DD>
+    <DT>version 1</DT>
+    <DD>Support multiple repo baseurls in plugin services.</DD>
   </DL></DD>
 
   <DT>plugin:system</DT>
index 6006700..2f41526 100644 (file)
@@ -35,7 +35,7 @@ Obsoletes:      yast2-packagemanager
 Provides:       libzypp(plugin) = 0
 Provides:       libzypp(plugin:appdata) = 0
 Provides:       libzypp(plugin:commit) = 1
-Provides:       libzypp(plugin:services) = 0
+Provides:       libzypp(plugin:services) = 1
 Provides:       libzypp(plugin:system) = 1
 Provides:       libzypp(plugin:urlresolver) = 0
 Provides:       libzypp(repovarexpand) = 0
index f1f57fe..b5b0b0b 100644 (file)
@@ -1,4 +1,22 @@
 -------------------------------------------------------------------
+Wed Jun 15 12:41:17 CEST 2016 - ma@suse.de
+
+- Fix bug in removeRepository which may keep an empty .repo file
+  rather than deleting it (bsc#984494)
+- Provide 'libzypp(plugin:services) = 1' after fixing bsc#933760
+- version 15.22.1 (19)
+
+-------------------------------------------------------------------
+Thu Apr 28 14:17:09 CEST 2016 - ma@suse.de
+
+- Update sle-zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Apr 28 14:04:36 CEST 2016 - ma@suse.de
+
+- Update sle-zypp-po.tar.bz2
+
+-------------------------------------------------------------------
 Mon Apr 25 14:59:41 CEST 2016 - ma@suse.de
 
 - Fix credential file parser losing entries with known URL but
index 026d5be..9090885 100644 (file)
Binary files a/po/sle-zypp-po.tar.bz2 and b/po/sle-zypp-po.tar.bz2 differ
index 0dedd77..ff3c1ca 100644 (file)
@@ -34,5 +34,5 @@ BOOST_AUTO_TEST_CASE(read_cred)
   CredentialFileReader reader(credfile,
       bind( &CredCollector::collect, &collector, _1 ));
 
-  BOOST_CHECK(collector.creds.size() == 2);
+  BOOST_CHECK_EQUAL(collector.creds.size(), 3);
 }
index 3af6e66..eb1f571 100644 (file)
@@ -13,38 +13,47 @@ using std::endl;
 using namespace zypp;
 using namespace zypp::media;
 
+inline void testGetCreds( CredentialManager & cm_r, const std::string & url_r,
+                     const std::string & user_r = "",
+                     const std::string & pass_r = "" )
+{
+  Url url( url_r );
+  AuthData_Ptr cred = cm_r.getCred( url );
+  //cout << "FOR: " << url << endl;
+  //cout << "GOT: " << cred << endl;
+  if ( user_r.empty() && pass_r.empty() )
+  {
+    BOOST_CHECK_EQUAL( cred, AuthData_Ptr() );
+  }
+  else
+  {
+    BOOST_CHECK_EQUAL( cred->username(), user_r );
+    BOOST_CHECK_EQUAL( cred->password(), pass_r );
+  }
+}
 
 BOOST_AUTO_TEST_CASE(read_cred_for_url)
 {
   CredManagerOptions opts;
   opts.globalCredFilePath = TESTS_SRC_DIR "/media/data/credentials.cat";
   opts.userCredFilePath = Pathname();
+  CredentialManager cm( opts );
 
-  CredentialManager cm(opts);
-  BOOST_CHECK(cm.credsGlobalSize() == 2);
-
-  Url url("https://drink.it/repo/roots");
-  AuthData_Ptr credentials = cm.getCred(url);
-  BOOST_CHECK(credentials.get() != NULL);
-  if (!credentials)
-    return;
-  BOOST_CHECK(credentials->username() == "ginger");
-  BOOST_CHECK(credentials->password() == "ale");
-
-  Url url2("ftp://magda@weprovidesoft.fr/download/opensuse/110");
-  credentials = cm.getCred(url2);
-  BOOST_CHECK(credentials.get() != NULL);
-  if (!credentials)
-    return;
-  BOOST_CHECK(credentials->username() == "magda");
-  BOOST_CHECK(credentials->password() == "richard");
+  BOOST_CHECK_EQUAL( cm.credsGlobalSize(), 3 );
+
+  testGetCreds( cm, "https://drink.it/repo/roots",                             "ginger", "ale" );
+  testGetCreds( cm, "ftp://weprovidesoft.fr/download/opensuse/110",            "agda", "ichard" );
+  testGetCreds( cm, "ftp://magda@weprovidesoft.fr/download/opensuse/110",      "magda", "richard" );
+  testGetCreds( cm, "ftp://agda@weprovidesoft.fr/download/opensuse/110",       "agda", "ichard" );
+  testGetCreds( cm, "ftp://unknown@weprovidesoft.fr/download/opensuse/110" );  // NULL
+  testGetCreds( cm, "http://url.ok/but/not/creds" );                           // NULL
 }
 
 struct CredCollector
 {
   bool collect(AuthData_Ptr & cred)
   {
-    cout << "got: " << endl << *cred << endl;
+    //cout << "got: " << endl << *cred << endl;
     creds.insert(cred);
     return true;
   }
@@ -56,13 +65,13 @@ struct CredCollector
 BOOST_AUTO_TEST_CASE(save_creds)
 {
   filesystem::TmpDir tmp;
-
   CredManagerOptions opts;
   opts.globalCredFilePath = tmp / "fooha";
-
   CredentialManager cm1(opts);
+
   AuthData cr1("benson","absolute");
   cr1.setUrl(Url("http://joooha.com"));
+
   AuthData cr2("pat","vymetheny");
   cr2.setUrl(Url("ftp://filesuck.org"));
 
@@ -70,27 +79,19 @@ BOOST_AUTO_TEST_CASE(save_creds)
   cm1.saveInGlobal(cr1);
 
   CredCollector collector;
-  CredentialFileReader reader(opts.globalCredFilePath,
-      bind( &CredCollector::collect, &collector, _1 ));
-  BOOST_CHECK(collector.creds.size() == 1);
+  CredentialFileReader( opts.globalCredFilePath, bind( &CredCollector::collect, &collector, _1 ) );
+  BOOST_CHECK_EQUAL( collector.creds.size(), 1 );
 
-  cout << "----" << endl;
   collector.creds.clear();
-
   cm1.saveInGlobal(cr2);
+  CredentialFileReader( opts.globalCredFilePath, bind( &CredCollector::collect, &collector, _1 ) );
+  BOOST_CHECK_EQUAL(collector.creds.size(), 2 );
   
-  CredentialFileReader reader1(opts.globalCredFilePath,
-      bind( &CredCollector::collect, &collector, _1 ));
-  BOOST_CHECK(collector.creds.size() == 2);
-  
-  cout << "----" << endl;
   collector.creds.clear();
-
   // save the same creds again
   cm1.saveInGlobal(cr2);
-  CredentialFileReader reader2(opts.globalCredFilePath,
-      bind( &CredCollector::collect, &collector, _1 ));
-  BOOST_CHECK(collector.creds.size() == 2);
+  CredentialFileReader( opts.globalCredFilePath, bind( &CredCollector::collect, &collector, _1 ) );
+  BOOST_CHECK_EQUAL(collector.creds.size(), 2 );
 
   // todo check created file permissions
 }
@@ -98,30 +99,15 @@ BOOST_AUTO_TEST_CASE(save_creds)
 BOOST_AUTO_TEST_CASE(service_base_url)
 {
   filesystem::TmpDir tmp;
-
   CredManagerOptions opts;
   opts.globalCredFilePath = tmp / "fooha";
+  CredentialManager cm( opts );
 
-  CredentialManager cm1(opts);
-  AuthData cr1("benson","absolute");
-  cr1.setUrl(Url("http://joooha.com/service/path"));
-  cm1.addGlobalCred(cr1);
-
-  AuthData_Ptr creds;
-  creds = cm1.getCred(Url("http://joooha.com/service/path/repo/repofoo"));
-
-  BOOST_CHECK(creds.get() != NULL);
-  if (!creds)
-    return;
-  BOOST_CHECK(creds->username() == "benson");
-
-  creds = cm1.getCred(Url("http://benson@joooha.com/service/path/repo/repofoo"));
-
-  BOOST_CHECK(creds.get() != NULL);
-  if (!creds)
-    return;
-  BOOST_CHECK(creds->username() == "benson");
+  AuthData cred( "benson","absolute" );
+  cred.setUrl( Url( "http://joooha.com/service/path" ) );
+  cm.addGlobalCred( cred );
 
-  creds = cm1.getCred(Url("http://nobody@joooha.com/service/path/repo/repofoo"));
-  BOOST_CHECK(creds.get() == NULL);
+  testGetCreds( cm, "http://joooha.com/service/path/repo/repofoo",             "benson", "absolute" );
+  testGetCreds( cm, "http://benson@joooha.com/service/path/repo/repofoo",      "benson", "absolute" );
+  testGetCreds( cm, "http://nobody@joooha.com/service/path/repo/repofoo" );    // NULL
 }
index 23ddee1..85f713c 100644 (file)
@@ -1,15 +1,24 @@
+# no 1
 [https://drink.it/repo/roots]
 username=ginger
 password=ale
 
+#no 2
 [ftp://weprovidesoft.fr/download/opensuse/110]
 username=magda
 password=richard
 
+# no 3 - same urla s 2 but different user (lex less than magda)
+[ftp://weprovidesoft.fr/download/opensuse/110]
+username=agda
+password=ichard
+
+# fail
 [http://url.ok/but/not/creds]
 username=
 password=any
 
+# fail
 [badurl]
 username=foo
 password=bar
index 8159221..45e1725 100644 (file)
--- a/zypp.conf
+++ b/zypp.conf
 ## minutes. If an automatic request for refresh comes before <repo.refresh.delay>
 ## minutes passed since the last check, the request is ignored.
 ##
-## A value of 0 means the repository will always be checked. To get the oposite
+## A value of 0 means the repository will always be checked. To get the opposite
 ## effect, disable autorefresh for your repositories.
 ##
 ## This option has no effect for repositories with autorefresh disabled, nor for
index 40a6928..cf448da 100644 (file)
@@ -72,7 +72,7 @@ namespace zypp
     public:
       /** Default ctor. */
       PoolItemBest()
-      {}
+      { _ctor_init(); }
 
       /** Ctor feeding a \ref sat::Solvable. */
       PoolItemBest( sat::Solvable slv_r )
index b830e85..8c455c9 100644 (file)
@@ -1762,10 +1762,12 @@ namespace zypp
       {
         // figure how many repos are there in the file:
         std::list<RepoInfo> filerepos = repositories_in_file(todelete.filepath());
-        if ( (filerepos.size() == 1) && ( filerepos.front().alias() == todelete.alias() ) )
+        if ( filerepos.size() == 0     // bsc#984494: file may have already been deleted
+         ||(filerepos.size() == 1 && filerepos.front().alias() == todelete.alias() ) )
         {
-          // easy, only this one, just delete the file
-          if ( filesystem::unlink(todelete.filepath()) != 0 )
+          // easy: file does not exist, contains no or only the repo to delete: delete the file
+         int ret = filesystem::unlink( todelete.filepath() );
+          if ( ! ( ret == 0 || ret == ENOENT ) )
           {
             // TranslatorExplanation '%s' is a filename
             ZYPP_THROW(RepoException( todelete, str::form( _("Can't delete '%s'"), todelete.filepath().c_str() )));
index 7a9c350..85acbd4 100644 (file)
@@ -1077,8 +1077,10 @@ string SATResolver::SATprobleminfoString(Id problem, string &detail, Id &ignoreI
          }
          if (providerlistUninstalled.size() > 0) {
              if (detail.size() > 0)
+                 // translators: 'uninstallable' == 'not installable'
                  detail += _("\nuninstallable providers: ");
              else
+                 // translators: 'uninstallable' == 'not installable'
                  detail = _("uninstallable providers: ");
              for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
                  if (iter == providerlistUninstalled.begin())