From: "Ivan A. Melnikov" <iv@altlinux.org> To: devel@lists.altlinux.org Subject: Re: [devel] IA: boost 1.51.0 Date: Tue, 11 Sep 2012 08:48:02 +0400 Message-ID: <20120911084802.503934d8@deimos.localdomain> (raw) In-Reply-To: <504E9836.7020102@yandex.ru> [-- Attachment #1: Type: text/plain, Size: 2023 bytes --] On Tue, 11 Sep 2012 05:47:34 +0400 Радик Юсупов <radyus@yandex.ru> wrote: > On 05.09.2012 08:05, Ivan A. Melnikov wrote: > > 3. Если нет, то всё как обычно: иногда всё уже сделал апстрим, > > иногда федора (у них boost 1.50.0 в f18 уже довольно давно). Если > > нет, пишите мне, подготовлю патч. > Прошу помочь с zarafa. Для начала, On Wed, 5 Sep 2012 08:05:03 +0400 "Ivan A. Melnikov" <iv@altlinux.org> wrote: [...] > 2. Найдите, где определён символ препроцессора > BOOST_FILESYSTEM_VERSION в значение 2, и удалите или переопределите в > 3 (я бы удалил, но дело вкуса). [...] В спеке у Вас есть %add_optflags, -DBOOST_FILESYSTEM_VERSION=2 там теперь лишнее. Если его удалить, ошибки станут гораздо веслее ;) > Апстрим судя по гиту еще не чесался: > https://git.zarafa.com/zcp/zcp/commits/7.1 [...] Апстрим чесался в мастере: https://git.zarafa.com/zcp/zcp/commit/c6c79be9cb538fcce3457c9568a3dc6ae39134ea https://git.zarafa.com/zcp/zcp/commit/dc4868099fc3099d1949fbd89ca3c1c318476234 Несколько иной вариант предлагают федоровцы: http://pkgs.fedoraproject.org/cgit/zarafa.git/tree/?h=f18 http://pkgs.fedoraproject.org/cgit/zarafa.git/tree/zarafa-7.0.9-boost150.patch?h=f18 Вариант апстрима имхо лучше, да к тому же это апстрим. Я объединил их две ревизии в один патч, выкинул оттуда модификацию common/ecversion.h, приложил и поправил в спеке add_optflags -- и сборка вроде прошла. Патч прилагаю. -- WBR, Ivan A. Melnikov [-- Attachment #2: zarafa-7.1.0-boost-filesystem-v3-support.patch --] [-- Type: text/x-patch, Size: 13902 bytes --] 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 <marks@zarafa.com> 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 <marks@zarafa.com> 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 <boost/filesystem.hpp> - 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/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 <boost/filesystem.hpp> -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 <boost/filesystem.hpp> -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 <boost/algorithm/string.hpp> namespace ba = boost::algorithm; + #include <boost/filesystem.hpp> 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 <boost/filesystem.hpp> 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; }
next prev parent reply other threads:[~2012-09-11 4:48 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-09-05 4:05 Ivan A. Melnikov 2012-09-05 7:53 ` REAL 2012-09-05 10:16 ` Bergman Andrey 2012-09-05 10:26 ` REAL 2012-09-05 12:37 ` Ivan A. Melnikov 2012-09-06 5:41 ` Ivan A. Melnikov 2012-09-06 5:46 ` REAL 2012-09-06 12:46 ` REAL 2012-09-06 12:50 ` Ivan A. Melnikov 2012-09-06 12:55 ` REAL 2012-09-06 12:58 ` REAL 2012-09-06 13:21 ` Ivan A. Melnikov 2012-09-07 8:45 ` REAL 2012-09-06 15:28 ` Ivan A. Melnikov 2012-09-06 16:43 ` Dubrovskiy Viacheslav 2012-09-11 4:48 ` Ivan A. Melnikov [this message] 2012-09-12 5:30 ` Ivan A. Melnikov 2012-09-12 7:36 ` Ivan A. Melnikov 2012-09-12 5:33 ` REAL 2012-09-12 8:02 ` Motsyo Gennadi aka Drool 2012-09-12 10:17 ` [devel] libtorrent-rasterbar // was: " Ivan A. Melnikov 2012-09-12 10:23 ` REAL 2012-09-12 12:14 ` Ivan A. Melnikov 2012-09-13 4:03 ` [devel] libtorrent-rasterbar Dmitry V. Levin 2012-09-13 4:19 ` REAL 2012-09-13 5:06 ` Motsyo Gennadi aka Drool 2012-09-13 5:13 ` Ivan A. Melnikov 2012-09-13 6:56 ` Igor Vlasenko 2012-09-13 8:32 ` Ivan A. Melnikov 2012-09-13 9:01 ` Ivan A. Melnikov 2012-09-13 9:25 ` Igor Vlasenko 2012-09-13 19:55 ` Ivan A. Melnikov 2012-09-13 21:17 ` Igor Vlasenko 2012-09-12 10:25 ` [devel] libtorrent-rasterbar // was: Re: IA: boost 1.51.0 REAL 2012-10-25 11:41 ` [devel] " George V. Kouryachy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20120911084802.503934d8@deimos.localdomain \ --to=iv@altlinux.org \ --cc=devel@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git