From e46dab6ccf5e159c54550aff9aff729a42dffcf1 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 1 Nov 2016 11:15:13 +0900 Subject: [PATCH] Imported Upstream version 16.2.2 Change-Id: I0e1f69a2d6846549d1261d8a96aa976cdbf23c0d Signed-off-by: DongHun Kwak --- VERSION.cmake | 4 ++-- package/libzypp.changes | 7 +++++++ po/CMakeLists.txt | 6 +++--- po/PotfileDiff.sh | 14 ++++++++++++++ zypp/Product.h | 4 ++-- zypp/base/String.h | 35 +++++++++++++++++++++++++++++++++++ zypp/media/MediaCurl.cc | 2 +- zypp/media/MediaMultiCurl.cc | 18 +++++++++++++++++- 8 files changed, 81 insertions(+), 9 deletions(-) create mode 100755 po/PotfileDiff.sh diff --git a/VERSION.cmake b/VERSION.cmake index 376306b..8172eff 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "16") SET(LIBZYPP_COMPATMINOR "0") SET(LIBZYPP_MINOR "2") -SET(LIBZYPP_PATCH "1") +SET(LIBZYPP_PATCH "2") # -# LAST RELEASED: 16.2.1 (0) +# LAST RELEASED: 16.2.2 (0) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index 2087c87..a393689 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Aug 10 17:10:41 CEST 2016 - ma@suse.de + +- Report numeric curl error if code is unrecognized (bsc#992302) +- multicurl: propagate proxy settings stored in repo url (bsc#933839) +- version 16.2.2 (0) + +------------------------------------------------------------------- Thu Jul 21 13:09:33 CEST 2016 - ma@suse.de - Rebuild .solv-files not matching the parsers LIBSOLV_TOOLVERSION diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 18e8b22..a87e659 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -56,13 +56,13 @@ ENDFOREACH() SET( SOURCE_POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${POT_NAME}.pot ) ADD_CUSTOM_TARGET( translations ALL - COMMAND diff -u -I ^\#: -I ^.POT-Creation-Date: ${SOURCE_POT_FILE} ${POT_FILE} | grep '^[+-][^\#]' || true + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/PotfileDiff.sh ${SOURCE_POT_FILE} ${POT_FILE} | grep '^[+-][^+-]' || true DEPENDS ${GMO_FILES} + COMMENT ".pot file diff..." ) ADD_CUSTOM_TARGET( potfile_update - COMMAND diff -q -I ^\#: -I ^.POT-Creation-Date: ${SOURCE_POT_FILE} ${POT_FILE} - || ./PotfileUpadte.sh ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ./PotfileDiff.sh ${SOURCE_POT_FILE} ${POT_FILE} -q || ./PotfileUpadte.sh ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS translations COMMENT "Checking for uncommitted changes to the .pot file..." diff --git a/po/PotfileDiff.sh b/po/PotfileDiff.sh new file mode 100755 index 0000000..252e8b8 --- /dev/null +++ b/po/PotfileDiff.sh @@ -0,0 +1,14 @@ +#! /bin/bash +set -e +function extract() { grep '^\(msgid\|"\)' "$1" | grep -v "POT-Creation-Date" | sort -u; } + +OLDTMP=$(mktemp) +trap " [ -f \"$OLDTMP\" ] && /bin/rm -f -- \"$OLDTMP\" " 0 1 2 3 13 15 +extract "$1" >"$OLDTMP" + +NEWTMP=$(mktemp) +trap " [ -f \"$NEWTMP\" ] && /bin/rm -f -- \"$NEWTMP\" " 0 1 2 3 13 15 +extract "$2" >"$NEWTMP" + +shift 2 # additional args for diff +diff -u0 "$@" "$OLDTMP" "$NEWTMP" diff --git a/zypp/Product.h b/zypp/Product.h index 09d10c5..c8233a7 100644 --- a/zypp/Product.h +++ b/zypp/Product.h @@ -43,7 +43,7 @@ namespace zypp */ sat::Solvable referencePackage() const; - /** For installed products the name of the coddesponding + /** For installed products the name of the corresponding * \c /etc/products.d entry. .*/ std::string referenceFilename() const; @@ -157,7 +157,7 @@ namespace zypp /***/ class UrlList; - /** Rerieve urls flagged with \c key_r for this product. + /** Retrieve URLs flagged with \c key_r for this product. * * This is the most common interface. There are convenience methods for * wellknown flags like \c "releasenotes", \c "register", \c "updateurls", diff --git a/zypp/base/String.h b/zypp/base/String.h index 010b824..285c7dd 100644 --- a/zypp/base/String.h +++ b/zypp/base/String.h @@ -1027,14 +1027,23 @@ namespace zypp /** Return whether \a str_r has prefix \a prefix_r. */ inline bool hasPrefix( const C_Str & str_r, const C_Str & prefix_r ) { return( ::strncmp( str_r, prefix_r, prefix_r.size() ) == 0 ); } + /** \overload Case insensitive */ + inline bool hasPrefixCI( const C_Str & str_r, const C_Str & prefix_r ) + { return( ::strncasecmp( str_r, prefix_r, prefix_r.size() ) == 0 ); } /** Strip a \a prefix_r from \a str_r and return the resulting string. */ inline std::string stripPrefix( const C_Str & str_r, const C_Str & prefix_r ) { return( hasPrefix( str_r, prefix_r ) ? str_r + prefix_r.size() : str_r.c_str() ); } + /** \overload Case insensitive */ + inline std::string stripPrefixCI( const C_Str & str_r, const C_Str & prefix_r ) + { return( hasPrefixCI( str_r, prefix_r ) ? str_r + prefix_r.size() : str_r.c_str() ); } /** Return whether \a str_r has suffix \a suffix_r. */ inline bool hasSuffix( const C_Str & str_r, const C_Str & suffix_r ) { return( str_r.size() >= suffix_r.size() && ::strncmp( str_r + str_r.size() - suffix_r.size() , suffix_r, suffix_r.size() ) == 0 ); } + /** \overload Case insensitive */ + inline bool hasSuffixCI( const C_Str & str_r, const C_Str & suffix_r ) + { return( str_r.size() >= suffix_r.size() && ::strncasecmp( str_r + str_r.size() - suffix_r.size() , suffix_r, suffix_r.size() ) == 0 ); } /** Strip a \a suffix_r from \a str_r and return the resulting string. */ inline std::string stripSuffix( const C_Str & str_r, const C_Str & suffix_r ) @@ -1043,6 +1052,14 @@ namespace zypp return std::string( str_r, str_r.size() - suffix_r.size() ); return str_r.c_str(); } + /** \overload Case insensitive */ + inline std::string stripSuffixCI( const C_Str & str_r, const C_Str & suffix_r ) + { + if ( hasSuffixCI( str_r, suffix_r ) ) + return std::string( str_r, str_r.size() - suffix_r.size() ); + return str_r.c_str(); + } + /** Return size of the common prefix of \a lhs and \a rhs. */ inline std::string::size_type commonPrefix( const C_Str & lhs, const C_Str & rhs ) { @@ -1053,13 +1070,31 @@ namespace zypp { ++lp, ++rp, ++ret; } return ret; } + /** \overload Case insensitive */ + inline std::string::size_type commonPrefixCI( const C_Str & lhs, const C_Str & rhs ) + { + const char * lp = lhs.c_str(); + const char * rp = rhs.c_str(); + std::string::size_type ret = 0; + while ( tolower(*lp) == tolower(*rp) && *lp != '\0' ) + { ++lp, ++rp, ++ret; } + return ret; + } + /** alias for \ref hasPrefix */ inline bool startsWith( const C_Str & str_r, const C_Str & prefix_r ) { return hasPrefix( str_r, prefix_r ); } + /** \overload Case insensitive */ + inline bool startsWithCI( const C_Str & str_r, const C_Str & prefix_r ) + { return hasPrefixCI( str_r, prefix_r ); } + /** alias for \ref hasSuffix */ inline bool endsWith( const C_Str & str_r, const C_Str & prefix_r ) { return hasSuffix( str_r, prefix_r ); } + /** \overload Case insensitive */ + inline bool endsWithCI( const C_Str & str_r, const C_Str & prefix_r ) + { return hasSuffixCI( str_r, prefix_r ); } //@} } // namespace str /////////////////////////////////////////////////////////////////// diff --git a/zypp/media/MediaCurl.cc b/zypp/media/MediaCurl.cc index 094764a..d8ecef2 100644 --- a/zypp/media/MediaCurl.cc +++ b/zypp/media/MediaCurl.cc @@ -1062,7 +1062,7 @@ void MediaCurl::evaluateCurlCode( const Pathname &filename, break; case CURLE_SSL_PEER_CERTIFICATE: default: - err = "Unrecognized error"; + err = "Curl error " + str::numstring( code ); break; } diff --git a/zypp/media/MediaMultiCurl.cc b/zypp/media/MediaMultiCurl.cc index 9f2f072..8b2c83b 100644 --- a/zypp/media/MediaMultiCurl.cc +++ b/zypp/media/MediaMultiCurl.cc @@ -1476,6 +1476,22 @@ void MediaMultiCurl::doGetFileCopy( const Pathname & filename , const Pathname & DBG << "done: " << PathInfo(dest) << endl; } +/////////////////////////////////////////////////////////////////// +namespace { + // bsc#933839: propagate proxy settings passed in the repo URL + inline Url propagateQueryParams( Url url_r, const Url & template_r ) + { + for ( std::string param : { "proxy", "proxyport", "proxyuser", "proxypass"} ) + { + const std::string & value( template_r.getQueryParam( param ) ); + if ( ! value.empty() ) + url_r.setQueryParam( param, value ); + } + return url_r; + } +} +/////////////////////////////////////////////////////////////////// + void MediaMultiCurl::multifetch(const Pathname & filename, FILE *fp, std::vector *urllist, callback::SendReport *report, MediaBlockList *blklist, off_t filesize) const { Url baseurl(getFileUrl(filename)); @@ -1514,7 +1530,7 @@ void MediaMultiCurl::multifetch(const Pathname & filename, FILE *fp, std::vector if (scheme == "http" || scheme == "https" || scheme == "ftp" || scheme == "tftp") { checkProtocol(*urliter); - myurllist.push_back(*urliter); + myurllist.push_back(propagateQueryParams(*urliter, _url)); } } catch (...) -- 2.7.4