Imported Upstream version 15.4.1 64/94664/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:44:06 +0000 (10:44 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:44:07 +0000 (10:44 +0900)
Change-Id: I1cfcd6c54b3ee97a1a70c4c8f723f5e7f62fbfe3
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
16 files changed:
VERSION.cmake
package/libzypp.changes
po/zypp-po.tar.bz2
tests/repo/RepoVariables_test.cc
zypp/PathInfo.cc
zypp/Pathname.h
zypp/Url.h
zypp/base/Easy.h
zypp/media/MediaCIFS.cc
zypp/media/MediaCIFS.h
zypp/media/MediaManager.h
zypp/repo/PackageProvider.cc
zypp/target/TargetImpl.cc
zypp/url/UrlBase.cc
zypp/url/UrlBase.h
zypp/url/UrlUtils.cc

index ce0c6af..cb0dd81 100644 (file)
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "15")
 SET(LIBZYPP_COMPATMINOR "3")
 SET(LIBZYPP_MINOR "4")
-SET(LIBZYPP_PATCH "0")
+SET(LIBZYPP_PATCH "1")
 #
-# LAST RELEASED: 15.4.0 (3)
+# LAST RELEASED: 15.4.1 (3)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index 571d7a6..9dd9912 100644 (file)
@@ -1,4 +1,22 @@
 -------------------------------------------------------------------
+Fri Jun 12 12:14:04 CEST 2015 - ma@suse.de
+
+- Add details to the default signature verification problem report
+- PathInfo: Avoid ExternalProgram in clean_dir
+- call rpmdb2solv without executing user-supplied scripts (bnc#926853)
+- version 15.4.1 (3)
+
+-------------------------------------------------------------------
+Thu Jun 11 01:13:31 CEST 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Jun  4 01:13:22 CEST 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
 Wed Jun  3 13:00:59 CEST 2015 - ma@suse.de
 
 - Enhance solv.idx file handling to support zypper bash completion
index c3bcd7e..b683023 100644 (file)
Binary files a/po/zypp-po.tar.bz2 and b/po/zypp-po.tar.bz2 differ
index 008c7dc..892e9ab 100644 (file)
@@ -207,6 +207,11 @@ BOOST_AUTO_TEST_CASE(replace_text)
   /* check RepoVariablesUrlReplacer */
   repo::RepoVariablesUrlReplacer replacer2;
 
+//   // first of all url with {} must be accepted:
+  BOOST_CHECK_NO_THROW( Url("ftp://site.org/${arch}/?arch=${arch}") );
+  BOOST_CHECK_NO_THROW( Url("ftp://site.org/${arch:-noarch}/?arch=${arch:-noarch}") );
+  BOOST_CHECK_NO_THROW( Url("ftp://site.org/${arch:+somearch}/?arch=${arch:+somearch}") );
+
   BOOST_CHECK_EQUAL(replacer2(Url("ftp://user:secret@site.org/$arch/")).asCompleteString(),
                    "ftp://user:secret@site.org/i686/");
 
index eecff00..22ad915 100644 (file)
@@ -382,7 +382,7 @@ namespace zypp
     // METHOD NAME : recursive_rmdir
     // METHOD TYPE : int
     //
-    static int recursive_rmdir_1( const Pathname & dir )
+    static int recursive_rmdir_1( const Pathname & dir, bool removeDir = true )
     {
       DIR * dp;
       struct dirent * d;
@@ -408,7 +408,7 @@ namespace zypp
       }
       closedir( dp );
 
-      if ( ::rmdir( dir.c_str() ) < 0 )
+      if ( removeDir && ::rmdir( dir.c_str() ) < 0 )
         return errno;
 
       return 0;
@@ -448,13 +448,7 @@ namespace zypp
         return _Log_Result( ENOTDIR );
       }
 
-      string cmd( str::form( "cd '%s' && rm -rf --preserve-root -- *", path.asString().c_str() ) );
-      ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
-      for ( string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() ) {
-        MIL << "  " << output;
-      }
-      int ret = prog.close();
-      return _Log_Result( ret, "returned" );
+      return _Log_Result( recursive_rmdir_1( path, false/* don't remove path itself */ ) );
     }
 
     ///////////////////////////////////////////////////////////////////
index a0375f7..2b55090 100644 (file)
@@ -76,11 +76,11 @@ namespace zypp
       Pathname & operator=( Pathname rhs )
       { swap( *this, rhs ); return *this; }
 
-      /** Concatenate and assing. \see cat */
+      /** Concatenate and assign. \see cat */
       Pathname & operator/=( const Pathname & path_tv )
       { return( *this = cat( *this, path_tv ) ); }
 
-      /** Concatenate and assing. \see cat
+      /** Concatenate and assign. \see cat
        * \deprecated: use /=
       */
       Pathname & operator+=( const Pathname & path_tv )
index 277b879..b576882 100644 (file)
@@ -45,7 +45,7 @@ namespace zypp
    *
    * Using the Url::registerScheme() method, it is possible to register
    * a preconfigured or derived UrlBase object for a specific scheme
-   * name. The registered object will be cloned to handle all URL's
+   * name. The registered object will be cloned to handle all URLs
    * containing the specified scheme name.
    *
    * \par RFC3986, Syntax Components:
@@ -131,7 +131,7 @@ namespace zypp
      * \brief Construct a Url object from percent-encoded URL string.
      *
      * Parses the \p encodedUrl string using the parseUrl() method
-     * and assings the result to the new created object.
+     * and assigns the result to the newly created object.
      *
      * \param encodedUrl A percent-encoded URL string.
      * \throws url::UrlParsingException if parsing of the url fails.
@@ -147,8 +147,8 @@ namespace zypp
     /**
      * \brief Parse a percent-encoded URL string.
      *
-     * Trys to parses the given string into generic URL components
-     * and created a clone of a scheme-specialized object or a new
+     * Tries to parse the given string into generic URL components
+     * and creates a clone of a scheme-specialized object or a new
      * UrlBase object.
      *
      * \param encodedUrl A percent-encoded URL string.
@@ -184,10 +184,10 @@ namespace zypp
 
 
     /**
-     * \brief Assign shared copy of \p url to the current object.
+     * \brief Assign shared copy of \p url to the current object.
      *
      * Upon return, both objects will point to the same underlying
-     * object. This state will remain until one of the object is
+     * object. This state will remain until one of the objects is
      * modified.
      *
      * \param url The Url object to make a copy of.
@@ -234,7 +234,7 @@ namespace zypp
 
 
     /**
-     * \brief Verifies specified scheme name.
+     * \brief Verifies the specified scheme name.
      *
      * Verifies the generic syntax of the specified \p scheme name
      * and if it is contained in the current object's list of known
@@ -315,7 +315,7 @@ namespace zypp
      *
      * This function ignores the configuration of the view options
      * in the current object (see setViewOption()) and forces to
-     * return an string with all URL components included.
+     * return a string with all URL components included.
      *
      * \return A complete string representation of the Url object.
      */
@@ -488,8 +488,8 @@ namespace zypp
      * Returns the encoded query string component of the URL.
      *
      * The query string is returned without first "?" (separator)
-     * character. Further "?" characters as in e.g. LDAP URL's
-     * remains in the returned string.
+     * character. Further "?" characters as in e.g. LDAP URLs
+     * remain in the returned string.
      *
      * \return The encoded query string component of the URL.
      */
index aca670f..e560043 100644 (file)
@@ -28,7 +28,7 @@
 #else
 #define for_(IT,BEG,END) for ( auto IT = BEG, _for_end = END; IT != _for_end; ++IT )
 #endif
-#define for_each_(IT,CONT) for_( IT, CONT.begin(), CONT.end() )
+#define for_each_(IT,CONT) for_( IT, (CONT).begin(), (CONT).end() )
 
 /** Simple C-array iterator
  * \code
index 753c4db..27e7c86 100644 (file)
@@ -123,7 +123,7 @@ namespace zypp {
      *   or the user will be promted for them via AuthenticationReport callback.
      *
      * \note The implementation currently serves both, "smb" and
-     *      and "cifs" URL's, but passes "cifs" to the mount command
+     *      and "cifs" URLs, but passes "cifs" to the mount command
      *      in any case.
      */
     void MediaCIFS::attachTo(bool next)
index 73affb4..44f44a6 100644 (file)
@@ -25,7 +25,7 @@ namespace zypp {
     /**
      * @short Implementation class for CIFS MediaHandler
      *
-     * NOTE: The implementation serves both, "smb" and "cifs" URL's,
+     * NOTE: The implementation serves both, "smb" and "cifs" URLs,
      * but passes "cifs" to the mount command in any case.
      * @see MediaHandler
      **/
index 049da47..b2e0ed4 100644 (file)
@@ -144,7 +144,7 @@ namespace zypp
      * The MediaManager uses several media access handlers (backends),
      * that can be specified by a Media Access URL in its open() method.
      *
-     * All URL's may contain following query parameters, that are
+     * All URLs may contain following query parameters, that are
      * reserved by the Source classes and unused/ignored by the media
      * manager:
      * - <tt>alias</tt>: A source specific media alias string.
index ffec382..95b3fd2 100644 (file)
@@ -210,10 +210,13 @@ namespace zypp
       }
 
       /** Default signature verrification error handling. */
-      void defaultReportSignatureError( RpmDb::CheckPackageResult ret ) const
+      void defaultReportSignatureError( RpmDb::CheckPackageResult ret, const std::string & detail_r = std::string() ) const
       {
-       std::string msg( str::Str() << _package->asUserString() << ": " << _("Signature verification failed") << " " << ret );
-       resolveSignatureErrorAction( report()->problem( _package, repo::DownloadResolvableReport::INVALID, msg ) );
+       str::Str msg;
+       msg << _package->asUserString() << ": " << _("Signature verification failed") << " " << ret;
+       if ( ! detail_r.empty() )
+         msg << "\n" << detail_r;
+       resolveSignatureErrorAction( report()->problem( _package, repo::DownloadResolvableReport::INVALID, msg.str() ) );
       }
 
     protected:
@@ -318,7 +321,7 @@ namespace zypp
          ret.reset();
        }
         report()->start( _package, url );
-        try  // ELIMINATE try/catch by providing a log-guard
+        try
           {
             ret = doProvidePackage();
 
@@ -337,7 +340,7 @@ namespace zypp
                {
                  resolveSignatureErrorAction( userData.get( "Action", repo::DownloadResolvableReport::ABORT ) );
                }
-               else if ( userData.haskey( "Action" ) ) // pkgGpgCheck requests the default problem report
+               else if ( userData.haskey( "Action" ) ) // pkgGpgCheck requests the default problem report (wo. details)
                {
                  defaultReportSignatureError( res );
                }
@@ -354,8 +357,8 @@ namespace zypp
                    case RpmDb::CHK_NOTTRUSTED: // Signature is OK, but key is not trusted
                    case RpmDb::CHK_ERROR:      // File does not exist or can't be opened
                    default:
-                     // report problem, throw if to abort, else retry/ignore
-                     defaultReportSignatureError( res );
+                     // report problem (w. details), throw if to abort, else retry/ignore
+                     defaultReportSignatureError( res, str::Str() << userData.get<RpmDb::CheckPackageDetail>( "CheckPackageDetail" ) );
                      break;
                  }
                }
index 9849565..5ea7ca5 100644 (file)
@@ -1046,33 +1046,40 @@ namespace zypp
         // Take care we unlink the solvfile on exception
         ManagedFile guard( base, filesystem::recursive_rmdir );
 
-        std::ostringstream cmd;
-        cmd << "rpmdb2solv";
-        if ( ! _root.empty() )
-          cmd << " -r '" << _root << "'";
-       cmd << " -X";   // autogenerate pattern/product/... from -package
-       cmd << " -A";   // autogenerate application pseudo packages
-        cmd << " -p '" << Pathname::assertprefix( _root, "/etc/products.d" ) << "'";
+        ExternalProgram::Arguments cmd;
+        cmd.push_back( "rpmdb2solv" );
+        if ( ! _root.empty() ) {
+          cmd.push_back( "-r" );
+          cmd.push_back( _root.asString() );
+        }
+        cmd.push_back( "-X" ); // autogenerate pattern/product/... from -package
+        cmd.push_back( "-A" ); // autogenerate application pseudo packages
+        cmd.push_back( "-p" );
+        cmd.push_back( Pathname::assertprefix( _root, "/etc/products.d" ).asString() );
 
         if ( ! oldSolvFile.empty() )
-          cmd << " '" << oldSolvFile << "'";
+          cmd.push_back( oldSolvFile.asString() );
 
-        cmd << "  > '" << tmpsolv.path() << "'";
+        cmd.push_back( "-o" );
+        cmd.push_back( tmpsolv.path().asString() );
 
-        MIL << "Executing: " << cmd.str() << endl;
-        ExternalProgram prog( cmd.str(), ExternalProgram::Stderr_To_Stdout );
+        ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
+       std::string errdetail;
 
-        cmd << endl;
         for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() ) {
           WAR << "  " << output;
-          cmd << "     " << output;
+          if ( errdetail.empty() ) {
+            errdetail = prog.command();
+            errdetail += '\n';
+          }
+          errdetail += output;
         }
 
         int ret = prog.close();
         if ( ret != 0 )
         {
           Exception ex(str::form("Failed to cache rpm database (%d).", ret));
-          ex.remember( cmd.str() );
+          ex.remember( errdetail );
           ZYPP_THROW(ex);
         }
 
index 5238d52..0f441a8 100644 (file)
@@ -280,11 +280,11 @@ namespace zypp
       config("rx_username",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,;~\\._-]|%[a-fA-F0-9]{2})+$");
       config("rx_password",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:;~\\._-]|%[a-fA-F0-9]{2})+$");
 
-      config("rx_pathname",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:@/~\\._-]|%[a-fA-F0-9]{2})+$");
-      config("rx_pathparams",   "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:;@/~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_pathname",     "^([" a_zA_Z "0-9!$&'\\(\\){}*+=,:@/~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_pathparams",   "^([" a_zA_Z "0-9!$&'\\(\\){}*+=,:;@/~\\._-]|%[a-fA-F0-9]{2})+$");
 
-      config("rx_querystr",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:;@/?~\\._-]|%[a-fA-F0-9]{2})+$");
-      config("rx_fragment",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:;@/?~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_querystr",     "^([" a_zA_Z "0-9!$&'\\(\\){}*+=,:;@/?~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_fragment",     "^([" a_zA_Z "0-9!$&'\\(\\){}*+=,:;@/?~\\._-]|%[a-fA-F0-9]{2})+$");
     }
 
 
index e22486b..b790784 100644 (file)
@@ -263,7 +263,7 @@ namespace zypp
      *
      * The UrlBase class implements default behaviour for URL
      * manipulations and a base for implementation of scheme-
-     * specialized URL's for the Url class.
+     * specialized URLs for the Url class.
      *
      */
     class UrlBase
@@ -354,11 +354,11 @@ namespace zypp
        * or compatible to).
        *
        * For example, if your derived class implements special
-       * features of LDAP URL's, this method may return "ldap"
+       * features of LDAP URLs, this method may return "ldap"
        * and "ldaps" scheme names.
        *
        * The UrlBase class returns an empty vector, that signals
-       * that it is useable with all URL's.
+       * that it is useable with all URLs.
        *
        * \return A vector with scheme names known by this object.
        */
@@ -586,7 +586,7 @@ namespace zypp
        * Returns the encoded query string component of the URL.
        *
        * The query string is returned without first "?" (separator)
-       * character. Further "?" characters as in e.g. LDAP URL's
+       * character. Further "?" characters as in e.g. LDAP URLs
        * remains in the returned string.
        *
        * \return The encoded query string component of the URL.
index 76822f1..2d4c73e 100644 (file)
@@ -35,7 +35,7 @@ namespace zypp
       std::string skip("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                        "abcdefghijklmnopqrstuvwxyz"
                        "0123456789.~_-");
-      std::string more(":/?#[]@!$&'()*+,;=");
+      static const std::string more(URL_SAFE_CHARS);   // ":/?#[]@!$&'()*+,;="
       size_t      beg, pos, len;
       std::string out;