mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-07 17:55:30 +00:00
Fix bug 3220
* src/insets/ExternalSupport.C (updateExternal): Avoid computing crc of a directory as this leads to a crash on Cygwin. * lib/configure.py: Use a python script to get the current date in order to avoid a stalling condition with the date command on Win32. * lib/scripts/date.py: New python script. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@17177 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
65a8fdc68e
commit
96a6e50ceb
@ -2142,6 +2142,7 @@ lib_scripts_files = Split('''
|
|||||||
TeXFiles.py
|
TeXFiles.py
|
||||||
clean_dvi.py
|
clean_dvi.py
|
||||||
convertDefault.py
|
convertDefault.py
|
||||||
|
date.py
|
||||||
fen2ascii.py
|
fen2ascii.py
|
||||||
fig2pdftex.py
|
fig2pdftex.py
|
||||||
fig2pstex.py
|
fig2pstex.py
|
||||||
|
@ -920,6 +920,7 @@ dist_scripts_PYTHON = \
|
|||||||
scripts/TeXFiles.py \
|
scripts/TeXFiles.py \
|
||||||
scripts/clean_dvi.py \
|
scripts/clean_dvi.py \
|
||||||
scripts/convertDefault.py \
|
scripts/convertDefault.py \
|
||||||
|
scripts/date.py \
|
||||||
scripts/fen2ascii.py \
|
scripts/fen2ascii.py \
|
||||||
scripts/fig2pdftex.py \
|
scripts/fig2pdftex.py \
|
||||||
scripts/fig2pstex.py \
|
scripts/fig2pstex.py \
|
||||||
|
@ -438,7 +438,7 @@ def checkConverterEntries():
|
|||||||
#
|
#
|
||||||
# Entried that do not need checkProg
|
# Entried that do not need checkProg
|
||||||
addToRC(r'''\converter lyxpreview ppm "python -tt $$s/scripts/lyxpreview2bitmap.py" ""
|
addToRC(r'''\converter lyxpreview ppm "python -tt $$s/scripts/lyxpreview2bitmap.py" ""
|
||||||
\converter date dateout "date +%d-%m-%Y > $$o" ""
|
\converter date dateout "python -tt $$s/scripts/date.py %d-%m-%Y > $$o" ""
|
||||||
\converter docbook docbook-xml "cp $$i $$o" "xml"
|
\converter docbook docbook-xml "cp $$i $$o" "xml"
|
||||||
\converter fen asciichess "python -tt $$s/scripts/fen2ascii.py $$i $$o" ""
|
\converter fen asciichess "python -tt $$s/scripts/fen2ascii.py $$i $$o" ""
|
||||||
\converter fig pdftex "python -tt $$s/scripts/fig2pdftex.py $$i $$o" ""
|
\converter fig pdftex "python -tt $$s/scripts/fig2pdftex.py $$i $$o" ""
|
||||||
|
33
lib/scripts/date.py
Executable file
33
lib/scripts/date.py
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: iso-8859-1 -*-
|
||||||
|
|
||||||
|
# file date.py
|
||||||
|
# This file is part of LyX, the document processor.
|
||||||
|
# Licence details can be found in the file COPYING.
|
||||||
|
|
||||||
|
# \author Enrico Forestieri
|
||||||
|
|
||||||
|
# Full author contact details are available in file CREDITS.
|
||||||
|
|
||||||
|
# Print the system date and time in the given format. See the python
|
||||||
|
# documentation for available formats (mostly the same as the POSIX std).
|
||||||
|
# This file is provided because the date command on Windows is not
|
||||||
|
# POSIX compliant.
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from time import strftime
|
||||||
|
|
||||||
|
def main(argv):
|
||||||
|
if len(argv) > 2:
|
||||||
|
sys.stderr.write('Usage: python date.py [<format>]\n')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if len(argv) == 2:
|
||||||
|
format = argv[1]
|
||||||
|
else:
|
||||||
|
format = "%d-%m-%Y"
|
||||||
|
|
||||||
|
print strftime(format)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main(sys.argv)
|
@ -31,17 +31,19 @@
|
|||||||
#include "support/os.h"
|
#include "support/os.h"
|
||||||
#include "support/package.h"
|
#include "support/package.h"
|
||||||
#include "support/path.h"
|
#include "support/path.h"
|
||||||
|
|
||||||
#include "support/std_ostream.h"
|
#include "support/std_ostream.h"
|
||||||
|
|
||||||
|
#include <boost/filesystem/operations.hpp>
|
||||||
|
|
||||||
namespace support = lyx::support;
|
namespace support = lyx::support;
|
||||||
|
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
|
||||||
using std::ostream;
|
using std::ostream;
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
|
using boost::filesystem::is_directory;
|
||||||
|
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace external {
|
namespace external {
|
||||||
@ -254,7 +256,7 @@ void updateExternal(InsetExternalParams const & params,
|
|||||||
string const temp_file =
|
string const temp_file =
|
||||||
support::MakeAbsPath(params.filename.mangledFilename(),
|
support::MakeAbsPath(params.filename.mangledFilename(),
|
||||||
m_buffer->temppath());
|
m_buffer->temppath());
|
||||||
if (!abs_from_file.empty()) {
|
if (!abs_from_file.empty() && !is_directory(abs_from_file)) {
|
||||||
unsigned long const from_checksum = support::sum(abs_from_file);
|
unsigned long const from_checksum = support::sum(abs_from_file);
|
||||||
unsigned long const temp_checksum = support::sum(temp_file);
|
unsigned long const temp_checksum = support::sum(temp_file);
|
||||||
|
|
||||||
|
@ -237,6 +237,9 @@ What's new
|
|||||||
- add Aspell/Pspell's file extension for personal dictionary files
|
- add Aspell/Pspell's file extension for personal dictionary files
|
||||||
in preferences (bug 895)
|
in preferences (bug 895)
|
||||||
|
|
||||||
|
- Fix hang/crash on Windows/Cygwin when using the external date inset
|
||||||
|
(bug 3220).
|
||||||
|
|
||||||
* BUILD/INSTALLATION:
|
* BUILD/INSTALLATION:
|
||||||
|
|
||||||
- Allow autoconf 2.60 and 2.61 for building.
|
- Allow autoconf 2.60 and 2.61 for building.
|
||||||
|
Loading…
Reference in New Issue
Block a user