mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-14 17:39:58 +00:00
Account for extensions when creating a LyX archive
LyX archives created after importing a LaTeX document may not include bibliography style and catalog files. This is because tex2lyx does not remove extensions, but the lyxpak script expects files without extensions. So, teach lyxpak to also take possible extensions into account. Fixes #13129
This commit is contained in:
parent
8ac13125c6
commit
480ae7f22e
@ -191,8 +191,11 @@ def gather_files(curfile, incfiles, lyx2lyx):
|
|||||||
file = match.group(3).strip(b'"')
|
file = match.group(3).strip(b'"')
|
||||||
if file.startswith(b"bibtotoc,"):
|
if file.startswith(b"bibtotoc,"):
|
||||||
file = file[9:]
|
file = file[9:]
|
||||||
|
ext = os.path.splitext(file)[-1]
|
||||||
|
if ext != b'.bst':
|
||||||
|
file = file + b'.bst'
|
||||||
if not os.path.isabs(file):
|
if not os.path.isabs(file):
|
||||||
file = os.path.join(curdir, file + b'.bst')
|
file = os.path.join(curdir, file)
|
||||||
if os.path.exists(unicode(file, 'utf-8')):
|
if os.path.exists(unicode(file, 'utf-8')):
|
||||||
incfiles.append(abspath(file))
|
incfiles.append(abspath(file))
|
||||||
i += 1
|
i += 1
|
||||||
@ -204,10 +207,12 @@ def gather_files(curfile, incfiles, lyx2lyx):
|
|||||||
bibfiles = match.group(3).strip(b'"').split(b',')
|
bibfiles = match.group(3).strip(b'"').split(b',')
|
||||||
j = 0
|
j = 0
|
||||||
while j < len(bibfiles):
|
while j < len(bibfiles):
|
||||||
if os.path.isabs(bibfiles[j]):
|
file = bibfiles[j]
|
||||||
file = bibfiles[j] + b'.bib'
|
ext = os.path.splitext(file)[-1]
|
||||||
else:
|
if ext != b'.bib':
|
||||||
file = os.path.join(curdir, bibfiles[j] + b'.bib')
|
file = file + b'.bib'
|
||||||
|
if not os.path.isabs(file):
|
||||||
|
file = os.path.join(curdir, file)
|
||||||
if os.path.exists(unicode(file, 'utf-8')):
|
if os.path.exists(unicode(file, 'utf-8')):
|
||||||
incfiles.append(abspath(file))
|
incfiles.append(abspath(file))
|
||||||
j += 1
|
j += 1
|
||||||
|
@ -79,6 +79,9 @@ What's new
|
|||||||
|
|
||||||
- Fix tabular styles on systems with blanks in system directory path.
|
- Fix tabular styles on systems with blanks in system directory path.
|
||||||
|
|
||||||
|
- Fix inclusion of bibliography files in a LyX archive when the document
|
||||||
|
was imported from a LaTeX source (bug 13129).
|
||||||
|
|
||||||
|
|
||||||
* USER INTERFACE
|
* USER INTERFACE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user