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..."
/** 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 )
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 )
{
{ ++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
///////////////////////////////////////////////////////////////////
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<Url> *urllist, callback::SendReport<DownloadProgressReport> *report, MediaBlockList *blklist, off_t filesize) const
{
Url baseurl(getFileUrl(filename));
if (scheme == "http" || scheme == "https" || scheme == "ftp" || scheme == "tftp")
{
checkProtocol(*urliter);
- myurllist.push_back(*urliter);
+ myurllist.push_back(propagateQueryParams(*urliter, _url));
}
}
catch (...)