mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
- Adjust to Lars boost::filesystem stuff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9551 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9f1a48707c
commit
aba840c1cb
@ -6,6 +6,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lyx", "lyx.vcproj", "{96777
|
|||||||
{3BF0EC29-8B64-460F-AE0A-96794D38088D} = {3BF0EC29-8B64-460F-AE0A-96794D38088D}
|
{3BF0EC29-8B64-460F-AE0A-96794D38088D} = {3BF0EC29-8B64-460F-AE0A-96794D38088D}
|
||||||
{3BF0EC29-8B64-460F-AE0A-96794D38088D} = {3BF0EC29-8B64-460F-AE0A-96794D38088D}
|
{3BF0EC29-8B64-460F-AE0A-96794D38088D} = {3BF0EC29-8B64-460F-AE0A-96794D38088D}
|
||||||
{3BF0EC29-8B64-460F-AE0A-96794D38088D} = {3BF0EC29-8B64-460F-AE0A-96794D38088D}
|
{3BF0EC29-8B64-460F-AE0A-96794D38088D} = {3BF0EC29-8B64-460F-AE0A-96794D38088D}
|
||||||
|
{684579F5-D732-45CE-BBFB-9419BB98DADC} = {684579F5-D732-45CE-BBFB-9419BB98DADC}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libboost_regex", "..\..\boost\libs\regex\regex.vcproj", "{FDBBC827-4BD2-4E7D-B050-0967A0B6C754}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libboost_regex", "..\..\boost\libs\regex\regex.vcproj", "{FDBBC827-4BD2-4E7D-B050-0967A0B6C754}"
|
||||||
@ -16,6 +17,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libboost_signals", "..\..\b
|
|||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libboost_filesystem", "..\..\boost\libs\filesystem\filesystem.vcproj", "{684579F5-D732-45CE-BBFB-9419BB98DADC}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfiguration) = preSolution
|
GlobalSection(SolutionConfiguration) = preSolution
|
||||||
Debug = Debug
|
Debug = Debug
|
||||||
@ -34,6 +39,10 @@ Global
|
|||||||
{3BF0EC29-8B64-460F-AE0A-96794D38088D}.Debug.Build.0 = Debug|Win32
|
{3BF0EC29-8B64-460F-AE0A-96794D38088D}.Debug.Build.0 = Debug|Win32
|
||||||
{3BF0EC29-8B64-460F-AE0A-96794D38088D}.Release.ActiveCfg = Release|Win32
|
{3BF0EC29-8B64-460F-AE0A-96794D38088D}.Release.ActiveCfg = Release|Win32
|
||||||
{3BF0EC29-8B64-460F-AE0A-96794D38088D}.Release.Build.0 = Release|Win32
|
{3BF0EC29-8B64-460F-AE0A-96794D38088D}.Release.Build.0 = Release|Win32
|
||||||
|
{684579F5-D732-45CE-BBFB-9419BB98DADC}.Debug.ActiveCfg = Debug|Win32
|
||||||
|
{684579F5-D732-45CE-BBFB-9419BB98DADC}.Debug.Build.0 = Debug|Win32
|
||||||
|
{684579F5-D732-45CE-BBFB-9419BB98DADC}.Release.ActiveCfg = Release|Win32
|
||||||
|
{684579F5-D732-45CE-BBFB-9419BB98DADC}.Release.Build.0 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
@ -8612,16 +8612,6 @@
|
|||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\frontends\qt2\moc\QGraphics_moc.C">
|
RelativePath="..\..\src\frontends\qt2\moc\QGraphics_moc.C">
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32">
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32">
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\frontends\qt2\moc\QGraphicsDialog_moc.C">
|
RelativePath="..\..\src\frontends\qt2\moc\QGraphicsDialog_moc.C">
|
||||||
@ -10435,15 +10425,6 @@
|
|||||||
CompileAs="2"/>
|
CompileAs="2"/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\support\atoi.C">
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32">
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
CompileAs="2"/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\support\chdir.C">
|
RelativePath="..\..\src\support\chdir.C">
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
@ -10495,18 +10476,6 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\support\filefilterlist.h">
|
RelativePath="..\..\src\support\filefilterlist.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\support\FileInfo.C">
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32">
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
CompileAs="2"/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\support\FileInfo.h">
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\support\FileMonitor.C">
|
RelativePath="..\..\src\support\FileMonitor.C">
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
@ -10579,6 +10548,12 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\support\forkedcontr.h">
|
RelativePath="..\..\src\support\forkedcontr.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\src\support\fs_extras.C">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\src\support\fs_extras.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\support\getcwd.C">
|
RelativePath="..\..\src\support\getcwd.C">
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
@ -10787,22 +10762,6 @@
|
|||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
|
||||||
Name="boost"
|
|
||||||
Filter="">
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\boost\libs\filesystem\src\convenience.cpp">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\boost\libs\filesystem\src\exception.cpp">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\boost\libs\filesystem\src\operations_posix_windows.cpp">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\boost\libs\filesystem\src\path_posix_windows.cpp">
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
</Globals>
|
</Globals>
|
||||||
|
@ -19,13 +19,13 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
|
|
||||||
#include "support/FileInfo.h"
|
|
||||||
#include "support/filetools.h"
|
#include "support/filetools.h"
|
||||||
#include "support/lstrings.h"
|
#include "support/lstrings.h"
|
||||||
#include "support/os.h"
|
#include "support/os.h"
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
#include <boost/filesystem/operations.hpp>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@ -51,6 +51,8 @@
|
|||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
namespace fs = boost::filesystem;
|
||||||
|
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace support {
|
namespace support {
|
||||||
@ -255,19 +257,7 @@ std::pair<string, string> const get_build_dirs(string const & abs_binary)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether binary is a symbolic link.
|
|
||||||
// If so, resolve it and repeat the exercise.
|
|
||||||
FileInfo const file(binary, true);
|
|
||||||
if (!file.isOK() || !file.isLink())
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
string link;
|
|
||||||
if (LyXReadLink(binary, link, true)) {
|
|
||||||
binary = link;
|
|
||||||
} else {
|
|
||||||
// Unable to resolve the link.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lyxerr[Debug::INIT] << check_text << " no" << std::endl;
|
lyxerr[Debug::INIT] << check_text << " no" << std::endl;
|
||||||
@ -317,14 +307,12 @@ string const get_locale_dir(string const & system_support_dir)
|
|||||||
// be "../locale/".)
|
// be "../locale/".)
|
||||||
path = NormalizePath(AddPath(system_support_dir, relative_locale_dir()));
|
path = NormalizePath(AddPath(system_support_dir, relative_locale_dir()));
|
||||||
|
|
||||||
FileInfo fi(path);
|
if (fs::is_directory(path))
|
||||||
if (fi.isOK() && fi.isDir())
|
|
||||||
return path;
|
return path;
|
||||||
|
|
||||||
// 3. Fall back to the hard-coded LOCALEDIR.
|
// 3. Fall back to the hard-coded LOCALEDIR.
|
||||||
path = hardcoded_localedir();
|
path = hardcoded_localedir();
|
||||||
FileInfo fi2(path);
|
if (fs::is_directory(path))
|
||||||
if (fi2.isOK() && fi2.isDir())
|
|
||||||
return path;
|
return path;
|
||||||
|
|
||||||
return string();
|
return string();
|
||||||
@ -378,7 +366,7 @@ string const get_binary_path(string const & exe)
|
|||||||
// Two possibilities present themselves.
|
// Two possibilities present themselves.
|
||||||
// 1. The binary is relative to the CWD.
|
// 1. The binary is relative to the CWD.
|
||||||
string const abs_exe_path = MakeAbsPath(exe_path);
|
string const abs_exe_path = MakeAbsPath(exe_path);
|
||||||
if (FileInfo(abs_exe_path, true).isOK())
|
if (fs::exists(abs_exe_path))
|
||||||
return abs_exe_path;
|
return abs_exe_path;
|
||||||
|
|
||||||
// 2. exe must be the name of the binary only and it
|
// 2. exe must be the name of the binary only and it
|
||||||
@ -395,7 +383,7 @@ string const get_binary_path(string const & exe)
|
|||||||
string const exe_dir = MakeAbsPath(*it);
|
string const exe_dir = MakeAbsPath(*it);
|
||||||
|
|
||||||
string const exe_path = AddName(exe_dir, exe_name);
|
string const exe_path = AddName(exe_dir, exe_name);
|
||||||
if (FileInfo(exe_path, true).isOK())
|
if (fs::exists(exe_path))
|
||||||
return exe_path;
|
return exe_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,48 +459,7 @@ get_system_support_dir(string const & abs_binary,
|
|||||||
return lyxdir;
|
return lyxdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether binary is a symbolic link.
|
|
||||||
// If so, resolve it and repeat the exercise.
|
|
||||||
FileInfo const file(binary, true);
|
|
||||||
if (!file.isOK() || !file.isLink())
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
string link;
|
|
||||||
if (LyXReadLink(binary, link, true)) {
|
|
||||||
binary = link;
|
|
||||||
} else {
|
|
||||||
// Unable to resolve the link.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. Repeat the exercise on the directory itself.
|
|
||||||
string binary_dir = OnlyPath(abs_binary);
|
|
||||||
while (true) {
|
|
||||||
// This time test whether the directory is a symbolic link
|
|
||||||
// *before* looking for "chkconfig.ltx".
|
|
||||||
// (We've looked relative to the original already.)
|
|
||||||
FileInfo const file(binary_dir, true);
|
|
||||||
if (!file.isOK() || !file.isLink())
|
|
||||||
break;
|
|
||||||
|
|
||||||
string link;
|
|
||||||
if (LyXReadLink(binary_dir, link, true)) {
|
|
||||||
binary_dir = link;
|
|
||||||
} else {
|
|
||||||
// Unable to resolve the link.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try and find "chkconfig.ltx".
|
|
||||||
string const lyxdir =
|
|
||||||
NormalizePath(AddPath(binary_dir, relative_lyxdir));
|
|
||||||
searched_dirs.push_back(lyxdir);
|
|
||||||
|
|
||||||
if (!FileSearch(lyxdir, chkconfig_ltx).empty()) {
|
|
||||||
// Success! "chkconfig.ltx" has been found.
|
|
||||||
return lyxdir;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. In desparation, try the hard-coded system support dir.
|
// 5. In desparation, try the hard-coded system support dir.
|
||||||
@ -657,8 +604,7 @@ bool check_env_var_dir(string const & dir,
|
|||||||
bool check_env_var_dir(string const & dir,
|
bool check_env_var_dir(string const & dir,
|
||||||
string const & env_var)
|
string const & env_var)
|
||||||
{
|
{
|
||||||
FileInfo fi(dir);
|
bool const success = fs::is_directory(dir);
|
||||||
bool const success = (fi.isOK() && fi.isDir());
|
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
// Put this string on a single line so that the gettext
|
// Put this string on a single line so that the gettext
|
||||||
|
Loading…
Reference in New Issue
Block a user