[Pkg-lyx-devel] [SCM] LyX packaging branch, master, updated. upstream/2.0.0_rc3-549-g138209a
Sven Hoexter
sven at timegate.de
Mon Apr 18 12:05:12 UTC 2011
The following commit has been merged in the master branch:
commit 138209a635b71c819916f9b7ca84f5dea2c2609b
Author: Sven Hoexter <sven at timegate.de>
Date: Mon Apr 18 14:02:50 2011 +0200
Add debian/patches/fix-assertion-618687 to fix an assertion during the startup in LyX. (Closes: #618687)
diff --git a/debian/changelog b/debian/changelog
index 460b3a2..97bce7e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ lyx (2.0.0~rc3-2) unstable; urgency=low
* Add debian/patches/path_max_hurd to fix another PATH_MAX problem in LyX.
Patch provided by Pino Toscano. (Closes: #623164)
+ * Add debian/patches/fix-assertion-618687 to fix an assertion during the
+ startup in LyX. (Closes: #618687)
-- Sven Hoexter <hoexter at debian.org> Mon, 18 Apr 2011 13:44:51 +0200
diff --git a/debian/patches/fix-assertion-618687 b/debian/patches/fix-assertion-618687
new file mode 100644
index 0000000..e34c31a
--- /dev/null
+++ b/debian/patches/fix-assertion-618687
@@ -0,0 +1,159 @@
+Fix for an assertion during startup.
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618687
+http://www.lyx.org/trac/ticket/7407
+Patch implemented upstream by Peter Kümmel.
+--- a/src/Buffer.cpp
++++ b/src/Buffer.cpp
+@@ -1147,7 +1147,7 @@ docstring Buffer::emergencyWrite()
+ }
+
+ // 2) In HOME directory.
+- string s = addName(package().home_dir().absFileName(), absFileName());
++ string s = addName(Package::get_home_dir().absFileName(), absFileName());
+ s += ".emergency";
+ lyxerr << ' ' << s << endl;
+ if (writeFile(FileName(s))) {
+--- a/src/support/Package.cpp
++++ b/src/support/Package.cpp
+@@ -88,8 +88,6 @@ void buildDirs(FileName const & abs_bina
+
+ FileName const get_document_dir(FileName const & home_dir);
+
+-FileName const get_home_dir();
+-
+ FileName const get_locale_dir(FileName const & system_support_dir);
+
+ FileName const get_system_support_dir(FileName const & abs_binary,
+@@ -100,9 +98,10 @@ FileName const get_default_user_support_
+ bool userSupportDir(FileName const & default_user_support_dir,
+ string const & command_line_user_support_dir, FileName & result);
+
+-
+ string const & with_version_suffix();
+
++string const fix_dir_name(string const & name);
++
+ } // namespace anon
+
+
+@@ -112,12 +111,11 @@ Package::Package(string const & command_
+ exe_build_dir_to_top_build_dir top_build_dir_location)
+ : explicit_user_support_dir_(false)
+ {
+- home_dir_ = get_home_dir();
+ // Specification of temp_dir_ may be reset by LyXRC,
+ // but the default is fixed for a given OS.
+ system_temp_dir_ = FileName::tempPath();
+ temp_dir_ = system_temp_dir_;
+- document_dir_ = get_document_dir(home_dir_);
++ document_dir_ = get_document_dir(get_home_dir());
+
+ FileName const abs_binary = abs_path_from_binary_name(command_line_arg0);
+ binary_dir_ = FileName(onlyPath(abs_binary.absFileName()));
+@@ -156,7 +154,7 @@ Package::Package(string const & command_
+ locale_dir_ = get_locale_dir(system_support_dir_);
+
+ FileName const default_user_support_dir =
+- get_default_user_support_dir(home_dir_);
++ get_default_user_support_dir(get_home_dir());
+
+ explicit_user_support_dir_ = userSupportDir(default_user_support_dir,
+ command_line_user_support_dir, user_support_dir_);
+@@ -174,7 +172,7 @@ Package::Package(string const & command_
+ << "\tlocale_dir " << locale_dir().absFileName() << '\n'
+ << "\tdocument_dir " << document_dir().absFileName() << '\n'
+ << "\ttemp_dir " << temp_dir().absFileName() << '\n'
+- << "\thome_dir " << home_dir().absFileName() << '\n'
++ << "\thome_dir " << get_home_dir().absFileName() << '\n'
+ << "</package>\n");
+ }
+
+@@ -187,6 +185,19 @@ void Package::set_temp_dir(FileName cons
+ temp_dir_ = temp_dir;
+ }
+
++// The specification of home_dir_ is fixed for a given OS.
++// A typical example on Windows: "C:/Documents and Settings/USERNAME"
++// and on a Posix-like machine: "/home/USERNAME".
++FileName const & Package::get_home_dir()
++{
++#if defined (USE_WINDOWS_PACKAGING)
++ static FileName const home_dir(getEnv("USERPROFILE"));
++#else // Posix-like.
++ static FileName const home_dir(getEnv("HOME"));
++#endif
++ return home_dir;
++}
++
+
+ namespace {
+
+@@ -339,20 +350,6 @@ FileName const get_document_dir(FileName
+ }
+
+
+-// The specification of home_dir_ is fixed for a given OS.
+-// A typical example on Windows: "C:/Documents and Settings/USERNAME"
+-// and on a Posix-like machine: "/home/USERNAME".
+-FileName const get_home_dir()
+-{
+-#if defined (USE_WINDOWS_PACKAGING)
+- string const home_dir = getEnv("USERPROFILE");
+-#else // Posix-like.
+- string const home_dir = getEnv("HOME");
+-#endif
+-
+- return FileName(fix_dir_name(home_dir));
+-}
+-
+
+ // Several sources are probed to ascertain the locale directory.
+ // The only requirement is that the result is indeed a directory.
+--- a/src/support/Package.h
++++ b/src/support/Package.h
+@@ -138,7 +138,7 @@ public:
+ * for the dump.
+ * This may be empty (e. g. when run under a CGI environment)
+ */
+- FileName const & home_dir() const { return home_dir_; }
++ static FileName const & get_home_dir();
+
+ /** Command to run the configure script.
+ * Caution: This is "ready-to-run", i.e. in the locale encoding, not
+@@ -157,7 +157,6 @@ private:
+ mutable FileName document_dir_;
+ mutable FileName temp_dir_;
+ FileName system_temp_dir_;
+- FileName home_dir_;
+ std::string configure_command_;
+ bool explicit_user_support_dir_;
+ };
+--- a/src/support/filetools.cpp
++++ b/src/support/filetools.cpp
+@@ -445,7 +445,7 @@ FileName const makeAbsPath(string const
+ // Split by first /
+ rTemp = split(rTemp, temp, '/');
+ if (temp == "~") {
+- tempBase = package().home_dir().absFileName();
++ tempBase = Package::get_home_dir().absFileName();
+ tempRel = rTemp;
+ }
+
+@@ -541,7 +541,7 @@ string const expandPath(string const & p
+ return FileName::getcwd().absFileName() + '/' + rTemp;
+
+ if (temp == "~")
+- return package().home_dir().absFileName() + '/' + rTemp;
++ return Package::get_home_dir().absFileName() + '/' + rTemp;
+
+ if (temp == "..")
+ return makeAbsPath(copy).absFileName();
+@@ -727,7 +727,7 @@ docstring const makeDisplayPath(string c
+ return from_utf8("[" + str.erase(0, system.length()) + "]");
+
+ // replace /home/blah with ~/
+- string const home = package().home_dir().absFileName();
++ string const home = Package::get_home_dir().absFileName();
+ if (!home.empty() && prefixIs(str, home))
+ str = subst(str, home, "~");
+
diff --git a/debian/patches/series b/debian/patches/series
index 5d653a4..db36f60 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
prefer-xdg-open
path_max_hurd
+fix-assertion-618687
--
LyX packaging
More information about the Pkg-lyx-devel
mailing list