From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Date: Wed, 12 Sep 2012 11:36:08 +0400 From: "Ivan A. Melnikov" To: devel@lists.altlinux.org Message-ID: <20120912113608.28e30d7d@deimos.localdomain> In-Reply-To: <50502FE9.10507@yandex.ru> References: <20120905080503.0135b097@deimos.localdomain> <504E9836.7020102@yandex.ru> <20120911084802.503934d8@deimos.localdomain> <50501500.9070804@yandex.ru> <20120912093042.2ceae256@deimos.localdomain> <50502FE9.10507@yandex.ru> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.12; x86_64-alt-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/3cqWJpNwgmbTQBJmBP=D72L" Subject: Re: [devel] IA: boost 1.51.0 X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 07:36:13 -0000 Archived-At: List-Archive: List-Post: --MP_/3cqWJpNwgmbTQBJmBP=D72L Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wed, 12 Sep 2012 10:47:05 +0400 =D0=A0=D0=B0=D0=B4=D0=B8=D0=BA =D0=AE=D1=81=D1=83=D0=BF=D0=BE=D0=B2 wrote: > On 12.09.2012 09:30, Ivan A. Melnikov wrote: > > =D0=92=D1=8B =D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0= =B0=D0=BB=D0=B8 =D0=BC=D0=BE=D0=B9 =D0=BF=D0=B0=D1=82=D1=87 =D0=B8=D0=BB=D0= =B8 =D0=B0=D0=BF=D1=81=D1=82=D1=80=D0=B8=D0=BC=D0=BD=D1=8B=D0=B9 =D0=BA=D0= =BE=D0=BC=D0=BC=D0=B8=D1=82? > > > > =D0=95=D1=81=D0=BB=D0=B8 =D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1=82 c6c79be, = =D1=82=D0=BE =D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B8=D1=82=D0=B5 =D0=B5= =D1=89=D1=91 =D0=BE=D0=B4=D0=B8=D0=BD (dc4868), boost_compat.h > > =D1=82=D0=B0=D0=BC. > =D0=AF =D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BB= =D0=92=D0=B0=D1=88 =D0=BF=D0=B0=D1=82=D1=87:=20 > http://git.altlinux.org/people/radik/packages/zarafa.git >=20 =D0=9F=D1=80=D0=BE=D1=88=D1=83 =D0=BF=D1=80=D0=BE=D1=89=D0=B5=D0=BD=D0=B8= =D1=8F, =D1=8F =D0=BD=D0=B0=D0=BA=D0=BE=D1=81=D1=8F=D1=87=D0=B8=D0=BB =D1= =81 =D0=B3=D0=B8=D1=82=D0=BE=D0=BC. =D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D1= =91=D0=BD=D0=BD=D1=8B=D0=B9 =D0=BF=D0=B0=D1=82=D1=87 =D0=BF=D1=80=D0=B8=D0= =BB=D0=B0=D0=B3=D0=B0=D1=8E. --=20 WBR, Ivan A. Melnikov --MP_/3cqWJpNwgmbTQBJmBP=D72L Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=zarafa-7.1.0-boost-filesystem-v3-support.patch This patch combines two upstream revisions from master branch, without modifications of common/ecversion.h. >>From c6c79be9cb538fcce3457c9568a3dc6ae39134ea Mon Sep 17 00:00:00 2001 From: marks Date: Mon, 27 Aug 2012 12:16:44 +0200 Subject: [PATCH] Committing svn revision 36808: For ZCP-10446: Support both v2 and v3 of the boost::filesystem library. #time 1.5h #review +review CR-ZCP @john --- common/ECConfigImpl.cpp | 24 ++++++++--------- common/ecversion.h | 32 +++++++++++----------- configure | 51 +---------------------------------- configure.ac | 32 +---------------------- mapi4linux/src/m4l.mapisvc.cpp | 6 +++- provider/libserver/ECSession.cpp | 3 +- provider/server/ECClientUpdate.cpp | 7 +++-- 7 files changed, 40 insertions(+), 115 deletions(-) --- >>From dc4868099fc3099d1949fbd89ca3c1c318476234 Mon Sep 17 00:00:00 2001 From: marks Date: Tue, 28 Aug 2012 07:58:06 +0200 Subject: [PATCH] Committing svn revision 36820: For ZCP-10446: Add boost_compat.h to Makefile.am. #time 1m +review CR-ZCP-1085 --- common/Makefile.am | 2 +- common/Makefile.in | 2 +- common/boost_compat.h | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ common/ecversion.h | 32 +++++++++--------- 4 files changed, 105 insertions(+), 18 deletions(-) create mode 100644 common/boost_compat.h diff --git a/zarafa/common/ECConfigImpl.cpp b/zarafa/common/ECConfigImpl.cpp index 4ee458f..b5c923f 100644 --- a/zarafa/common/ECConfigImpl.cpp +++ b/zarafa/common/ECConfigImpl.cpp @@ -60,6 +60,8 @@ #include "charset/convert.h" +#include "boost_compat.h" + using namespace std; #ifdef _DEBUG @@ -69,7 +71,6 @@ static char THIS_FILE[] = __FILE__; #endif #include - namespace fs = boost::filesystem; const directive_t ECConfigImpl::s_sDirectives[] = { @@ -351,11 +352,11 @@ bool ECConfigImpl::ReadConfigFile(const path_type &file, unsigned int ulFlags, u m_currentFile = file; if (!exists(file)) { - errors.push_back("Config file '" + file.file_string() + "' does not exist."); + errors.push_back("Config file '" + path_to_string(file) + "' does not exist."); goto exit; } if (is_directory(file)) { - errors.push_back("Config file '" + file.file_string() + "' is a directory."); + errors.push_back("Config file '" + path_to_string(file) + "' is a directory."); goto exit; } @@ -367,8 +368,8 @@ bool ECConfigImpl::ReadConfigFile(const path_type &file, unsigned int ulFlags, u m_readFiles.insert(file); - if(!(fp = fopen(file.file_string().c_str(), "rt"))) { - errors.push_back("Unable to open config file '" + file.file_string() + "'"); + if(!(fp = fopen(path_to_string(file).c_str(), "rt"))) { + errors.push_back("Unable to open config file '" + path_to_string(file) + "'"); goto exit; } @@ -453,9 +454,6 @@ bool ECConfigImpl::HandleDirective(string &strLine, unsigned int ulFlags) } -#if (((BOOST_VERSION / 100) % 1000) < 36) - #define remove_filename remove_leaf -#endif bool ECConfigImpl::HandleInclude(const char *lpszArgs, unsigned int ulFlags) { string strValue; @@ -464,7 +462,7 @@ bool ECConfigImpl::HandleInclude(const char *lpszArgs, unsigned int ulFlags) file = (strValue = trim(lpszArgs, " \t\r\n")); if (!file.is_complete()) { // Rebuild the path - file = m_currentFile.remove_filename(); + file = remove_filename_from_path(m_currentFile); file /= strValue; } @@ -689,8 +687,8 @@ bool ECConfigImpl::WriteSettingsToFile(const char* szFileName) fs::path pathBakFile; pathOutFile = pathBakFile = szFileName; - pathOutFile.remove_filename() /= "config_out.cfg"; - pathBakFile.remove_filename() /= "config_bak.cfg"; + remove_filename_from_path(pathOutFile) /= "config_out.cfg"; + remove_filename_from_path(pathBakFile) /= "config_bak.cfg"; ifstream in(szFileName); @@ -709,7 +707,7 @@ bool ECConfigImpl::WriteSettingsToFile(const char* szFileName) } // open temp output file - ofstream out(pathOutFile.file_string().c_str()); + ofstream out(path_to_string(pathOutFile.string()).c_str()); settingmap_t::iterator iterSettings; const char* szName = NULL; @@ -730,7 +728,7 @@ bool ECConfigImpl::WriteSettingsToFile(const char* szFileName) // the stdio functions does not work in win release mode in some cases remove(szFileName); - rename(pathOutFile.file_string().c_str(),szFileName); + rename(path_to_string(pathOutFile).c_str(),szFileName); return true; } diff --git a/zarafa/common/Makefile.am b/zarafa/common/Makefile.am index d6d74cf..c3bfa3f 100644 --- a/zarafa/common/Makefile.am +++ b/zarafa/common/Makefile.am @@ -22,7 +22,7 @@ libcommon_mapi_la_include_HEADERS = rtfutil.h mapiext.h ECGuid.h ECTags.h ECDefs HtmlToTextParser.h HtmlEntity.h userutil.h ECFeatures.h ECFeatureList.h ECDebugPrint.h ECInterfaceDefs.h \ HrException.h ECIterators.h ECACL.h pthreadutil.h ECThreadPool.h MAPINotifSink.h \ ECDatabaseMySQL.h fileutil.h IStreamAdapter.h IECExchangeModifyTable.h \ - ConsoleTable.h MAPIConsoleTable.h ECFifoStream.h ECMAPIDebug.h \ + ConsoleTable.h MAPIConsoleTable.h ECFifoStream.h ECMAPIDebug.h boost_compat.h \ $(charset_HEADERS) $(utf8_HEADERS) $(ustringutil_HEADERS) $(mapiptr_HEADERS) libcommon_mapi_la_includedir = $(includedir)/zarafa diff --git a/zarafa/common/Makefile.in b/zarafa/common/Makefile.in index e2704d0..3ef28ca 100644 --- a/zarafa/common/Makefile.in +++ b/zarafa/common/Makefile.in @@ -405,7 +405,7 @@ libcommon_mapi_la_include_HEADERS = rtfutil.h mapiext.h ECGuid.h ECTags.h ECDefs HtmlToTextParser.h HtmlEntity.h userutil.h ECFeatures.h ECFeatureList.h ECDebugPrint.h ECInterfaceDefs.h \ HrException.h ECIterators.h ECACL.h pthreadutil.h ECThreadPool.h MAPINotifSink.h \ ECDatabaseMySQL.h fileutil.h IStreamAdapter.h IECExchangeModifyTable.h \ - ConsoleTable.h MAPIConsoleTable.h ECFifoStream.h ECMAPIDebug.h \ + ConsoleTable.h MAPIConsoleTable.h ECFifoStream.h ECMAPIDebug.h boost_compat.h \ $(charset_HEADERS) $(utf8_HEADERS) $(ustringutil_HEADERS) $(mapiptr_HEADERS) libcommon_mapi_la_includedir = $(includedir)/zarafa diff --git a/zarafa/common/boost_compat.h b/zarafa/common/boost_compat.h new file mode 100644 index 0000000..8223bd0 --- /dev/null +++ b/zarafa/common/boost_compat.h @@ -0,0 +1,87 @@ +/* + * Copyright 2005 - 2012 Zarafa B.V. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation with the following additional + * term according to sec. 7: + * + * According to sec. 7 of the GNU Affero General Public License, version + * 3, the terms of the AGPL are supplemented with the following terms: + * + * "Zarafa" is a registered trademark of Zarafa B.V. The licensing of + * the Program under the AGPL does not imply a trademark license. + * Therefore any rights, title and interest in our trademarks remain + * entirely with us. + * + * However, if you propagate an unmodified version of the Program you are + * allowed to use the term "Zarafa" to indicate that you distribute the + * Program. Furthermore you may use our trademarks where it is necessary + * to indicate the intended purpose of a product or service provided you + * use it in accordance with honest practices in industrial or commercial + * matters. If you want to propagate modified versions of the Program + * under the name "Zarafa" or "Zarafa Server", you may only do so if you + * have a written permission by Zarafa B.V. (to acquire a permission + * please contact Zarafa at trademark@zarafa.com). + * + * The interactive user interface of the software displays an attribution + * notice containing the term "Zarafa" and/or the logo of Zarafa. + * Interactive user interfaces of unmodified and modified versions must + * display Appropriate Legal Notices according to sec. 5 of the GNU + * Affero General Public License, version 3, when you propagate + * unmodified or modified versions of the Program. In accordance with + * sec. 7 b) of the GNU Affero General Public License, version 3, these + * Appropriate Legal Notices must retain the logo of Zarafa or display + * the words "Initial Development by Zarafa" if the display of the logo + * is not reasonably feasible for technical reasons. The use of the logo + * of Zarafa in Legal Notices is allowed for unmodified and modified + * versions of the software. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#ifndef boost_compat_INCLUDED +#define boost_compat_INCLUDED + +#include + +#include + +#if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERION == 2 + +static inline std::string path_to_string(const boost::filesystem::path &p) { + return p.file_string(); +} + +static inline boost::filesystem::path& remove_filename_from_path(boost::filesystem::path &p) { + return p.remove_leaf(); +} + +static inline std::string filename_from_path(const boost::filesystem::path &p) { + return p.leaf(); +} + +#else + +static inline std::string path_to_string(const boost::filesystem::path &p) { + return p.string(); +} + +static inline boost::filesystem::path& remove_filename_from_path(boost::filesystem::path &p) { + return p.remove_filename(); +} + +static inline std::string filename_from_path(const boost::filesystem::path &p) { + return p.filename().string(); +} + +#endif + +#endif // ndef boost_compat_INCLUDED diff --git a/zarafa/configure b/zarafa/configure index 4d34570..0c1e9af 100755 --- a/zarafa/configure +++ b/zarafa/configure @@ -19613,8 +19613,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi -# BOOST_BIND -# BOOST_THREADS([mt]) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the toolset name used by Boost for $CXX" >&5 $as_echo_n "checking for the toolset name used by Boost for $CXX... " >&6; } if test "${boost_cv_lib_tag+set}" = set; then : @@ -20414,47 +20412,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking boost version compatibility" >&5 -$as_echo_n "checking boost version compatibility... " >&6; } -if test -n "$boost_major_version" -a $boost_major_version -ge 146; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: adding backward compatible flags" >&5 -$as_echo "adding backward compatible flags" >&6; } - BOOST_CPPFLAGS="$BOOSTCPPFLAGS -DBOOST_FILESYSTEM_VERSION=2" - - CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS" - LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boost filesystem version 2 presence" >&5 -$as_echo_n "checking for boost filesystem version 2 presence... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include -namespace bfs = boost::filesystem; -int main() { - bfs::path path; - bfs::directory_iterator pi(path); - pi->path().file_string(); -} - -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -else - as_fn_error $? "no, boost is too new" "$LINENO" 5 - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - LIBS=$libs_keep - CFLAGS=$cflags_keep -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi # Check whether --enable-icu was given. if test "${enable_icu+set}" = set; then : @@ -23465,12 +23422,10 @@ Curl libs : $CURL_LIBS Pam libs : $PAM_LIBS Krb5 libs : $KRB5_LIBS TCMalloc lib : $TCMALLOC_LIBS -Boost +Boost : Flags : $BOOST_CPPFLAGS FS ldflags : $BOOST_FILESYSTEM_LDFLAGS FS libs : $BOOST_FILESYSTEM_LIBS -# Thread ldflags : $BOOST_THREAD_LDFLAGS -# Thread libs : $BOOST_THREAD_LIBS ICU libs : $ICU_LIBS Swig : $want_swig Python module : $want_python @@ -23514,12 +23469,10 @@ Curl libs : $CURL_LIBS Pam libs : $PAM_LIBS Krb5 libs : $KRB5_LIBS TCMalloc lib : $TCMALLOC_LIBS -Boost +Boost : Flags : $BOOST_CPPFLAGS FS ldflags : $BOOST_FILESYSTEM_LDFLAGS FS libs : $BOOST_FILESYSTEM_LIBS -# Thread ldflags : $BOOST_THREAD_LDFLAGS -# Thread libs : $BOOST_THREAD_LIBS ICU libs : $ICU_LIBS Swig : $want_swig Python module : $want_python diff --git a/zarafa/configure.ac b/zarafa/configure.ac index 1b1d9ae..e512a93 100644 --- a/zarafa/configure.ac +++ b/zarafa/configure.ac @@ -693,36 +693,8 @@ AC_SUBST(EPOLL_CFLAGS) # Boost BOOST_REQUIRE([1.35]) BOOST_SMART_PTR -# BOOST_BIND -# BOOST_THREADS([mt]) BOOST_FILESYSTEM([mt]) BOOST_DATE_TIME([mt]) -AC_MSG_CHECKING([boost version compatibility]) -if test -n "$boost_major_version" -a $boost_major_version -ge 146; then - AC_MSG_RESULT([adding backward compatible flags]) - BOOST_CPPFLAGS="$BOOSTCPPFLAGS -DBOOST_FILESYSTEM_VERSION=2" - - CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS" - LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" - - AC_MSG_CHECKING([for boost filesystem version 2 presence]) - AC_LINK_IFELSE([ - AC_LANG_SOURCE([ -#include -namespace bfs = boost::filesystem; -int main() { - bfs::path path; - bfs::directory_iterator pi(path); - pi->path().file_string(); -} - ]) ], [ AC_MSG_RESULT([ok]) ], [ AC_MSG_ERROR([no, boost is too new]) - ]) - - LIBS=$libs_keep - CFLAGS=$cflags_keep -else - AC_MSG_RESULT([ok]) -fi AC_ARG_ENABLE(icu, AC_HELP_STRING([--enable-icu],[enable icu support]), [want_icu=${enableval}],[want_icu=auto]) if test "$want_icu" = "no"; then @@ -868,12 +840,10 @@ Curl libs : $CURL_LIBS Pam libs : $PAM_LIBS Krb5 libs : $KRB5_LIBS TCMalloc lib : $TCMALLOC_LIBS -Boost +Boost : Flags : $BOOST_CPPFLAGS FS ldflags : $BOOST_FILESYSTEM_LDFLAGS FS libs : $BOOST_FILESYSTEM_LIBS -# Thread ldflags : $BOOST_THREAD_LDFLAGS -# Thread libs : $BOOST_THREAD_LIBS ICU libs : $ICU_LIBS Swig : $want_swig Python module : $want_python diff --git a/zarafa/mapi4linux/src/m4l.mapisvc.cpp b/zarafa/mapi4linux/src/m4l.mapisvc.cpp index 88e8dae..4864c5c 100644 --- a/zarafa/mapi4linux/src/m4l.mapisvc.cpp +++ b/zarafa/mapi4linux/src/m4l.mapisvc.cpp @@ -56,6 +56,7 @@ #include "mapicode.h" #include "mapitags.h" #include "mapiutil.h" +#include "boost_compat.h" #include "Util.h" @@ -64,6 +65,7 @@ #include namespace ba = boost::algorithm; + #include namespace bfs = boost::filesystem; @@ -125,14 +127,14 @@ HRESULT INFLoader::LoadINFs() if (is_directory(inffile->status())) continue; - string strFilename = inffile->path().file_string(); + string strFilename = path_to_string(inffile->path()); string::size_type pos = strFilename.rfind(".inf", strFilename.size(), strlen(".inf")); if (pos == string::npos || strFilename.size() - pos != strlen(".inf")) // silently skip files not ending in pos continue; - hr = LoadINF(inffile->path().file_string().c_str()); + hr = LoadINF(path_to_string(inffile->path()).c_str()); if (hr != hrSuccess) goto exit; } diff --git a/zarafa/provider/libserver/ECSession.cpp b/zarafa/provider/libserver/ECSession.cpp index b48752e..a5598a1 100644 --- a/zarafa/provider/libserver/ECSession.cpp +++ b/zarafa/provider/libserver/ECSession.cpp @@ -84,6 +84,7 @@ #include "pthreadutil.h" #include "threadutil.h" +#include "boost_compat.h" #include namespace bfs = boost::filesystem; @@ -948,7 +949,7 @@ ECRESULT ECAuthSession::ValidateUserCertificate(struct soap *soap, char *lpszNam if (is_directory(key->status())) continue; - lpFileName = key->path().file_string().c_str(); + lpFileName = path_to_string(key->path()).c_str(); biofile = BIO_new_file(lpFileName, "r"); if (!biofile) { diff --git a/zarafa/provider/server/ECClientUpdate.cpp b/zarafa/provider/server/ECClientUpdate.cpp index 9fee168..e22ffd1 100644 --- a/zarafa/provider/server/ECClientUpdate.cpp +++ b/zarafa/provider/server/ECClientUpdate.cpp @@ -69,6 +69,7 @@ namespace ba = boost::algorithm; #include "ECSessionManager.h" #include "ECDatabase.h" #include "ECStatsCollector.h" +#include "boost_compat.h" /* class and add constructor params? */ extern ECRESULT GetBestServerPath(struct soap *soap, ECSession *lpecSession, const std::string &strServerName, std::string *lpstrServerPath); @@ -357,13 +358,13 @@ bool GetLatestVersionAtServer(char *szUpdatePath, unsigned int ulTrackid, Client bfs::directory_iterator update_last; for (bfs::directory_iterator update(updatesdir); update != update_last; update++) { - std::string strFilename = update->path().leaf(); + std::string strFilename = filename_from_path(update->path()); - if (!bfs::is_regular(*update) && !bfs::is_symlink(*update)) { + if (!bfs::is_regular_file(*update) && !bfs::is_symlink(*update)) { continue; } - if (!ba::starts_with(update->path().leaf(), strFileStart)) { + if (!ba::starts_with(strFilename, strFileStart)) { g_lpLogger->Log(EC_LOGLEVEL_DEBUG, "Client update: trackid: 0x%08X, Ignoring file %s for client update", ulTrackid, strFilename.c_str()); continue; } --MP_/3cqWJpNwgmbTQBJmBP=D72L--